From: Matthew Wilcox <willy@infradead.org>
To: Peter Xu <peterx@redhat.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Yang Shi <shy828301@gmail.com>,
Mike Kravetz <mike.kravetz@oracle.com>,
David Hildenbrand <david@redhat.com>,
"Kirill A . Shutemov" <kirill@shutemov.name>,
Hugh Dickins <hughd@google.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mm: Wire up tail page poisoning over ->mappings
Date: Tue, 22 Aug 2023 16:18:55 +0100 [thread overview]
Message-ID: <ZOTR3wJP5m6qgwaF@casper.infradead.org> (raw)
In-Reply-To: <ZOOVUgsCcLx2ZxtI@x1n>
On Mon, Aug 21, 2023 at 12:48:18PM -0400, Peter Xu wrote:
> On Mon, Aug 21, 2023 at 03:29:01AM +0100, Matthew Wilcox wrote:
> > On Sun, Aug 20, 2023 at 09:13:55PM -0400, Peter Xu wrote:
> > > Setting tail mapping for tail 1/2 is even wrong, which part of this patch
> > > fixes:
> > >
> > > @@ -428,7 +428,8 @@ static inline void prep_compound_tail(struct page *head, int tail_idx)
> > > {
> > > struct page *p = head + tail_idx;
> > >
> > > - p->mapping = TAIL_MAPPING;
> > > + if (tail_idx > TAIL_MAPPING_REUSED_MAX)
> > > + p->mapping = TAIL_MAPPING;
> > > set_compound_head(p, head);
> > > set_page_private(p, 0);
> > > }
> >
> > I didn't see this. This is wrong. tail->mapping is only reused for
> > large rmappable pages. It's not reused for other compound pages.
>
> Just to make sure we're on the same page: I think it's not only
> _deferred_list (of tail page 2) that reused the mapping field (word offset
> 3), but also _nr_pages_mapped (of tail page 1)?
I don't see how this comment is related to the part of the email you're
replying to. But yes, prep_large_rmappable overwrites ->mapping in
two tail pages.
> > However, I have a small patch series which enables 'allnoconfig' to
> > build after renaming page->mapping to page->_mapping. Aside from fs/
> > there are *very* few places which look at page->mapping [1]. I'll post
> > that patch series tomorrow.
>
> Assuming it's still not yet posted; I can wait and read it.
I sent out a few patches. Some have made it to -next already because
they're almost trivial. Nobody's commented on the difficult one.
https://lore.kernel.org/linux-mm/20230821202016.2910321-1-willy@infradead.org/
> If you plan to remove the whole TAIL_MAPPING in a few days then I agree
> this patch is not needed, but so far I don't know when it'll land and also
> why, before that it does sound like we can still keep this patch.
This patch is putting fresh paint on a condemned building. Just stop
it.
> Regarding the question on "why removing TAIL_MAPPING": poisoning an unused
> field is always helpful to me even if not referenced with "page->mapping".
> So I don't see an immediate benefit from removing the poisoning if it's
> already there; OTOH not sure whether poison more unused fields will be more
> helpful in general?
You are wrong.
prev parent reply other threads:[~2023-08-22 15:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-15 21:06 Peter Xu
2023-08-18 22:14 ` Matthew Wilcox
2023-08-21 1:13 ` Peter Xu
2023-08-21 2:29 ` Matthew Wilcox
2023-08-21 16:48 ` Peter Xu
2023-08-22 15:18 ` Matthew Wilcox [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=ZOTR3wJP5m6qgwaF@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=hughd@google.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
--cc=peterx@redhat.com \
--cc=shy828301@gmail.com \
/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