All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Yang <richard.weiyang@gmail.com>
To: David Hildenbrand <david@redhat.com>
Cc: Wei Yang <richard.weiyang@gmail.com>,
	akpm@linux-foundation.org, rppt@kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 4/4] mm/page_alloc: no need to ClearPageReserved on giving page to buddy system
Date: Sat, 29 Jun 2024 08:48:31 +0000	[thread overview]
Message-ID: <20240629084831.tlf47h4fd4vftl76@master> (raw)
In-Reply-To: <299a4d6a-6b76-49b7-be2e-573cd66fd46f@redhat.com>

On Sat, Jun 29, 2024 at 08:28:30AM +0200, David Hildenbrand wrote:
>On 29.06.24 08:25, David Hildenbrand wrote:
>> On 29.06.24 03:33, Wei Yang wrote:
>> > Function __free_pages_core() is only used in the following two cases to
>> > put page to buddy system:
>> > 
>> > * free bootmem
>> > * free hot-add memory
>> > 
>> > After the above cleanup, there is no case to free page with PG_reserved
>> > set. Let's remove the clear operation.
>> > 
>> > The page initialization time shows 6.5% faster with a 6G qemu virtual
>> > machine.
>> > 
>> > Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>> > CC: David Hildenbrand <david@redhat.com>
>> > CC: Mike Rapoport (IBM) <rppt@kernel.org>
>> > ---
>> >    mm/page_alloc.c | 2 --
>> >    1 file changed, 2 deletions(-)
>> > 
>> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> > index 51a47db375b6..bc7316744a34 100644
>> > --- a/mm/page_alloc.c
>> > +++ b/mm/page_alloc.c
>> > @@ -1232,10 +1232,8 @@ void __meminit __free_pages_core(struct page *page, unsigned int order)
>> >    	prefetchw(p);
>> >    	for (loop = 0; loop < (nr_pages - 1); loop++, p++) {
>> >    		prefetchw(p + 1);
>> > -		__ClearPageReserved(p);
>> >    		set_page_count(p, 0);
>> >    	}
>> > -	__ClearPageReserved(p);
>> >    	set_page_count(p, 0);
>> >    	atomic_long_add(nr_pages, &page_zone(page)->managed_pages);
>> 
>> Again see mm/mm-stable where that code changed.
>> 
>> I think we can still get reserved pages here, for example via
>> kmsan_memblock_free_pages().
>> 

You mean ZONDE_DEVICE pages?

If yes, I think the normal memblock_free_pages() still could get reserved pages.
Am I right?

>
>Sorry, I meant kmsan_memblock_discard().

Yep.

>-- 
>Cheers,
>
>David / dhildenb

-- 
Wei Yang
Help you, Help me


      parent reply	other threads:[~2024-06-29  8:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-29  1:33 [PATCH 1/4] mm: use zonelist_zone() to get zone Wei Yang
2024-06-29  1:33 ` [PATCH 2/4] mm: not __SetPageReserved on initializing hot-plugged memory Wei Yang
2024-06-29  6:19   ` David Hildenbrand
2024-06-29  8:32     ` Wei Yang
2024-06-29 14:38       ` David Hildenbrand
2024-06-30  7:32         ` Wei Yang
2024-06-29  1:33 ` [PATCH 3/4] mm/page_alloc: put __free_pages_core() in __meminit section Wei Yang
2024-06-29  1:33 ` [PATCH 4/4] mm/page_alloc: no need to ClearPageReserved on giving page to buddy system Wei Yang
2024-06-29  3:21   ` Matthew Wilcox
2024-06-29  8:44     ` Wei Yang
2024-06-29 16:28       ` Matthew Wilcox
2024-06-29 16:45         ` Matthew Wilcox
2024-06-30  7:30           ` Wei Yang
     [not found]   ` <4a93f7b7-8ba8-4877-99c7-1048674d074d@redhat.com>
     [not found]     ` <299a4d6a-6b76-49b7-be2e-573cd66fd46f@redhat.com>
2024-06-29  8:48       ` Wei Yang [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=20240629084831.tlf47h4fd4vftl76@master \
    --to=richard.weiyang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=rppt@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 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.