Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1907844ybk; Mon, 11 May 2020 07:17:41 -0700 (PDT) X-Google-Smtp-Source: APiQypJt0AYEQ5lNIpTHadtkKw45tcZbl1wIgxX/JBdMf+fhpsQCEwT4xTGR5nN5uIIE9kg0oxc6 X-Received: by 2002:a17:906:ef2:: with SMTP id x18mr13153625eji.234.1589206661125; Mon, 11 May 2020 07:17:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589206661; cv=none; d=google.com; s=arc-20160816; b=EIjkUbXXKfKlSlHJkrJUiSaqtFFBVJZzkY+mJEP1UkupbIDc+3NpdGeBBYAErzljHn VXPmJhMZJazNERzCrasihtoGef8P06F3SB+alroIJzSkkGGaWvOuSJoWugTfmpKzYwh9 LJZxT447kVF2KRppQOlyhvnVI5mOBpOInuhNwVQfyt9V5eECeGLXWiiqh9bELK8nrxq6 FUrA3paKDuGipppk3IsXNH7mx5MHaCoARTxq5Cy64oe/4KJkiUjb5Nbvtnm5+cbZC7w1 gRVXCfegW4CqzqaSDl6AjWBlJWStKGHdE2dKjh4ICJFEJtK+F+UxC9wlWQvb0R8hCnUN YNkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=T9Qnr/2MzlWVnks5PwjcDz5PI6t5JFXZYCHiiiwBn94=; b=KqgGAwrjChdcQAmRbL1qyxqp/VYXLwuxpoI/9JbnpL4F7zol3heRUQrugwSihmA/Qo wXvpopJhW4+feZoflvn16VvvOz1q4MmlZPKadvoWqzFyI4J+rGIRmBJv+LMUsa6bU5wv fgjQMiJaJN9MBmBT41ZHvuQxhzbRj0cYmbqFbPWRTMQSfC63uk60kmdc9EVZy6MQN1nj lTRu+qahdpaGeJzpWI+InDb0s09n9aVSJSUPa5wMqv8Wk0NGyriSkap89nWVlhktH5bt l7SLdDOm0FlCaw/Y2pvguNN3EqBLMbZVUeaDivc2kZNz+8Fl/DPNoqktg/QQty4Yr0VT +g2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=hqEfK482; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw21si5650048ejb.158.2020.05.11.07.17.13; Mon, 11 May 2020 07:17:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=hqEfK482; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730489AbgEKOOf (ORCPT + 99 others); Mon, 11 May 2020 10:14:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1730180AbgEKOOe (ORCPT ); Mon, 11 May 2020 10:14:34 -0400 Received: from merlin.infradead.org (unknown [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E712C061A0C for ; Mon, 11 May 2020 07:14:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=T9Qnr/2MzlWVnks5PwjcDz5PI6t5JFXZYCHiiiwBn94=; b=hqEfK482wRokrGdrAabZBo4Dn6 H0k1Bbwg0Vi08tsmwkQG+EteB+nkAOP2QTEIkjj6zeBYQ0/777WpIlSS9lzfGgDBeQIOmXDYMbbWX YtFu681uKQlUn1xvGn2UYqjl0ZYSg24rALU3Km+xSD0EEaTc4rVNG6uSYu3r55wvhdBzr5Aqq7KfU Io9bWaAxMDtaK0sSULhOtQtCePnYNi7v2CmOD1byl9nyx+qBCVHu6X/DxRIMPiF7UKt+Ow+yhf5Zn BI1R2bVQFU4TkfoTvXgPQggiIVNQ3rWrnB/J3sZS5jreNAM3qK07Ik/TwbApdiTBbq0qSJ4sAomnF aD9u7ziQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jY9Bn-0008Hp-90; Mon, 11 May 2020 14:13:51 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 6D007301EFB; Mon, 11 May 2020 16:13:48 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BCA4D2870CB3F; Mon, 11 May 2020 16:13:48 +0200 (CEST) Date: Mon, 11 May 2020 16:13:48 +0200 From: Peter Zijlstra To: Alexandre Chartre Cc: Thomas Gleixner , LKML , x86@kernel.org, "Paul E. McKenney" , Andy Lutomirski , Frederic Weisbecker , Paolo Bonzini , Sean Christopherson , Masami Hiramatsu , Petr Mladek , Steven Rostedt , Joel Fernandes , Boris Ostrovsky , Juergen Gross , Brian Gerst , Mathieu Desnoyers , Josh Poimboeuf , Will Deacon Subject: Re: [patch V4 part 5 07/31] x86/entry: Provide idtentry_entry/exit_cond_rcu() Message-ID: <20200511141348.GH2957@hirez.programming.kicks-ass.net> References: <20200505135341.730586321@linutronix.de> <20200505135828.808686575@linutronix.de> <72cb3e24-3f82-7e2a-7630-233749c780c4@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <72cb3e24-3f82-7e2a-7630-233749c780c4@oracle.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 11, 2020 at 03:53:17PM +0200, Alexandre Chartre wrote: > > On 5/5/20 3:53 PM, Thomas Gleixner wrote: > > The pagefault handler cannot use the regular idtentry_enter() because on > > that invokes rcu_irq_enter() the pagefault was caused in the kernel. > > I am struggling to understand this part of the sentence: "because on > that invokes rcu_irq_enter() the pagefault was caused in the kernel." > > Do you mean: "because that invokes rcu_irq_enter() if the pagefault was > caused in the kernel." ? The problem is that rcu_irq_enter() uses per-cpu state and expect rcu_irq_exit() to be called on the very same cpu we did enter on. However, #PF likes to schedule and breaks that expectation. While there are more exceptions that schedule when from userspace, #PF is the only one that does so when from kernel space, which makes is 'special'.