From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752051AbbEAQzE (ORCPT ); Fri, 1 May 2015 12:55:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48929 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750994AbbEAQzC (ORCPT ); Fri, 1 May 2015 12:55:02 -0400 Message-ID: <5543AFDC.6010204@redhat.com> Date: Fri, 01 May 2015 12:54:52 -0400 From: Rik van Riel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ingo Molnar CC: Andy Lutomirski , "linux-kernel@vger.kernel.org" , X86 ML , williams@redhat.com, Andrew Lutomirski , fweisbec@redhat.com, Peter Zijlstra , Heiko Carstens , Thomas Gleixner , Ingo Molnar , Paolo Bonzini Subject: Re: [PATCH 3/3] context_tracking,x86: remove extraneous irq disable & enable from context tracking on syscall entry References: <1430429035-25563-1-git-send-email-riel@redhat.com> <1430429035-25563-4-git-send-email-riel@redhat.com> <20150501064044.GA18957@gmail.com> <554399D1.6010405@redhat.com> <20150501155912.GA451@gmail.com> <20150501162109.GA1091@gmail.com> <20150501163709.GC1327@gmail.com> <5543AC7E.5060602@redhat.com> <20150501164526.GB1548@gmail.com> In-Reply-To: <20150501164526.GB1548@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/01/2015 12:45 PM, Ingo Molnar wrote: > > * Rik van Riel wrote: > >> On 05/01/2015 12:37 PM, Ingo Molnar wrote: >> >>> Also note that this bit in context_tracking_enter(): >>> >>> if (state == CONTEXT_USER) { >>> trace_user_enter(0); >>> vtime_user_enter(current); >>> } >>> >>> >>> is related to precise time measurement of user/kernel execution >>> times, it's not needed by the scheduler at all, it's just exported >>> to tooling. It's not fundamental to the scheduler. >> >> Any objections to the idea from the other thread to simply keep the >> time accumulating in buffers in local_clock() units, and only update >> the task vtime once a second or so? > > So I really think per syscall overhead is the wrong thing to do for > anything that a common distro enables. > > I see very little use for such precise, high-freq measurements on > normal systems - and abnormal systems could enable it dynamically just > like they can enable syscall auditing. > > I.e. I don't mind the occasional crazy piece of code, as long as it > does not hurt the innocent. Then how should/could we keep a rough idea of user / system / guest time when running without a periodic timer tick? These statistics are useful, and gathering them in a low impact way (local_clock read + variable read + subtraction + addition + store) may be acceptable overhead. This is a few function calls, one tsc read, a possible cache line miss, and an unlikely branch. -- All rights reversed