All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Yajun Deng <yajun.deng@linux.dev>
Cc: akpm@linux-foundation.org, mike.kravetz@oracle.com,
	muchun.song@linux.dev, willy@infradead.org, david@redhat.com,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] mm: pass page count and reserved to __init_single_page
Date: Thu, 28 Sep 2023 08:30:39 +0300	[thread overview]
Message-ID: <20230928053039.GR3303@kernel.org> (raw)
In-Reply-To: <20230926023341.991124-2-yajun.deng@linux.dev>

On Tue, Sep 26, 2023 at 10:33:40AM +0800, Yajun Deng wrote:
> When we init a single page, we need to mark this page reserved if it
> does. And some pages may not need to set page count, such as compound
> pages.
> 
> Introduce enum init_page_flags, the caller init page count and mark page
> reserved by passing INIT_PAGE_COUNT and INIT_PAGE_RESERVED.
> 
> Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
> ---
> v3: Introduce enum init_page_flags.
> v2: Introduce INIT_PAGE_COUNT and INIT_PAGE_RESERVED.
> v1: https://lore.kernel.org/all/20230922070923.355656-1-yajun.deng@linux.dev/
> ---
>  mm/hugetlb.c  |  2 +-
>  mm/internal.h |  8 +++++++-
>  mm/mm_init.c  | 31 +++++++++++++++++--------------
>  3 files changed, 25 insertions(+), 16 deletions(-)
> 
> diff --git a/mm/mm_init.c b/mm/mm_init.c
> index 06a72c223bce..07fe7e489769 100644
> --- a/mm/mm_init.c
> +++ b/mm/mm_init.c
> @@ -1041,7 +1043,7 @@ static void __ref memmap_init_compound(struct page *head,
>  	for (pfn = head_pfn + 1; pfn < end_pfn; pfn++) {
>  		struct page *page = pfn_to_page(pfn);
>  
> -		__init_zone_device_page(page, pfn, zone_idx, nid, pgmap);
> +		__init_zone_device_page(page, pfn, zone_idx, nid, pgmap, 0);

I think the first patch should not contain any functional changes, but only
add the flags parameter to __init_single_page().

>  		prep_compound_tail(head, pfn - head_pfn);
>  		set_page_count(page, 0);
>  

-- 
Sincerely yours,
Mike.

  parent reply	other threads:[~2023-09-28  5:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26  2:33 [PATCH v3 0/2] mm: Don't set and reset page count in MEMINIT_EARLY Yajun Deng
2023-09-26  2:33 ` [PATCH v3 1/2] mm: pass page count and reserved to __init_single_page Yajun Deng
2023-09-26  7:44   ` David Hildenbrand
2023-09-26  7:57     ` Yajun Deng
2023-09-28  5:30   ` Mike Rapoport [this message]
2023-09-26  2:33 ` [PATCH v3 2/2] mm: Init page count in reserve_bootmem_region when MEMINIT_EARLY Yajun Deng

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=20230928053039.GR3303@kernel.org \
    --to=rppt@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=muchun.song@linux.dev \
    --cc=willy@infradead.org \
    --cc=yajun.deng@linux.dev \
    /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.