From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta0.migadu.com (out-190.mta0.migadu.com [91.218.175.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 230433254BB for ; Tue, 25 Aug 2026 13:42:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.190 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787665381; cv=none; b=bBOnfIIlbdQDikg2Ji6cCKML5PbEWW+VKXr7LLdvU2HDnVMNBpNQNUc9Wzqpa9oQYsyQT4/wpaUkGxnO9c5tdxa56qOIuhBCTLypw58I9AloTrBLW1F1NDAqgWXqSk4LzTBwzV7MJ5sqhx48ERGyhD4xQRoaeP50fUEUCoXH30U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787665381; c=relaxed/simple; bh=FfZDNuOqOdy6idQcHsHOcRGqdcW1dVvnf7/eAaFIrq0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BnsIjXHzmAVdinz0J98uqo6rFZqLfBcT0GKzKk73+5mVamHhOI6H1TwqSz0BLUQAJ2PlQVJ7qE9s0LQDTPsZxyn3IdmDFPB6HitlPQLg9FQKnU2bH8KXnl8HhoWxywzv95VWwgYDsPeQKCOtgZqatnXYajnSHiu2eeQfXabjS7E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=mT2IUX3K; arc=none smtp.client-ip=91.218.175.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="mT2IUX3K" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=FfZDNuOqOdy6idQcHsHOcRGqdcW1dVvnf7/eAaFIrq0=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1787665378; v=1; x=1788270178; b=mT2IUX3KOhNWdf3sv5YkZjo/qRolzKHmu0ai+tkVUGE+c/NbpiiQ8jRRh37VW/0Nd72EuvCf 5cuOAR/cIUS0iu1MIFslJbG/atm/JLg77NmfkC8e2DK/YtpAkC50kyjx3IZFk+rwdeOw/1Bww1S agfNNfXvwP7Vg3ZJWtzZV9cc= X-Envelope-To: linux-kernel@vger.kernel.org Received: from [10.254.116.35] (101.126.56.83) by smtp.migadu.com with ESMTPS id f72d55ae91586379; Tue, 25 Aug 2026 13:42:58 +0000 X-Mizu-Trace-ID: f72d55ae91586379 X-Migadu-Flow: FLOW_OUT Message-ID: Date: Tue, 25 Aug 2026 21:42:43 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 15/17] mm/hugetlb: remove HUGE_BOOTMEM_CMA To: Muchun Song , Andrew Morton , Oscar Salvador , David Hildenbrand Cc: Mike Rapoport , Vlastimil Babka , Lorenzo Stoakes , Michal Hocko , David Laight , "Liam R . Howlett" , Suren Baghdasaryan , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Muchun Song References: <20260825084608.47437-1-songmuchun@bytedance.com> <20260825084608.47437-16-songmuchun@bytedance.com> From: Qi Zheng In-Reply-To: <20260825084608.47437-16-songmuchun@bytedance.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 8/25/26 4:46 PM, Muchun Song wrote: > Track early CMA hugetlb pages from the hstate instead of storing a > redundant bootmem flag. This removes the unused helper and keeps the > bootmem metadata minimal. > > Signed-off-by: Muchun Song > Acked-by: Mike Rapoport (Microsoft) > --- > v2: > - Collect Acked-by from Mike Rapoport > --- > include/linux/hugetlb.h | 1 - > mm/hugetlb.c | 14 ++++---------- > 2 files changed, 4 insertions(+), 11 deletions(-) It looks like this patch is unrelated to the rest of the patchset. Is it just a drive-by cleanup? Anyway, LGTM, so: Acked-by: Qi Zheng Thanks, Qi > > diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h > index 3559041a5a57..255a258f11d1 100644 > --- a/include/linux/hugetlb.h > +++ b/include/linux/hugetlb.h > @@ -676,7 +676,6 @@ struct hstate { > }; > > #define HUGE_BOOTMEM_ZONES_VALID BIT(0) > -#define HUGE_BOOTMEM_CMA BIT(1) > > int isolate_or_dissolve_huge_folio(struct folio *folio, struct list_head *list); > int replace_free_hugepage_folios(unsigned long start_pfn, unsigned long end_pfn); > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index 4bb5a25849b1..6822fb4159fb 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -3122,7 +3122,7 @@ static bool __init alloc_bootmem_huge_page(struct hstate *h, int nid) > */ > INIT_LIST_HEAD(&m->list); > m->hstate = h; > - m->flags = hugetlb_early_cma(h) ? HUGE_BOOTMEM_CMA : 0; > + m->flags = 0; > > /* CMA pages: zone-crossing is validated in hugetlb_cma_reserve(). */ > if (!hugetlb_early_cma(h) && > @@ -3198,11 +3198,6 @@ static void __init hugetlb_folio_init_vmemmap(struct folio *folio, > prep_compound_head(&folio->page, huge_page_order(h)); > } > > -static bool __init hugetlb_bootmem_page_earlycma(struct huge_bootmem_page *m) > -{ > - return m->flags & HUGE_BOOTMEM_CMA; > -} > - > /* > * memblock-allocated pageblocks might not have the migrate type set > * if marked with the 'noinit' flag. Set it to the default (MIGRATE_MOVABLE) > @@ -3293,9 +3288,6 @@ static void __init gather_bootmem_prealloc_node(unsigned long nid) > folio_set_hugetlb_vmemmap_optimized(folio); > section_set_order_range(folio_pfn(folio), folio_nr_pages(folio), 0); > > - if (hugetlb_bootmem_page_earlycma(m)) > - folio_set_hugetlb_cma(folio); > - > list_add(&folio->lru, &folio_list); > > /* > @@ -3306,7 +3298,9 @@ static void __init gather_bootmem_prealloc_node(unsigned long nid) > * For CMA pages, this is done in init_cma_pageblock > * (via hugetlb_bootmem_init_migratetype), so skip it here. > */ > - if (!folio_test_hugetlb_cma(folio)) > + if (hugetlb_early_cma(h)) > + folio_set_hugetlb_cma(folio); > + else > adjust_managed_page_count(page, pages_per_huge_page(h)); > cond_resched(); > }