Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4728480imm; Sun, 26 Aug 2018 02:12:23 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY3mK2yaIA3S9CR2Xt7a4Zb6F6+L3Bd+AnmYAujNsoBbPai4yDbx1W8/+aMK8NA3NgEzet7 X-Received: by 2002:a63:b19:: with SMTP id 25-v6mr8261124pgl.301.1535274743907; Sun, 26 Aug 2018 02:12:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535274743; cv=none; d=google.com; s=arc-20160816; b=HUw6JgS7qnJ4g7nTtCD9+iGGesqPrRRfx39J/xE6mxGXdmLO7noSXt+iMmDbagnhv6 AK56Vbvo8hdTpKPYhSdAwCU8Bt3fjfOUt63PaTsKVFb8Ap4RVluD8fLl5baNFEb0nsY0 aDyfcND5GzAeiLRRz5/47UCD9tirolbnicHZoZmvzsCKm//RmPYy8L8jMrWyAutMYHLU O7DvhPoP/0LSEwldI+1oVUru6XOTFSmQpUCp22LlePAX6nVY9uRqNFWd8Wy9SAXgGKt2 MDiDRa7Pvb9r44AkA6RePL23q+0sPn1NSM1XIeVejsLhfnERROL6erDs2pEFrcX5Ai5L taEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=Jt0oOLxfIzuU8qEN+Ck+i6KG4P9MOFTtQQBTRs+RvhI=; b=zizBma7MqF3VIUKNQfQHHW/3u+WUZUQ0kpK9D+hXgh+7yhAfGSBma62vgc4DV/Hoxu TXt8qBeQ9EfkkmQoSKcc/SxdDBFrwcPdU0xS0Ouy3JCzOK6aL4mzlhpPQaw5EfpppzoI xQlgEKtz90q77T3zdk5n2uWrIihXfw20nrfl6FXigU+QAtC6GkPAxsa9H8Sk6+aYQBP1 j1ZnYbyb0nNmju712c14JffeBWeLEURsTFifrA5gDwpeA0WZJr6De/njockLO6YJVcL0 qpbOxQlguRVg8A36Dxi0E7fWXJVYQ6nS8FwUuYMWZWkUUuxYnaXWArZr+HNt6djiTtSa 8k7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=DScAhLgK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g18-v6si7756748pgh.276.2018.08.26.02.12.06; Sun, 26 Aug 2018 02:12:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=DScAhLgK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726724AbeHZMw5 (ORCPT + 99 others); Sun, 26 Aug 2018 08:52:57 -0400 Received: from merlin.infradead.org ([205.233.59.134]:54912 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726409AbeHZMw4 (ORCPT ); Sun, 26 Aug 2018 08:52:56 -0400 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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Jt0oOLxfIzuU8qEN+Ck+i6KG4P9MOFTtQQBTRs+RvhI=; b=DScAhLgKn94OCa0A6iPBIOltF fMbMbYKywWISKNujOlP5qyGh4dwUbHulQcvjbNorsxDxPBaY8+WNeg+6SzavYMlhmmECjGG1Utcpz ulrWruo0M6+dPT67igvePbk/HBnZqYtMZQQWbROCl/dk1hvvop05OGLBk5lkHZlnWXgWcDr2DfovE Dxk4RlyDrIDla1lfWDFbSWkZcx2OCKQNXtg2te5B2IzBNpuWXZ/4FTw0TA1IDqg93DG6WpToJOZKj fM58Afvw5sbeFjTc7TTgSbdTyX2vdM/ntYaCpNhZFPzB2083jwBpCs3GR+3KDr7GYoQGFES7BzLdq YvKjm0b+w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1ftr3c-0003nk-2l; Sun, 26 Aug 2018 09:10:04 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 54B332024EB1E; Sun, 26 Aug 2018 11:09:58 +0200 (CEST) Date: Sun, 26 Aug 2018 11:09:58 +0200 From: Peter Zijlstra To: Andy Lutomirski Cc: Masami Hiramatsu , Kees Cook , Nadav Amit , Linus Torvalds , Paolo Bonzini , Jiri Kosina , Will Deacon , Benjamin Herrenschmidt , Nick Piggin , the arch/x86 maintainers , Borislav Petkov , Rik van Riel , Jann Horn , Adin Scannell , Dave Hansen , Linux Kernel Mailing List , linux-mm , David Miller , Martin Schwidefsky , Michael Ellerman Subject: Re: TLB flushes on fixmap changes Message-ID: <20180826090958.GT24124@hirez.programming.kicks-ass.net> References: <20180824180438.GS24124@hirez.programming.kicks-ass.net> <56A9902F-44BE-4520-A17C-26650FCC3A11@gmail.com> <9A38D3F4-2F75-401D-8B4D-83A844C9061B@gmail.com> <8E0D8C66-6F21-4890-8984-B6B3082D4CC5@gmail.com> <20180826112341.f77a528763e297cbc36058fa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 25, 2018 at 09:21:22PM -0700, Andy Lutomirski wrote: > I just re-read text_poke(). It's, um, horrible. Not only is the > implementation overcomplicated and probably buggy, but it's SLOOOOOW. > It's totally the wrong API -- poking one instruction at a time > basically can't be efficient on x86. The API should either poke lots > of instructions at once or should be text_poke_begin(); ...; > text_poke_end();. I don't think anybody ever cared about performance here. Only correctness. That whole text_poke_bp() thing is entirely tricky. FWIW, before text_poke_bp(), text_poke() would only be used from stop_machine, so all the other CPUs would be stuck busy-waiting with IRQs disabled. These days, yeah, that's lots more dodgy, but yes text_mutex should be serializing all that. And on that, I so hate comments like: "must be called under foo_mutex", we have lockdep_assert_held() for that.