From: Thomas Gleixner <tglx@linutronix.de>
To: Dave Chinner <dchinner@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Valentin Schneider <vschneid@redhat.com>,
Dennis Zhou <dennis@kernel.org>, Tejun Heo <tj@kernel.org>,
Christoph Lameter <cl@linux.com>,
Yury Norov <yury.norov@gmail.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Ye Bin <yebin10@huawei.com>,
linux-mm@kvack.org
Subject: Re: [patch 1/3] lib/percpu_counter: Fix CPU hotplug handling
Date: Mon, 17 Apr 2023 10:09:09 +0200 [thread overview]
Message-ID: <877cub53ru.ffs@tglx> (raw)
In-Reply-To: <ZDyqYYq+HgxCKri4@rh>
On Mon, Apr 17 2023 at 12:09, Dave Chinner wrote:
> On Fri, Apr 14, 2023 at 06:30:43PM +0200, Thomas Gleixner wrote:
>> - percpu_counter_batch = max(32, nr*2);
>> +static int percpu_counter_cpu_starting(unsigned int cpu)
>> +{
>> + /* If invoked during hotplug @cpu is not yet marked online. */
>> + compute_batch_value(cpu_online(cpu) ? 0 : 1);
>> return 0;
>> }
>
> So this changes the batch size based on whether the CPU is starting
> or dying to try to get _compare() to fall into the slow path
> correctly?
Right. That's not new. The original code did the same.
> How is this supposed to work with counters that have caller supplied
> custom batch sizes? i.e. use percpu_counter_add_batch() and
> __percpu_counter_compare() with their own batch sizes directly?
> Do they now need to add their own cpu hotplug hooks to
> screw around with their batch sizes as well?
Now? Nothing has changed here. Just the point where the batch size
computation is called is different. The original code did it in the
dynamic online callback late on hotplug and in the dead (cleanup)
callback late on unplug.
The external batch sizes always have been independent of this.
Thanks,
tglx
next prev parent reply other threads:[~2023-04-17 8:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-14 16:30 [patch 0/3] lib/percpu_counter, cpu/hotplug: Cure the cpu_dying_mask woes Thomas Gleixner
2023-04-14 16:30 ` [patch 1/3] lib/percpu_counter: Fix CPU hotplug handling Thomas Gleixner
2023-04-15 5:20 ` Dennis Zhou
2023-04-17 2:09 ` Dave Chinner
2023-04-17 8:09 ` Thomas Gleixner [this message]
2023-04-14 16:30 ` [patch 2/3] cpu/hotplug: Remove export of cpu_active_mask and cpu_dying_mask Thomas Gleixner
2023-04-14 16:30 ` [patch 3/3] cpu/hotplug: Get rid of cpu_dying_mask Thomas Gleixner
2023-05-03 11:50 ` [patch 0/3] lib/percpu_counter, cpu/hotplug: Cure the cpu_dying_mask woes Valentin Schneider
2023-12-30 22:39 ` Dennis Zhou
2024-01-12 23:36 [PATCH 0/3 v2] " Dennis Zhou
2024-01-12 23:36 ` [PATCH 1/3] lib/percpu_counter: Fix CPU hotplug handling Dennis Zhou
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=877cub53ru.ffs@tglx \
--to=tglx@linutronix.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=cl@linux.com \
--cc=dchinner@redhat.com \
--cc=dennis@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@rasmusvillemoes.dk \
--cc=peterz@infradead.org \
--cc=tj@kernel.org \
--cc=vschneid@redhat.com \
--cc=yebin10@huawei.com \
--cc=yury.norov@gmail.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