linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Matthew Wilcox <willy@infradead.org>
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: Sun, 20 Aug 2023 21:13:55 -0400	[thread overview]
Message-ID: <ZOK6U4vOFn8IbcGp@x1n> (raw)
In-Reply-To: <ZN/tRLy0e+Iod9z3@casper.infradead.org>

On Fri, Aug 18, 2023 at 11:14:28PM +0100, Matthew Wilcox wrote:
> On Tue, Aug 15, 2023 at 05:06:59PM -0400, Peter Xu wrote:
> > I split this out from another rfc series.  Removed RFC tag because it
> > wasn't for this patch but for the documentation updates.  I'll post the rfc
> > part alone.  Comments welcomed, thanks.
> 
> I still hate it, as I explained here:

I still prefer it be merged.

> 
> https://lore.kernel.org/linux-mm/ZNp7yUgUrIpILnXu@casper.infradead.org/

https://lore.kernel.org/linux-mm/ZNqFv0AwkfDKExiw@x1n/#t

Firstly, I've answered and you didn't follow that up.

This is not identical to that version, it added one more change to remove
the other hard coded "2" 

> 
> > > + * When the tail page's mapping field reused, it'll be exempted from
> > > + * ->mapping poisoning and checks.  Also see the macro TAIL_MAPPING.
> > > + */
> > > +#define  TAIL_MAPPING_REUSED_MAX  (2)
> > 
> > More importantly, I think this is over-parametrisation.  If you start to
> > use extra fields in struct folio, just change the code in page_alloc.c
> > directly.

Change the hard-coded "2"s in different functions?  Can you kindly explain
why can't we just have a macro to help?

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);
 }

Do you mean you prefer me to add one more hard-coded "2" and "just boost it
when it's needed"?

Thanks,

-- 
Peter Xu



  reply	other threads:[~2023-08-21  1:14 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 [this message]
2023-08-21  2:29     ` Matthew Wilcox
2023-08-21 16:48       ` Peter Xu
2023-08-22 15:18         ` Matthew Wilcox

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=ZOK6U4vOFn8IbcGp@x1n \
    --to=peterx@redhat.com \
    --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=shy828301@gmail.com \
    --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