Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754863AbbKWPWQ (ORCPT ); Mon, 23 Nov 2015 10:22:16 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:35413 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753980AbbKWPWO (ORCPT ); Mon, 23 Nov 2015 10:22:14 -0500 Date: Mon, 23 Nov 2015 16:22:11 +0100 From: Frederic Weisbecker To: Peter Zijlstra Cc: LKML , Chris Metcalf , Thomas Gleixner , Hiroshi Shimamoto , Luiz Capitulino , Christoph Lameter , "Paul E . McKenney" , Ingo Molnar , stable@vger.kernel.org, Rik van Riel Subject: Re: [PATCH 6/7] cputime: Introduce vtime accounting check for readers Message-ID: <20151123152210.GE3587@lerouge> References: <1447948054-28668-1-git-send-email-fweisbec@gmail.com> <1447948054-28668-7-git-send-email-fweisbec@gmail.com> <20151119202828.GT3816@twins.programming.kicks-ass.net> <20151123141918.GB3587@lerouge> <20151123143516.GJ17308@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151123143516.GJ17308@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2064 Lines: 43 On Mon, Nov 23, 2015 at 03:35:16PM +0100, Peter Zijlstra wrote: > On Mon, Nov 23, 2015 at 03:19:19PM +0100, Frederic Weisbecker wrote: > > On Thu, Nov 19, 2015 at 09:28:28PM +0100, Peter Zijlstra wrote: > > > On Thu, Nov 19, 2015 at 04:47:33PM +0100, Frederic Weisbecker wrote: > > > > +++ b/include/linux/vtime.h > > > > @@ -17,9 +17,20 @@ static inline bool vtime_accounting_cpu_enabled(void) { return true; } > > > > #endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */ > > > > > > > > #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN > > > > +/* > > > > + * Checks if vtime is enabled on some CPU. Cputime readers want to be careful > > > > + * in that case and compute the tickless cputime. > > > > + * For now vtime state is tied to context tracking. We might want to decouple > > > > + * those later if necessary. > > > > + */ > > > > +static inline bool vtime_accounting_enabled(void) > > > > +{ > > > > + return context_tracking_is_enabled(); > > > > +} > > > > > > Should this not also include a definition of this function for > > > CONFIG_VIRT_CPU_ACCOUNTING_NATIVE and CONFIG_VIRT_CPU_ACCOUNTING ? > > > > I could but I haven't found any user of it yet for others than > > CONFIG_VIRT_CPU_ACCOUNTING_GEN. The NATIVE version, when enabled, runs on > > all CPUs anyway. > > Aah, I see, task_gtime() etc.. have a different definition for !GEN. > tricky. Right, this whole CONFIG_VIRT_CPU_ACCOUNTING stuff is a bit messy. I tried to consolidate as much code I could between NATIVE and GEN but the result is hard to parse. I'll see if I can clean a few things up there. To begin with, VIRT_CPU_ACCOUNTING is a horrible misnomer, as vtime. VIRT suggests we are dealing with virtualization while it's absolutely not the case. Perhaps something like BOUNDARY_CPU_ACCOUNTING would parse better. Or TICKLESS_CPU_ACCOUNTING. -- 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/