All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nico Pache <npache@redhat.com>
To: Mike Kravetz <mike.kravetz@oracle.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	muchun.song@linux.dev, akpm@linux-foundation.org,
	willy@infradead.org, gerald.schaefer@linux.ibm.com,
	sidhartha.kumar@oracle.com
Subject: Re: [RFC V2] mm: add the zero case to page[1].compound_nr in set_compound_order
Date: Tue, 13 Dec 2022 16:53:30 -0700	[thread overview]
Message-ID: <CAA1CXcB653kDtF90oWUgVA3TDUrJHac-WPe1HdsQtRwtN5B3gA@mail.gmail.com> (raw)
In-Reply-To: <Y5kPKpNp5qCnZEWy@monkey>

Hi Mike,

Thanks for the pointer! Would the branchless conditional be an
improvement over the current approach? I'm not sure how hot this path
is, but it may be worth the optimization.

-- Nico

On Tue, Dec 13, 2022 at 4:48 PM Mike Kravetz <mike.kravetz@oracle.com> wrote:
>
> On 12/13/22 16:45, Nico Pache wrote:
> > Since commit 1378a5ee451a ("mm: store compound_nr as well as
> > compound_order") the page[1].compound_nr must be explicitly set to 0 if
> > calling set_compound_order(page, 0).
> >
> > This can lead to bugs if the caller of set_compound_order(page, 0) forgets
> > to explicitly set compound_nr=0. An example of this is commit ba9c1201beaa
> > ("mm/hugetlb: clear compound_nr before freeing gigantic pages")
>
> There has been some recent work in this area.  The latest patch being,
> https://lore.kernel.org/linux-mm/20221213212053.106058-1-sidhartha.kumar@oracle.com/
>
> --
> Mike Kravetz
>


  reply	other threads:[~2022-12-13 23:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-13 23:45 [RFC V2] mm: add the zero case to page[1].compound_nr in set_compound_order Nico Pache
2022-12-13 23:47 ` Mike Kravetz
2022-12-13 23:53   ` Nico Pache [this message]
2022-12-14  0:27     ` Nico Pache
2022-12-14  1:02       ` Mike Kravetz
2022-12-14  6:38         ` Sidhartha Kumar
2022-12-15  1:05           ` Nico Pache
2022-12-14  1:43 ` kernel test robot
2022-12-14  5:25 ` kernel test robot
2022-12-14 17:04 ` Matthew Wilcox
2022-12-15  2:48   ` Nico Pache
2022-12-15 21:38     ` Nico Pache
2022-12-15 21:47       ` Matthew Wilcox
2022-12-15 22:02         ` Nico Pache
2022-12-16  6:46 ` kernel test robot

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=CAA1CXcB653kDtF90oWUgVA3TDUrJHac-WPe1HdsQtRwtN5B3gA@mail.gmail.com \
    --to=npache@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=gerald.schaefer@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=muchun.song@linux.dev \
    --cc=sidhartha.kumar@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.