From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754887AbbEAQAY (ORCPT ); Fri, 1 May 2015 12:00:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51469 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754872AbbEAQAT (ORCPT ); Fri, 1 May 2015 12:00:19 -0400 Message-ID: <5543A302.1020205@redhat.com> Date: Fri, 01 May 2015 12:00:02 -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 CC: =?UTF-8?B?RnLpppjpp7tpYyBXZWlzYmVja2Vy?= , X86 , "linux-kernel@vger.kernel.org" , Thomas Gleixner , Denys Vlasenko Subject: Re: context tracking vs. syscall_trace_leave & do_notify_resume loop References: <5542D730.2050903@redhat.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 On 05/01/2015 11:55 AM, Andy Lutomirski wrote: > On Thu, Apr 30, 2015 at 6:30 PM, Rik van Riel wrote: >> I suspect it would be possible to stick a call to a new function >> (return_to_user ?) right after the DISABLE_INTERRUPTS below, which >> could be used to do the context tracking user_enter just once, and >> later on also to load the user FPU context (patches I have sitting >> around). >> >> syscall_return: >> /* The IRETQ could re-enable interrupts: */ >> DISABLE_INTERRUPTS(CLBR_ANY) >> TRACE_IRQS_IRETQ >> >> Andy, Denys, do you guys see any issues with that idea? > > Ick. Let's make the mess better before we make it worse. Now that > Denys disentangled the syscall exit path from the interrupt exit path, > let me see if I can just rewrite the syscall exit path entirely later > this week. I suspect we probably only need two possible function calls at syscall exit time: 1) A function that is called with interrupts still enabled, testing flags that could be set again if something happens (eg. preemption) between when the function is called, and we return to user space. 2) A function that is called after the point of no return, with interrupts disabled, which does (mostly) small things that only happen once. -- All rights reversed