Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932715AbbDOROc (ORCPT ); Wed, 15 Apr 2015 13:14:32 -0400 Received: from g9t5008.houston.hp.com ([15.240.92.66]:47797 "EHLO g9t5008.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756271AbbDOROX (ORCPT ); Wed, 15 Apr 2015 13:14:23 -0400 Message-ID: <1429118052.7039.99.camel@j-VirtualBox> Subject: Re: [PATCH 2/3] sched, timer: Use atomics for thread_group_cputimer to improve scalability From: Jason Low To: Ingo Molnar Cc: Linus Torvalds , Peter Zijlstra , Thomas Gleixner , linux-kernel@vger.kernel.org, "Paul E. McKenney" , Andrew Morton , Oleg Nesterov , Mike Galbraith , Frederic Weisbecker , Mel Gorman , Steven Rostedt , Preeti U Murthy , hideaki.kimura@hp.com, Aswin Chandramouleeswaran , Scott J Norton , jason.low2@hp.com Date: Wed, 15 Apr 2015 10:14:12 -0700 In-Reply-To: <20150415073532.GA14091@gmail.com> References: <1429052986-9420-1-git-send-email-jason.low2@hp.com> <1429052986-9420-3-git-send-email-jason.low2@hp.com> <20150415073340.GB13449@gmail.com> <20150415073532.GA14091@gmail.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: 2044 Lines: 68 On Wed, 2015-04-15 at 09:35 +0200, Ingo Molnar wrote: > * Ingo Molnar wrote: > > > So after your changes we still have a separate: > > > > struct task_cputime { > > cputime_t utime; > > cputime_t stime; > > unsigned long long sum_exec_runtime; > > }; > > > > Which then weirdly overlaps with a different structure on a different > > abstraction level: > > > > struct thread_group_cputimer { > > atomic64_t utime; > > atomic64_t stime; > > atomic64_t sum_exec_runtime; > > int running; > > }; > > > > So I think it would be more obvious what's going on if we introduced > > an atomic task_cputime structure: > > > > struct task_cputime_atomic { > > atomic64_t utime; > > atomic64_t stime; > > atomic64_t sum_exec_runtime; > > }; > > > > and put that into 'struct thread_group_cputimer': > > > > struct thread_group_cputimer { > > struct task_cputime_atomic cputime_atomic; > > int running; > > }; > > > > Maybe even factor out the main update and reading methods into > > expressively named helper inlines? > > Btw., feel free to preserve your original series and turn this > factoring out into 1-2 extra patches on top of it: so that we preserve > your testing on the original series, and see the structure (and cost) > of the factoring out of the new data type. Okay, I'll add a task_cputime_atomic. That will convert things like: void sample_group_cputimer(struct task_cputime *times, struct thread_group_cputimer *cputimer) to void sample_atomic_cputimes(struct task_cputime *times struct task_cputime_atomic *atomic_cputimes) which makes more sense, and the new "task_cputime_atomic" can potentially be used in other places. Thanks, Jason -- 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/