Re: [PATCH v1 1/2] mm/highmem: reimplement totalhigh_pages() by walking zones

Oscar Salvador
2024-06-10T03:23:38Z

On Fri, Jun 07, 2024 at 10:37:10AM +0200, David Hildenbrand wrote:
> Can we get rid of the highmem ifdef in adjust_managed_page_count()?
> Likely yes: we don't have that many totalhigh_pages() users, and they
> all don't seem to be very performance critical.
>
> So let's implement totalhigh_pages() like nr_free_highpages(),
> collecting information from all zones. This is now similar to what we do
> in si_meminfo_node() to collect the per-node highmem page count.
>
> In the common case (single node, 3-4 zones), we really shouldn't care.
> We could optimize a bit further (only walk ZONE_HIGHMEM and ZONE_MOVABLE
> if required), but there doesn't seem a real need for that.
>
> Signed-off-by: David Hildenbrand <david@redhat.com>

Reviewed-by: Oscar Salvador <osalvador@suse.de>

--
Oscar Salvador
SUSE Labs