From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751748AbbJTAlW (ORCPT ); Mon, 19 Oct 2015 20:41:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:44555 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751037AbbJTAlV (ORCPT ); Mon, 19 Oct 2015 20:41:21 -0400 Date: Mon, 19 Oct 2015 17:41:08 -0700 From: Davidlohr Bueso To: Frederic Weisbecker Cc: Thomas Gleixner , LKML , George Spelvin , Peter Zijlstra , Oleg Nesterov , "Paul E . McKenney" , Jason Low , Ingo Molnar Subject: Re: [PATCH] posix-cpu-timers: Merge running and checking_timer state in one field Message-ID: <20151020004108.GB27292@linux-uzut.site> References: <1445300334-25977-1-git-send-email-fweisbec@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <1445300334-25977-1-git-send-email-fweisbec@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Oct 2015, Frederic Weisbecker wrote: >- * @checking_timer: true when a thread in the group is in the >- * process of checking for thread group timers. >- * >+ * @state: flags describing the current state of the cputimer. >+ * CPUTIMER_STATE_RUNNING bit means the timers is elapsing. s/timers/timer >+ * CPUTIMER_STATE_CHECKING bit means that the cputimer has >+ * expired and a thread in the group is checking the >+ * callback list. These comments might be better served when defining CPUTIMER_STATE_* [...] >@@ -606,7 +606,7 @@ bool posix_cpu_timers_can_stop_tick(struct task_struct *tsk) > return false; > > /* Check if cputimer is running. This is accessed without locking. */ >- if (READ_ONCE(tsk->signal->cputimer.running)) >+ if (READ_ONCE(tsk->signal->cputimer.state)) > return false; Could we have cases, such as the above, where .state is set to CPUTIMER_STATE_CHECKING and therefore the check is not equivalent? Thanks, Davidlohr