lkml.org 
[lkml]   [2016]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] nohz: Convert tick dependency mask to atomic_t
On Fri, Mar 25, 2016 at 09:52:02AM +0100, Ingo Molnar wrote:
> > diff --git a/kernel/time/tick-sched.h b/kernel/time/tick-sched.h
> > index eb4e325..bf38226 100644
> > --- a/kernel/time/tick-sched.h
> > +++ b/kernel/time/tick-sched.h
> > @@ -60,7 +60,7 @@ struct tick_sched {
> > u64 next_timer;
> > ktime_t idle_expires;
> > int do_timer_last;
> > - unsigned long tick_dep_mask;
> > + atomic_t tick_dep_mask;
> > };
> >
> > extern struct tick_sched *tick_get_tick_sched(int cpu);
>
> Yeah, so I really like this interface, because it makes it really, really obvious
> that only atomic_t-compatible operations can be used on the value. It's a common
> bug to have a long, operated on atomically via bitops - and then occasionally
> operated on in a non-atomic fashion, or used without taking ordering into account.
> Such bugs are quite hard to find.
>
> This change also shrinks the mask from long to int, which is an another bonus, and
> which addresses the other objection Linus had.

Thanks, I much prefer it that way too!

Should I do a pull request or can I let you apply these?

\
 
 \ /
  Last update: 2016-03-25 16:21    [W:0.073 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site