From: Vlastimil Babka <vbabka@suse.cz>
To: Joshua Hahn <joshua.hahnjy@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Chris Mason <clm@fb.com>, Kiryl Shutsemau <kirill@shutemov.name>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
Brendan Jackman <jackmanb@google.com>,
David Hildenbrand <david@redhat.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
Michal Hocko <mhocko@suse.com>, Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>, Zi Yan <ziy@nvidia.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
kernel-team@meta.com
Subject: Re: [PATCH v5 0/3] mm/page_alloc: Batch callers of free_pcppages_bulk
Date: Tue, 14 Oct 2025 19:54:28 +0200 [thread overview]
Message-ID: <6d62386c-242a-4735-add3-fee9c6e0ba96@suse.cz> (raw)
In-Reply-To: <20251014145011.3427205-1-joshua.hahnjy@gmail.com>
On 10/14/25 16:50, Joshua Hahn wrote:
> Changelog
> =========
> v4 --> v5:
> - Wordsmithing
> - Patches 1/3 and 2/3 were left untouched.
> - Patch 3/3 no longer checks for the to_free == 0 case. It also now checks
> for pcp->count > 0 as the condition inside the while loop, and the early
> break checks for the opposite condition. Note that both to_free and
> pcp->count can become negative due to high-order pages that are freed, so
> we must check for (to_free <= 0 || pcp->count <= 0), instead of just
> checking for == 0.
I don't see how that's possible?
- to_free is decremented by to_free_batched = min(to_free, batch); so it
can't go negative.
- pcp->count indeed decrements by nr_pages but it should be exactly zero
once pcp becomes empty. It's true that internally in free_pcppages_bulk()
the count parameter (where we pass to_free_batched) can go negative, but
that doesn't affect to_free_batched in the caller free_frozen_page_commit().
So testing for <= is unnecessary and only looks weird?
next prev parent reply other threads:[~2025-10-14 17:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-14 14:50 Joshua Hahn
2025-10-14 14:50 ` [PATCH v5 1/3] mm/page_alloc/vmstat: Simplify refresh_cpu_vm_stats change detection Joshua Hahn
2025-10-14 14:50 ` [PATCH v5 2/3] mm/page_alloc: Batch page freeing in decay_pcp_high Joshua Hahn
2025-10-14 14:50 ` [PATCH v5 3/3] mm/page_alloc: Batch page freeing in free_frozen_page_commit Joshua Hahn
2025-10-14 19:28 ` Joshua Hahn
2025-10-14 20:45 ` Vlastimil Babka
2025-10-14 17:54 ` Vlastimil Babka [this message]
2025-10-14 19:17 ` [PATCH v5 0/3] mm/page_alloc: Batch callers of free_pcppages_bulk Joshua Hahn
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=6d62386c-242a-4735-add3-fee9c6e0ba96@suse.cz \
--to=vbabka@suse.cz \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=clm@fb.com \
--cc=david@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=jackmanb@google.com \
--cc=joshua.hahnjy@gmail.com \
--cc=kernel-team@meta.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=ziy@nvidia.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox