mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Jiebin Sun <jiebin.sun@intel.com>,
	dennis@kernel.org, tj@kernel.org, cl@gentwo.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	bigeasy@linutronix.de, clrkwllms@kernel.org, rostedt@goodmis.org,
	linux-rt-devel@lists.linux.dev, tim.c.chen@linux.intel.com,
	tianyou.li@intel.com, wangyang.guo@intel.com
Subject: Re: [PATCH] lib/percpu_counter: allow concurrent sums with an rwlock
Date: Sun, 15 Nov 2026 19:44:04 -0800	[thread overview]
Message-ID: <20261115194404.a8d751a7c17904c756b16b61@linux-foundation.org> (raw)
In-Reply-To: <20261115191636.f18859e4dd5f58b9a33e7814@linux-foundation.org>

On Sun, 15 Nov 2026 19:16:36 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:

> > stress-ng dentry test average throughput change:
> > 
> >   +------------------------+------------+--------------------+
> >   | Case                   | Unit       | Average change (%) |
> >   +------------------------+------------+--------------------+
> >   | Dentry, 64 workers     | bogo ops/s |             +47.34 |
> >   +------------------------+------------+--------------------+
> > 
> > Dentry ran on ext4 with 64 workers pinned to physical CPUs:
> > 
> >   stress-ng --dentry 64 --dentries 4096 --timeout 20s
> 
> lol, this is a fun patch

It's *probably* OK, for sane workloads.

But if some workload is busily running percpu_counter_sum on 1000 CPUs,
how is a writer ever to get in there to spill ->counters into ->count? 

Modern rwlock_t does implement queuing, so the writer will get in
there eventually.  But nothing is simple any more - there are
complications with rwlocks on PREEMPT_RT and with interrupt-time reads
(do we even do that?).

So I think indefinite writer starvation is a risk here?

      reply	other threads:[~2026-11-16  3:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  1:56 Jiebin Sun
2026-11-16  3:16 ` Andrew Morton
2026-11-16  3:44   ` Andrew Morton [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=20261115194404.a8d751a7c17904c756b16b61@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=bigeasy@linutronix.de \
    --cc=cl@gentwo.org \
    --cc=clrkwllms@kernel.org \
    --cc=dennis@kernel.org \
    --cc=jiebin.sun@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=rostedt@goodmis.org \
    --cc=tianyou.li@intel.com \
    --cc=tim.c.chen@linux.intel.com \
    --cc=tj@kernel.org \
    --cc=wangyang.guo@intel.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®