Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753964AbbHZRbF (ORCPT ); Wed, 26 Aug 2015 13:31:05 -0400 Received: from g9t5008.houston.hp.com ([15.240.92.66]:36170 "EHLO g9t5008.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752293AbbHZRbD (ORCPT ); Wed, 26 Aug 2015 13:31:03 -0400 Message-ID: <1440610261.23728.91.camel@j-VirtualBox> Subject: Re: [PATCH 1/3] timer: Optimize fastpath_timer_check() 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:31:01 -0700 In-Reply-To: <20150826165757.3001.qmail@ns.horizon.com> References: <20150826165757.3001.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: 1114 Lines: 28 On Wed, 2015-08-26 at 12:57 -0400, George Spelvin wrote: > > if (!task_cputime_zero(&tsk->cputime_expires)) { > >+ struct task_cputime task_sample; > >+ cputime_t utime, stime; > >+ > >+ task_cputime(tsk, &utime, &stime); > >+ task_sample.utime = utime; > >+ task_sample.stime = stime; > >+ task_sample.sum_exec_runtime = tsk->se.sum_exec_runtime; > > Er, task_sample.[us]time are already the correct types. > Whay are the local variables necessary? How about: > > if (!task_cputime_zero(&tsk->cputime_expires)) { > + struct task_cputime task_sample; > + > + task_cputime(tsk, &task_simple.utime, &task_simple.stime); > + task_sample.sum_exec_runtime = tsk->se.sum_exec_runtime; Yes, good point. Now that we're moving the task_cputime() call to after the task_sample structure is declared, the utime and stime local variables are not required anymore. -- 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/