From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7260F3515C7 for ; Wed, 5 Aug 2026 14:55:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785941757; cv=none; b=kNoZ1TOrGS6iF/gXhYjfFBaRpjOoKqLFdH1Z6INXnWbjd6a3VQnf3U4i95Bjclx/UtlMRcnuKru8Hj9sOxthQALSSGRHNOxVCMP23wUT74YewlhMouO5RLxbzkZwkLxyyaVeiquLOVPur0XjyvNkfM8gkelLMHOxnQwwcVNOTKM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785941757; c=relaxed/simple; bh=fz1kn4DBTaCQ/MtJPz8F5+0uX4gYh6Ocjh8tXNwAaWU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hsow13X/R6VwSgvM6oJuaV9L37JO5eHlf/z8yH1VJghEiMOCy4nj8we3HcFj3O5EdjuqFJtglD52cB3mVQzlTGzygY3jOjFpD9U2/ULlvPuoHyDHS84/bonGg294sUw9KwZsipaFPf7H/kj3LDCvHPBFHQOMhjBUT7lMPoavN3k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oqcKapRv; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oqcKapRv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C5E81F000E9; Wed, 5 Aug 2026 14:55:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785941756; bh=nASxGYceAPd+py7TH+InOS6PcP614iOzRyIcA7fA2qI=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=oqcKapRv3Of+kM5WF0RjhMOufytZiUaRvqbullaKqFxthXLGRSkfrMJvGzYhu0gaA y6kz+8jpywltwp+P/SGG3AYB2jD/HXUetI0xV10Ev8I4IxUAjQFGxt6Z6MEqmMjK4C BUb458NF/51vUQb9BbQRfG3T8091l7fqVFJdBB/qf9t9Tp0RcPVUvi6VLfw0VHX2Nd 5IR4ObUhx/CLDTKd7IBjpBJ96dNcA4nLFSCJOmIIv73q7JfUmVr8KfQgRjUe5PJYRv /H3wTYBmeDTIWhsPKGhTzR/b+x5GtKlG5/Mt07Rov7xEIF+rUXqLXkNrUTX45GkZLl G8dpE2gUvkICw== Date: Wed, 5 Aug 2026 17:55:48 +0300 From: Mike Rapoport To: Muchun Song Cc: Andrew Morton , David Hildenbrand , linux-mm@kvack.org, Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , linux-kernel@vger.kernel.org, muchun.song@linux.dev Subject: Re: [PATCH v2] mm/sparse: keep mem_section_usage_size() internal Message-ID: References: <20260805022536.1206575-1-songmuchun@bytedance.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260805022536.1206575-1-songmuchun@bytedance.com> On Wed, Aug 05, 2026 at 10:25:36AM +0800, Muchun Song wrote: > mem_section_usage_size() is only needed by sparsemem implementation code > after commit ae751d567baa ("mm/bootmem_info: stop marking mem_section_usage > as MIX_SECTION_INFO"), so keeping the declaration in mmzone.h now exposes > the helper to all mmzone.h users for no reason. > > Move the helper to sparse.h so sparse.c and sparse-vmemmap.c can share it > through the internal header. While doing so, calculate the allocation size > with struct_size_t(), which ties the expression to the pageblock_flags > trailing array instead of open-coding the struct header plus bitmap size. > > Signed-off-by: Muchun Song Acked-by: Mike Rapoport (Microsoft) > --- > v2: > - Mention that ae751d567baa removed the last external user (David) > - Use struct_size_t() for the mem_section_usage size calculation (David) > --- > include/linux/mmzone.h | 1 - > mm/sparse.c | 10 ---------- > mm/sparse.h | 6 ++++++ > 3 files changed, 6 insertions(+), 11 deletions(-) -- Sincerely yours, Mike.