From: Max Kellermann <max.kellermann@ionos.com>
To: David Hildenbrand <david@redhat.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, willy@infradead.org,
sfr@canb.auug.org.au
Subject: Re: [PATCH v4 00/15] Fast kernel headers: split linux/mm.h
Date: Tue, 12 Mar 2024 20:50:55 +0100 [thread overview]
Message-ID: <CAKPOu+-SMvjfyNGO-Dt8SahF3TOmLaLFE_yP+KQxk0wdHpFeWQ@mail.gmail.com> (raw)
In-Reply-To: <f959c4c4-8118-436c-83fd-d299689f753a@redhat.com>
On Tue, Mar 12, 2024 at 8:26 PM David Hildenbrand <david@redhat.com> wrote:
> It's always a good idea to include at least some sentences about
> history+motivation in the cover letter.
Agree, thanks for your review and for the suggestions, that was very
useful. Once somebody points it out, it's suddenly obvious what was
missing in my explanations for others to understand my motivation.
I'll add some more text to the cover letter.
> Okay, so "Fast kernel headers:" is a bit misleading :P
Yeah. It was the name chosen by Ingo Molnar for his header cleanup
project, and some of his work was merged several years ago, so I
thought this phrase would be familiar and would bring back memories
from these discussions.
> (although I don't immediately understand what correctness means in this
> context)
Some sources don't include all the headers they need; but by chance,
this happens to work because deep down the include tree, somebody
includes kernel.h, mm.h or fs.h and that pulls in everything else;
thus incorrect includes are never a visible problem. By reducing
includes to the bare minimum, many of those problems are revealed (by
producing compiler errors that then have to be fixed). I very much
like to write code in a way that the compiler points out some kinds of
mistakes - I rather have a build-time error than a silent runtime
breakage.
Incorrect includes are not just a theoretical problem; imagine all the
asm-generic headers that provide fallback definitions for macros that
are not defined on some architectures (e.g. asm-generic/cacheflush.h).
If, on some sources, the arch-specific header happens to be not
included or defines the macro in the wrong header (I've seen it all),
you suddenly randomly get the correct arch macro or the generic
fallback macro, leading to inconsistencies, hidden ABI breakages that
may lead to severe problems that will be hard to debug. One can
imagine many more ways that code can break silently at runtime due to
incorrect code (that usually works most of the time, but only by
chance). Better be explicit about what you really need to include, and
don't rely on other headers to indirectly include what you need.
Include what you need even if somebody else down the tree had already
included it, because that somebody else may change his mind at some
point, and then your source shouldn't break.
> The problem I see
> is that once your stuff is merged, it will start getting messed up again
> over time. But maybe that's just the way it works.
It is. This is like cleaning your house: the following day, somebody
visits you and brings nice presents (feature patches) but has dirty
shoes, and then you have to clean the house again... that's the
infinite cycle of software development, as we all know it.
Max
prev parent reply other threads:[~2024-03-12 19:51 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-12 9:41 Max Kellermann
2024-03-12 9:41 ` [PATCH v4 01/15] drivers: add missing includes on linux/mm.h (and others) Max Kellermann
2024-03-12 9:41 ` [PATCH v4 02/15] include/drm/drm_gem.h: add poll_table_struct forward declaration Max Kellermann
2024-03-12 9:41 ` [PATCH v4 03/15] include/scsi/scsicam.h: forward-declare struct block_device Max Kellermann
2024-03-12 9:41 ` [PATCH v4 04/15] linux/mm.h: move page_kasan_tag() to mm/page_kasan_tag.h Max Kellermann
2024-03-12 9:41 ` [PATCH v4 05/15] linux/mm.h: move section functions to mm/page_section.h Max Kellermann
2024-03-12 9:41 ` [PATCH v4 06/15] linux/mm.h: move page_address() and others to mm/page_address.h Max Kellermann
2024-03-12 9:41 ` [PATCH v4 07/15] linux/mm.h: move folio_size(), ... to mm/folio_size.h Max Kellermann
2024-03-12 9:41 ` [PATCH v4 08/15] linux/mm.h: move folio_next() to mm/folio_next.h Max Kellermann
2024-03-12 9:41 ` [PATCH v4 09/15] linux/mm.h: move devmap-related declarations to mm/devmap_managed.h Max Kellermann
2024-03-12 9:41 ` [PATCH v4 10/15] linux/mm.h: move usage count functions to mm/folio_usage.h Max Kellermann
2024-03-12 9:41 ` [PATCH v4 11/15] linux/mm.h: move page_zone_id() and more to mm/folio_zone.h Max Kellermann
2024-03-12 9:41 ` [PATCH v4 12/15] linux/mm.h: move pfmemalloc-related functions to pfmemalloc.h Max Kellermann
2024-03-12 9:41 ` [PATCH v4 13/15] linux/mm.h: move is_vmalloc_addr() to mm/vmalloc_addr.h Max Kellermann
2024-03-12 9:41 ` [PATCH v4 14/15] linux/mm.h: move high_memory to mm/high_memory.h Max Kellermann
2024-03-12 9:41 ` [PATCH v4 15/15] include: reduce dependencies on linux/mm.h Max Kellermann
2024-03-12 16:10 ` [PATCH v4 00/15] Fast kernel headers: split linux/mm.h David Hildenbrand
2024-03-12 16:27 ` Max Kellermann
2024-03-12 16:32 ` David Hildenbrand
2024-03-12 18:11 ` Max Kellermann
2024-03-12 19:26 ` David Hildenbrand
2024-03-12 19:50 ` Max Kellermann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAKPOu+-SMvjfyNGO-Dt8SahF3TOmLaLFE_yP+KQxk0wdHpFeWQ@mail.gmail.com \
--to=max.kellermann@ionos.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sfr@canb.auug.org.au \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox