Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756816AbbHZRlT (ORCPT ); Wed, 26 Aug 2015 13:41:19 -0400 Received: from g4t3426.houston.hp.com ([15.201.208.54]:32900 "EHLO g4t3426.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752207AbbHZRlS (ORCPT ); Wed, 26 Aug 2015 13:41:18 -0400 Message-ID: <1440610876.23728.101.camel@j-VirtualBox> Subject: Re: [PATCH 2/3] timer: Check thread timers only when there are active thread timers From: Jason Low To: George Spelvin Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, jason.low2@hp.com Date: Wed, 26 Aug 2015 10:41:16 -0700 In-Reply-To: <20150826170439.4724.qmail@ns.horizon.com> References: <20150826170439.4724.qmail@ns.horizon.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1133 Lines: 30 On Wed, 2015-08-26 at 13:04 -0400, George Spelvin wrote: > - check_thread_timers(tsk, &firing); > + if (!task_cputime_zero(&tsk->cputime_expires)) > + check_thread_timers(tsk, &firing); > > Sincere question; I'm not certain myself: would it make more sense to put > this shortcut into check_thread_timers()? > > It seems more like an optimization of that function than something the > caller needs to know about. Yes, I also thought it might be better if we add something like: if (task_cputime_zero(&tsk->cputime_expires) return; in check_thread_timers(). The reason I made it this way though is because in the next few lines, we do a similar check before calling check_process_timers(), and I wanted to keep things consistent. However, perhaps we can consider also moving that tsk->signal->cputimer.running check into check_process_timers() too. Thanks for the suggestions. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/