From: Dennis Zhou <dennis@kernel.org>
To: Zi Yan <ziy@nvidia.com>
Cc: Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>,
Andrew Morton <akpm@linux-foundation.org>,
Christoph Lameter <cl@linux.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Sashiko <sashiko-bot@kernel.org>
Subject: Re: [PATCH] mm/percpu-km: fix bitmap overflow and accounting in pcpu_create_chunk()
Date: Mon, 20 Jul 2026 15:16:29 -0700 [thread overview]
Message-ID: <al6ePXAJ6iwQYvfx@palisades.local> (raw)
In-Reply-To: <DK3N4FET9ORM.327QYW7L79VOK@nvidia.com>
Hi Zi,
On Mon, Jul 20, 2026 at 03:20:31PM -0400, Zi Yan wrote:
> On Thu Jul 9, 2026 at 3:12 PM EDT, Zi Yan wrote:
> > In pcpu_create_chunk(), nr_pages is the total contiguous backing
> > allocation, i.e., nr_units * pcpu_unit_pages, but pcpu_chunk_populated()
> > uses it to set chunk->populated, whose size is pcpu_unit_pages, bitmap.
> > Since bit N in chunk->populated means page offset N inside every unit is
> > backed. When nr_units > 1, the function writes beyond chunk->populated. Fix
> > it by using chunk->nr_pages.
> >
> > It also fixes the global pcpu_nr_empty_pop_pages accounting, since
> > pcpu_balance_free() only iterates up to chunk->nr_pages.
> >
> > Commit a63d4ac4ab609 ("percpu: make percpu-km set chunk->populated bitmap
> > properly") introduced the bitmap overflow issue. Later,
> > commit b539b87fed37f ("percpu: implmeent pcpu_nr_empty_pop_pages and
> > chunk->nr_populated") added pcpu_nr_empty_pop_pages and caused the
> > accounting issue.
>
> A gentle ping on this patch. It would be great to get some feedback.
> Thanks.
>
Sorry, this is right and I missed it years ago.
Acked-by: Dennis Zhou <dennis@kernel.org>
Thanks,
Dennis
prev parent reply other threads:[~2026-07-20 22:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 19:12 Zi Yan
2026-07-20 19:20 ` Zi Yan
2026-07-20 22:16 ` Dennis Zhou [this message]
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=al6ePXAJ6iwQYvfx@palisades.local \
--to=dennis@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=cl@gentwo.org \
--cc=cl@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sashiko-bot@kernel.org \
--cc=tj@kernel.org \
--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
all inboxes | Powered by JetHome®