From: "Noah J. Misch" <noah@caltech.edu>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Missing include in swap.h for some architectures
Date: Tue, 21 Oct 2003 06:47:54 -0700 (PDT) [thread overview]
Message-ID: <Pine.GSO.4.58.0310210421000.26573@clyde> (raw)
In-Reply-To: <20031020022536.796531c4.akpm@osdl.org>
On Mon, 20 Oct 2003, Andrew Morton wrote:
> "Noah J. Misch" <noah@caltech.edu> wrote:
> >
> > # The linux/swap.h header uses the page_cache_release and release_pages
> > # functions declared in linux/pagemap.h when CONFIG_SWAP is disabled. Add
> > # an include of linux/pagemap.h so swap.h finds those declarations on
> > # architectures that don't include pagemap.h indirectly.
>
> This carries a small risk of breaking things. I think I'd prefer that the
> offending .c files just include pagemap.h please.
I think I understand your argument, but consider this:
Adding includes very rarely breaks code, and when it does, the cause is a real
defect and the symptom is usually an easily fixed compilation error.
Furthermore, it's not, by and large, the .c files that are "offending" - it's
the static inline functions tlb_flush_mmu and tlb_remove page, both defined in
asm/tlb.h. With the current swap.h, those functions need pagemap.h included to
compile cleanly with SWAP=n. That means that every .c file that includes tlb.h,
directly or indirectly, _must_ somehow also include pagemap.h, regardless of why
it may be including tlb.h, or it gets slapped with a warning or worse.
If we make the file responsible for the pagemap.h dependency, swap.h, clean up
after itself, we can clear up ancillary breakage now. MM code that doesn't
compile isn't likely to remain unfixed for long. If we expect every .c file
that includes tlb.h to include pagemap.h, and we know that they may fail to do
so and build without a hitch on some architectures, that sets us up for fixing
odd breakage here and there over time.
prev parent reply other threads:[~2003-10-21 13:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-20 5:17 Noah J. Misch
2003-10-20 9:25 ` Andrew Morton
2003-10-21 13:47 ` Noah J. Misch [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=Pine.GSO.4.58.0310210421000.26573@clyde \
--to=noah@caltech.edu \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®