Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751803AbbEAQX0 (ORCPT ); Fri, 1 May 2015 12:23:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58143 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751568AbbEAQXZ (ORCPT ); Fri, 1 May 2015 12:23:25 -0400 Message-ID: <5543A853.6090802@redhat.com> Date: Fri, 01 May 2015 12:22:43 -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: Andy Lutomirski , Ingo Molnar CC: "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> In-Reply-To: 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 Content-Length: 1971 Lines: 49 On 05/01/2015 12:03 PM, Andy Lutomirski wrote: > The last time I asked, the impression I got was that we needed two things: > > 1. We can't pluck things from the RCU list without knowing whether the > CPU is in an RCU read-side critical section, and we can't know that > unless we have regular grade periods or we know that the CPU is idle. > To make the CPU detectably idle, we need to set a bit somewhere. More than that. We also need a way for another CPU to identify the callbacks they could run for us, without confusing them with new callbacks queued after we transitioned back from USER to KERNEL context. > 2. To suppress the timing tick, we need to get some timing for, um, > the scheduler? I wasn't really sure about this one. > > Could we reduce the overhead by making the IN_USER vs IN_KERNEL > indication be a single bit and, worst case, an rdtsc and maybe a > subtraction? We could probably get away with banning full nohz on > non-invariant tsc systems. I suspect we can. There is no need to update the vtime every single time we enter vtime_user_enter and functions like it. We can keep a buffer, which: 1) keeps values in TSC cycles (or whatever unit local_clock does) 2) is only ever accessed by the current task, so it requires no locking 3) values can be actually folded into vtime periodically, when they exceed a certain threshold (1 second ?) That means the vtime_seqlock is something that we would only take once a second or so, and the calculations in account_user_time would only be done on a fairly infrequent basis. That has the potential to reduce overhead by a lot. If nobody has any objections to that kind of change, I would be happy to implement it. -- All rights reversed -- 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/