lkml.org 
[lkml]   [2021]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 2/3] cpumask: Introduce DYING mask
On Sun, Mar 21, 2021 at 07:30:37PM +0000, Qais Yousef wrote:
> On 03/10/21 15:53, Peter Zijlstra wrote:
> > --- a/kernel/cpu.c
> > +++ b/kernel/cpu.c
> > @@ -160,6 +160,9 @@ static int cpuhp_invoke_callback(unsigne
> > int (*cb)(unsigned int cpu);
> > int ret, cnt;
> >
> > + if (bringup != !cpu_dying(cpu))
>
> nit: this condition is hard to read
>
> > + set_cpu_dying(cpu, !bringup);

How's:

if (cpu_dying(cpu) != !bringup)
set_cpu_dying(cpu, !bringup);

> since cpu_dying() will do cpumask_test_cpu(), are we saving much if we
> unconditionally call set_cpu_dying(cpu, !bringup) which performs
> cpumask_{set, clear}_cpu()?

This is hotplug, it's all slow, endlessly rewriting that bit shouldn't
be a problem I suppose.

\
 
 \ /
  Last update: 2021-04-12 12:57    [W:0.179 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site