lkml.org 
[lkml]   [2019]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v2 12/17] sched: A quick and dirty cgroup tagging interface
On Fri, Apr 26, 2019 at 04:13:07PM +0200 Peter Zijlstra wrote:
> On Thu, Apr 25, 2019 at 10:26:53AM -0400, Phil Auld wrote:
> > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > index e8e5f26db052..b312ea1e28a4 100644
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -7541,6 +7541,9 @@ static int cpu_core_tag_write_u64(struct cgroup_subsys_state *css, struct cftype
> > if (val > 1)
> > return -ERANGE;
> >
> > + if (num_online_cpus() <= 1)
> > + return -EINVAL;
>
> We actually know if there SMT on the system or not, which is much better
> indication still:
>
> if (!static_branch_likely(&sched_smt_present))
> return -EINVAL;
>
> > if (tg->tagged == !!val)
> > return 0;
> >
> >
> >
> >
> > --

Yeah, I thought there was probably a better check.

Thanks!

--

\
 
 \ /
  Last update: 2019-04-26 16:20    [W:0.074 / U:0.052 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site