Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753788Ab2KZAQ7 (ORCPT ); Sun, 25 Nov 2012 19:16:59 -0500 Received: from mail-vc0-f174.google.com ([209.85.220.174]:58490 "EHLO mail-vc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753634Ab2KZAQ6 (ORCPT ); Sun, 25 Nov 2012 19:16:58 -0500 MIME-Version: 1.0 In-Reply-To: <20121125190909.GA1866@windriver.com> References: <1353680484-7302-1-git-send-email-fweisbec@gmail.com> <1353680484-7302-4-git-send-email-fweisbec@gmail.com> <20121125190909.GA1866@windriver.com> Date: Mon, 26 Nov 2012 01:16:57 +0100 Message-ID: Subject: Re: [PATCH 3/3] cputime: Consolidate cputime adjustment code From: Frederic Weisbecker To: Paul Gortmaker Cc: LKML , Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Steven Rostedt Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1416 Lines: 38 2012/11/25 Paul Gortmaker : >> --- a/include/linux/sched.h >> +++ b/include/linux/sched.h >> @@ -433,6 +433,11 @@ struct cpu_itimer { >> u32 incr_error; >> }; >> >> +struct cputime { >> + cputime_t utime; >> + cputime_t stime; >> +}; >> + > > Hi Frederic, > > This new struct cputime is a 2/3 subset of the three variable struct > task_cputime we see right below. Maybe this is a stupid question, but I > was wondering why you didn't re-use task_cputime, and ignore the > sum_exec_runtime field -- vs. introducing this very similar struct? Not a stupid question, I need to add a comment on that. I avoided to reuse struct task_cputime because sum_exec_runtime is unused and 8 wasted bytes in the middle of task_struct is very undesirable. As in signal struct. > > Or maybe there is another way to consolidate the structs? With the > two being so similar, I wonder if it will be confusing when to use which > one of the two. I can add a comment that tells when to use which. Other than that I'm short on ideas to consolidate both without creating a mess with long dereferencing expressions like tsk->cputime.utime and so. -- 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/