Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753700AbcCYO4T (ORCPT ); Fri, 25 Mar 2016 10:56:19 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:34599 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753615AbcCYO4R (ORCPT ); Fri, 25 Mar 2016 10:56:17 -0400 Date: Fri, 25 Mar 2016 15:56:13 +0100 From: Frederic Weisbecker To: Ingo Molnar Cc: LKML , Peter Zijlstra , Linus Torvalds , Thomas Gleixner , Andrew Morton Subject: Re: [PATCH 2/3] nohz: Convert tick dependency mask to atomic_t Message-ID: <20160325145612.GB16488@lerouge> References: <1458830281-4255-1-git-send-email-fweisbec@gmail.com> <1458830281-4255-3-git-send-email-fweisbec@gmail.com> <20160325085202.GB15235@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160325085202.GB15235@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1115 Lines: 27 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?