Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp586630yba; Fri, 26 Apr 2019 05:32:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKiXME/G6nb8YuqgwE72us0ijfHjb8DdwA6mbJEfppnUyucszgVhGl5H8UApUOa9NSDlA8 X-Received: by 2002:a65:608a:: with SMTP id t10mr43490166pgu.125.1556281956144; Fri, 26 Apr 2019 05:32:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556281956; cv=none; d=google.com; s=arc-20160816; b=cy0F1ukS3EyGc4xg6vBz6xtNP+/LBpyk2GM/boHdlvcSAEgB1HbrrBsQr16WfJ20by 2yeGruGfeNSPnKErc5bW0TlBkky+8RAVHEG6URQ12bmsMIBWD43QcCyxqtppgz7HTpDw x4ibXLFhd4dM5I76ruj+yBNsxMxCiIoyZVQGNebimQau8u9NAbnMwe11X3kuyJCHBtTs OC9/+uPsEEqNj5edIYOLOCT71k25+TZtbANwTgO0WNwZ6qFLIJBgIlTq/2QajSB1liGe s00P6DVcyYznsfCw5N2lDYh15N1qnXXSi/NlXA5EYuFCLEVyyOyxMbXW30bXhpGnU71M cGkw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SY3OmMcmE6RsLtnPRQw6TPwMMsYZdkv6QteKnLQJd5w=; b=yKV+DTql4UZbBRpwJIOQNcIsmqGjLMpX0+FrfbI9K2pw/e9jsAGzsaRuW4/8h3SJXm ki/fXPnKKGTFDBxuVHR1y51+eReyWZKxp+MjKIEMFeLkSa6zl6CPhMQlB7WNn7Y+zvfx 2rXoQTICic+vbS5xcuIYgA7Y6kNsUApamtQ49hOz8PmQwpN/rndz0RNE5VrLBHlYDDk8 BsB0/E2OqxQ08m06SkVxJVf5T1QTL5qv4roVrwVAVNlBGUXO+YDiItFYssMFcV3cw4UG D0cwLTzwHr3i7KYNxG7cisYvngktUJwVtJV57ckXJPktdW53b/gvM4YhYd3GxF7nbwfn kU0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="bRH4o9/O"; 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 h5si23089276pgq.224.2019.04.26.05.32.20; Fri, 26 Apr 2019 05:32:36 -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="bRH4o9/O"; 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 S1726321AbfDZMa4 (ORCPT + 99 others); Fri, 26 Apr 2019 08:30:56 -0400 Received: from merlin.infradead.org ([205.233.59.134]:33148 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbfDZMa4 (ORCPT ); Fri, 26 Apr 2019 08:30: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-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To: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=SY3OmMcmE6RsLtnPRQw6TPwMMsYZdkv6QteKnLQJd5w=; b=bRH4o9/Oi8qVjVbCcaZY40XtXC bNM6mos7i1fnURib3xf05NVW9StXGrC9QxrJAmKIORd4cfEHpVtJPxXYWUYFfq+qcnzaI6QoK9RK6 +Wh9xHuZIQeZfKkgsioIJ9TtpZil+Iknh2S+1bFF3mqBFwMmxg9v/cm4DYSYf8IciOUxunS85o5ZL whZGJAZ/t2UeIaAUTsz67260Hfv9i2/06Qe/Xkr0ykKPeP2eYHg8YwzeDMj5CjarVQ58fyIHZl8/r h7pROZZy2CHvPBlSTLIc3oHd+56eqKt0AxG+xR6H5lHa2doN+C48K029JlNdkICTi477E9ZPgUpXp YbjFaP5g==; 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 1hJzJ0-0008Qs-GZ; Fri, 26 Apr 2019 11:46:14 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id CF76329D173A6; Fri, 26 Apr 2019 13:46:10 +0200 (CEST) Date: Fri, 26 Apr 2019 13:46:10 +0200 From: Peter Zijlstra To: Nadav Amit Cc: Ingo Molnar , Borislav Petkov , Andy Lutomirski , Ingo Molnar , Thomas Gleixner , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , Dave Hansen Subject: Re: [PATCH v2] x86/mm/tlb: Remove flush_tlb_info from the stack Message-ID: <20190426114610.GC12232@hirez.programming.kicks-ass.net> References: <20190425180828.24959-1-namit@vmware.com> <20190425192930.GA91578@gmail.com> <82E44F4A-E52D-4666-95B5-C6248A14A442@vmware.com> <20190425194837.GB58719@gmail.com> <20190426075349.GA4038@hirez.programming.kicks-ass.net> <14D4B64B-3684-4090-9881-C4A605CF5A19@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <14D4B64B-3684-4090-9881-C4A605CF5A19@vmware.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 26, 2019 at 08:37:37AM +0000, Nadav Amit wrote: > Interesting! (and thanks for the reference). Well, I said it would be quite > surprising, and I see you wrote the same thing in the patch ;-) > > But correct me if I’m wrong - it does sound as if you “screw” all the uses > of atomic_inc() and atomic_dec() (~4000 instances) for the fewer uses of > smp_mb__after_atomic() and smp_mb__before_atomic() (~400 instances). > > Do you intend to at least introduce a variant of atomic_inc() without a > memory barrier? Based on defconfig build changes that that patch caused, no. https://lkml.kernel.org/r/20190423121715.GQ4038@hirez.programming.kicks-ass.net Also note that except x86 and MIPS, the others: ia64, sparc, s390 and xtensa already have this exact behaviour. Also note, as the patch notes, that on 86 only atomic_{inc,dec,add,sub}() have this, atomic_{and,or,xor}() already have the memory clobber. Also, that would complicate the API too much, people are already getting it wrong _a_lot_. https://lkml.kernel.org/r/20190423123209.GR4038@hirez.programming.kicks-ass.net