Re: [PATCH v2 03/17] mm/mm_init: skip initializing shared vmemmap tail pages
Mike Rapoport <[email protected]> Mon, 3 Aug 2026 09:38:31 +0300
| Newsgroups | org.kvack.linux-mm,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Jul 31, 2026 at 10:13:43AM +0800, Muchun Song wrote: > > On Jul 30, 2026, at 22:32, Mike Rapoport <[email protected]> wrote: > >> > >> Since we also use __pfn_to_section in the patch 14 in this series for > >> !SPARSEMEM, we need to make corresponding adjustments—specifically, by using > >> pfn_to_section_order to determine whether the vmemmap of a given section is > >> optimizable. This new helper will be called from several places, so I'm afraid > >> its introduction is unavoidable. > > > > Do you mean that section_vmemmap_optimizable() will receive pfn as a > > parameter and use pfn_to_section_order() internally? > > I was originally planning to go with the this approach, but now I've come across > something that feels a bit unusual to me: a function whose name starts with section > takes a pfn as its argument instead of a mem_section. > > So I started thinking about an alternative. How about we keep section_vmemmap_optimizable() > as it is, but introduce a new helper like this: > > static inline bool order_vmemmap_optimizable(unsigned int order) > { > return order >= OPTIMIZABLE_FOLIO_MIN_ORDER; > } Maybe name it vmemmap_optimizable_order() so it'll belong to vmemmap namespace, order_ can be really a lot of things. I think it makes sense. Let's see how it fits in the end in the new version :) -- Sincerely yours, Mike.