lkml.org 
[lkml]   [2016]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 5/8] sched,x86: Enable Turbo Boost Max Technology
On Thu, Sep 08, 2016 at 11:09:28AM -0700, Tim Chen wrote:
> On Thu, Sep 08, 2016 at 09:59:55AM +0200, Peter Zijlstra wrote:
> > I think there's a race here, if two tasks were to write to the sysctl
> > they'd both change the value before getting stuck on the mutex in
> > enable_sched_itmt().
> >
> > One way around that is doing something like:
> >
> >
> > struct ctl_table t;
> > int val = sysctl_sched_itmt_enabled;
> >
> > t = *table;
> > t.data = &val;
> >
> > proc_dointvec_minmax(&t, ...);
> >
> > /* and update the sysctl_sched_itmt_enabled value inside the mutex */
> > enable_sched_itmi(val);
>
> Peter,
>
> Since enable_sched_itmt is only used by sched_itmt_update_handler,
> I've moved the mutex locking to sched_itmt_update_handler to eliminate
> the race condition in the code path you mentioned.

That is indeed simpler. Thanks!

\
 
 \ /
  Last update: 2016-09-17 09:58    [W:0.071 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site