* [PATCH 11/27] block: Protect against concurrent isolated cpuset change
[not found] <20250620152308.27492-1-frederic@kernel.org>
@ 2025-06-20 15:22 ` Frederic Weisbecker
2025-06-20 15:59 ` Bart Van Assche
2025-06-23 5:46 ` Christoph Hellwig
0 siblings, 2 replies; 5+ messages in thread
From: Frederic Weisbecker @ 2025-06-20 15:22 UTC (permalink / raw)
To: LKML
Cc: Frederic Weisbecker, Jens Axboe, Marco Crivellari, Michal Hocko,
Peter Zijlstra, Tejun Heo, Thomas Gleixner, Vlastimil Babka,
Waiman Long, linux-block
The block subsystem prevents running the workqueue to isolated CPUs,
including those defined by cpuset isolated partitions. Since
HK_TYPE_DOMAIN will soon contain both and be subject to runtime
modifications, synchronize against housekeeping using the relevant lock.
For full support of cpuset changes, the block subsystem may need to
propagate changes to isolated cpumask through the workqueue in the
future.
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
block/blk-mq.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 4806b867e37d..ece3369825fe 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -4237,12 +4237,16 @@ static void blk_mq_map_swqueue(struct request_queue *q)
/*
* Rule out isolated CPUs from hctx->cpumask to avoid
- * running block kworker on isolated CPUs
+ * running block kworker on isolated CPUs.
+ * FIXME: cpuset should propagate further changes to isolated CPUs
+ * here.
*/
+ housekeeping_lock();
for_each_cpu(cpu, hctx->cpumask) {
if (cpu_is_isolated(cpu))
cpumask_clear_cpu(cpu, hctx->cpumask);
}
+ housekeeping_unlock();
/*
* Initialize batch roundrobin counts
--
2.48.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 11/27] block: Protect against concurrent isolated cpuset change
2025-06-20 15:22 ` [PATCH 11/27] block: Protect against concurrent isolated cpuset change Frederic Weisbecker
@ 2025-06-20 15:59 ` Bart Van Assche
2025-06-26 15:03 ` Frederic Weisbecker
2025-06-23 5:46 ` Christoph Hellwig
1 sibling, 1 reply; 5+ messages in thread
From: Bart Van Assche @ 2025-06-20 15:59 UTC (permalink / raw)
To: Frederic Weisbecker, LKML
Cc: Jens Axboe, Marco Crivellari, Michal Hocko, Peter Zijlstra,
Tejun Heo, Thomas Gleixner, Vlastimil Babka, Waiman Long,
linux-block
On 6/20/25 8:22 AM, Frederic Weisbecker wrote:
> The block subsystem prevents running the workqueue to isolated CPUs,
> including those defined by cpuset isolated partitions. Since
> HK_TYPE_DOMAIN will soon contain both and be subject to runtime
> modifications, synchronize against housekeeping using the relevant lock.
>
> For full support of cpuset changes, the block subsystem may need to
> propagate changes to isolated cpumask through the workqueue in the
> future.
>
> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
> ---
> block/blk-mq.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 4806b867e37d..ece3369825fe 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -4237,12 +4237,16 @@ static void blk_mq_map_swqueue(struct request_queue *q)
>
> /*
> * Rule out isolated CPUs from hctx->cpumask to avoid
> - * running block kworker on isolated CPUs
> + * running block kworker on isolated CPUs.
> + * FIXME: cpuset should propagate further changes to isolated CPUs
> + * here.
> */
> + housekeeping_lock();
> for_each_cpu(cpu, hctx->cpumask) {
> if (cpu_is_isolated(cpu))
> cpumask_clear_cpu(cpu, hctx->cpumask);
> }
> + housekeeping_unlock();
>
> /*
> * Initialize batch roundrobin counts
Isn't it expected that function names have the subsystem name as a
prefix? The function name "housekeeping_lock" is not a good name because
that name does not make it clear what subsystem that function affects.
Additionally, "housekeeping" is very vague. Please choose a better name.
Thanks,
Bart.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 11/27] block: Protect against concurrent isolated cpuset change
2025-06-20 15:22 ` [PATCH 11/27] block: Protect against concurrent isolated cpuset change Frederic Weisbecker
2025-06-20 15:59 ` Bart Van Assche
@ 2025-06-23 5:46 ` Christoph Hellwig
2025-06-26 15:33 ` Frederic Weisbecker
1 sibling, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2025-06-23 5:46 UTC (permalink / raw)
To: Frederic Weisbecker
Cc: LKML, Jens Axboe, Marco Crivellari, Michal Hocko, Peter Zijlstra,
Tejun Heo, Thomas Gleixner, Vlastimil Babka, Waiman Long,
linux-block
On Fri, Jun 20, 2025 at 05:22:52PM +0200, Frederic Weisbecker wrote:
> + * running block kworker on isolated CPUs.
> + * FIXME: cpuset should propagate further changes to isolated CPUs
> + * here.
I have no idea what this comments means. Can you explain it, or help
fixing it? Or at least send the entire series to all affected
subsystems as there's no way to review it without the context.
If nothing changes please at leat avoid the overly long line.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 11/27] block: Protect against concurrent isolated cpuset change
2025-06-20 15:59 ` Bart Van Assche
@ 2025-06-26 15:03 ` Frederic Weisbecker
0 siblings, 0 replies; 5+ messages in thread
From: Frederic Weisbecker @ 2025-06-26 15:03 UTC (permalink / raw)
To: Bart Van Assche
Cc: LKML, Jens Axboe, Marco Crivellari, Michal Hocko, Peter Zijlstra,
Tejun Heo, Thomas Gleixner, Vlastimil Babka, Waiman Long,
linux-block
Le Fri, Jun 20, 2025 at 08:59:58AM -0700, Bart Van Assche a écrit :
> On 6/20/25 8:22 AM, Frederic Weisbecker wrote:
> > The block subsystem prevents running the workqueue to isolated CPUs,
> > including those defined by cpuset isolated partitions. Since
> > HK_TYPE_DOMAIN will soon contain both and be subject to runtime
> > modifications, synchronize against housekeeping using the relevant lock.
> >
> > For full support of cpuset changes, the block subsystem may need to
> > propagate changes to isolated cpumask through the workqueue in the
> > future.
> >
> > Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
> > ---
> > block/blk-mq.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/block/blk-mq.c b/block/blk-mq.c
> > index 4806b867e37d..ece3369825fe 100644
> > --- a/block/blk-mq.c
> > +++ b/block/blk-mq.c
> > @@ -4237,12 +4237,16 @@ static void blk_mq_map_swqueue(struct request_queue *q)
> > /*
> > * Rule out isolated CPUs from hctx->cpumask to avoid
> > - * running block kworker on isolated CPUs
> > + * running block kworker on isolated CPUs.
> > + * FIXME: cpuset should propagate further changes to isolated CPUs
> > + * here.
> > */
> > + housekeeping_lock();
> > for_each_cpu(cpu, hctx->cpumask) {
> > if (cpu_is_isolated(cpu))
> > cpumask_clear_cpu(cpu, hctx->cpumask);
> > }
> > + housekeeping_unlock();
> > /*
> > * Initialize batch roundrobin counts
>
> Isn't it expected that function names have the subsystem name as a
> prefix? The function name "housekeeping_lock" is not a good name because
> that name does not make it clear what subsystem that function affects.
> Additionally, "housekeeping" is very vague. Please choose a better name.
Perhaps. "housekeeping_" doesn't match "isolation.c" but there is
already a whole set of APIs with the housekeeping prefix.
Anyway, this will likely disappear and be replaced by RCU instead.
Thanks.
--
Frederic Weisbecker
SUSE Labs
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 11/27] block: Protect against concurrent isolated cpuset change
2025-06-23 5:46 ` Christoph Hellwig
@ 2025-06-26 15:33 ` Frederic Weisbecker
0 siblings, 0 replies; 5+ messages in thread
From: Frederic Weisbecker @ 2025-06-26 15:33 UTC (permalink / raw)
To: Christoph Hellwig
Cc: LKML, Jens Axboe, Marco Crivellari, Michal Hocko, Peter Zijlstra,
Tejun Heo, Thomas Gleixner, Vlastimil Babka, Waiman Long,
linux-block
Le Sun, Jun 22, 2025 at 10:46:57PM -0700, Christoph Hellwig a écrit :
> On Fri, Jun 20, 2025 at 05:22:52PM +0200, Frederic Weisbecker wrote:
> > + * running block kworker on isolated CPUs.
> > + * FIXME: cpuset should propagate further changes to isolated CPUs
> > + * here.
>
> I have no idea what this comments means. Can you explain it, or help
> fixing it? Or at least send the entire series to all affected
> subsystems as there's no way to review it without the context.
>
> If nothing changes please at leat avoid the overly long line.
That's definetly confusing.
I'll try to clarify that on the next iteration, or even try to fix
it myself.
Thanks.
--
Frederic Weisbecker
SUSE Labs
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-06-26 15:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250620152308.27492-1-frederic@kernel.org>
2025-06-20 15:22 ` [PATCH 11/27] block: Protect against concurrent isolated cpuset change Frederic Weisbecker
2025-06-20 15:59 ` Bart Van Assche
2025-06-26 15:03 ` Frederic Weisbecker
2025-06-23 5:46 ` Christoph Hellwig
2025-06-26 15:33 ` Frederic Weisbecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).