From: Thomas Gleixner <tglx@linutronix.de>
To: Ye Bin <yebin@huaweicloud.com>,
dennis@kernel.org, tj@kernel.org, cl@linux.com,
linux-mm@kvack.org, yury.norov@gmail.com,
andriy.shevchenko@linux.intel.com, linux@rasmusvillemoes.dk
Cc: linux-kernel@vger.kernel.org, dchinner@redhat.com,
yebin10@huawei.com, yebin@huaweicloud.com
Subject: Re: [PATCH v2 1/2] cpu/hotplug: introduce 'num_dying_cpus' to get dying CPUs count
Date: Mon, 10 Apr 2023 22:12:02 +0200 [thread overview]
Message-ID: <87bkjv1oq5.ffs@tglx> (raw)
In-Reply-To: <20230406015629.1804722-2-yebin@huaweicloud.com>
On Thu, Apr 06 2023 at 09:56, Ye Bin wrote:
> From: Ye Bin <yebin10@huawei.com>
>
> Introduce '__num_dying_cpus' variable to cache the number of dying CPUs
> in the core and just return the cached variable.
Why?
That atomic counter is racy too if read and acted upon w/o having CPUs
read locked.
All it does is making the race window smaller vs. the cpumask_weight()
based implementation. It's still racy and incorrect.
So no, this is not going to happen.
Thanks,
tglx
next prev parent reply other threads:[~2023-04-10 20:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-06 1:56 [PATCH v2 0/2] fix dying cpu compare race Ye Bin
2023-04-06 1:56 ` [PATCH v2 1/2] cpu/hotplug: introduce 'num_dying_cpus' to get dying CPUs count Ye Bin
2023-04-10 17:42 ` Yury Norov
2023-04-10 20:12 ` Thomas Gleixner [this message]
2023-04-06 1:56 ` [PATCH v2 2/2] lib/percpu_counter: fix dying cpu compare race Ye Bin
2023-04-08 7:13 ` Dennis Zhou
2023-04-10 20:53 ` Thomas Gleixner
2023-04-11 6:56 ` Thomas Gleixner
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=87bkjv1oq5.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=tj@kernel.org \
--cc=yebin10@huawei.com \
--cc=yebin@huaweicloud.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.