Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp711583imm; Wed, 18 Jul 2018 09:20:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdgcie4HXEuLrj1m9mEYw/rgGwrpdnnu45TNDzEGnoWHcLsznDwVMSfuCzAHrrrIcObmpmI X-Received: by 2002:a62:ce81:: with SMTP id y123-v6mr5882421pfg.95.1531930850149; Wed, 18 Jul 2018 09:20:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531930850; cv=none; d=google.com; s=arc-20160816; b=uno6BURK/IfLncKtb5IaqrxouyjwFBb8srjLF08uKBDGfJNshGHMLL7Grm4AGdV0Qv pygRPDDMR5kio/lwIE3aTPOjoB8JcD1z+cjRyhFC4dERnrCj7yI6ZRzL3+rL+VY+sJ5B PF3s8JKMecQkDCvXBRE8ynSXZyO3eCUNcqm0P6akaUk2QoWq3uB7gNgcoKyPQekNNo2x IRGJII13xzUvewWNbbDE2fIsaMbTXdj1GJrHBV8fPJPgyHh5NvBzqEiVH4ycksgJS/Dx X9aEcf6pcnfmoAcR92bHPfnUyVdCzCgQoqcSMCyNItVv/xc1NC+60+7EHdMlQDDZgorh S3KA== 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=8aHzsSXrGGr+5xdQy9q7aeiPxVuQ0YjIec6iZn4AWG0=; b=bfX9+JNKPiBPWsBmilEZ0tCdZVh9eXG+rJfSwBGzMFEbQFT7ICRqQBrbG6M91ZaRxK rik/EIxVugYJN71l9YW0bDA/oVeBNuaXBZdPwJVh9AFSs1k36Q6ocw1PRBd8GOhB6cx7 BirDDXvIqATjtNBEywqrpdmCzCWrLMXQ2UsXgDsVvhHrVfj2GpDS0CiGrxkIAZDzaQJR 8G3y8h71b+CLZkBqf5X2c8bK/BS98DVzRSqkMbaUlzLO+Sl0CAoKHDf2AxwNb0NMFFJm MmGVhlLz5hrgqArM+HTIJXUpuntDmuKZewlRQkUui+M11CnFyF8YGUQ4dTja9OQbDTeT pmdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="f16n0w2/"; 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 v1-v6si3252598pgr.469.2018.07.18.09.20.35; Wed, 18 Jul 2018 09:20:50 -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=bombadil.20170209 header.b="f16n0w2/"; 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 S1731313AbeGRQ6j (ORCPT + 99 others); Wed, 18 Jul 2018 12:58:39 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:36882 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730110AbeGRQ6j (ORCPT ); Wed, 18 Jul 2018 12:58:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=8aHzsSXrGGr+5xdQy9q7aeiPxVuQ0YjIec6iZn4AWG0=; b=f16n0w2/Ynlw6OF1saludT12F m9sy6MQDMCKWxguE82TkU6lc31SnNs086xmbY1CRkqpXsD2zHt+/7sa70n8IKCHBNi3DIHFsyiQTf hgKG15WsdDHQAwjd5pDOZzSDH5bGfoi3I1OlxAa7kof/eopDJJKhgZNwmWzcv0669T5H8+Wf6DZq3 s6eiPE9KNkQptP/inP1lkvCCPQ2DMmkRHgTl3YHM77ESH0yzw0Jnx0+F+wXdePGDHFAxb4bjWcPom jvQCXdb/hVtpcT0zyHVCPWZIbmhwNwvMJTntFKJ08sK7GbCn9h393JnfG81YXMf2NW/RH6ICSa1WN gm0HfAN8w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1ffpBE-0002R5-43; Wed, 18 Jul 2018 16:19:56 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 69C1B20277352; Wed, 18 Jul 2018 18:19:54 +0200 (CEST) Date: Wed, 18 Jul 2018 18:19:54 +0200 From: Peter Zijlstra To: Rik van Riel Cc: Dave Hansen , linux-kernel@vger.kernel.org, mingo@kernel.org, songliubraving@fb.com, hpa@zytor.com, tglx@linutronix.de, torvalds@linux-foundation.org, linux-tip-commits@vger.kernel.org Subject: Re: [tip:x86/mm] x86/mm/tlb: Only send page table free TLB flush to lazy TLB CPUs Message-ID: <20180718161954.GU2494@hirez.programming.kicks-ass.net> References: <20180716190337.26133-6-riel@surriel.com> <20180717113906.GV2476@hirez.programming.kicks-ass.net> <1F8BDD25-864D-4105-B872-2109AA417454@surriel.com> <24AA4367-22A1-450E-8F6A-3CBF39518384@surriel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <24AA4367-22A1-450E-8F6A-3CBF39518384@surriel.com> 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 Wed, Jul 18, 2018 at 11:50:33AM -0400, Rik van Riel wrote: > > On Jul 18, 2018, at 11:42 AM, Rik van Riel wrote: > >> On Jul 17, 2018, at 7:39 AM, Peter Zijlstra > wrote: > >> Also, was there a reason to re-implement on_each_cpu_cond() ? (which btw > >> also wants that __cpumask_set_bit fix). > > > > I did not use on_each_cpu_cond() because I had no idea it > > existed. A quick grep suggests very few users of that function :) Yeah, only reason I know it existed was because I helped write it or something like that :-) > > I'll make sure things are done the right way. > > > OK, looking at it some more, I think open coding may be faster in > case of the TLB shootdown code, because that way we only iterate > over the CPUs in the mm_cpumask, instead of iterating over every > single online CPU in the system, and calling the helper function for > every CPU, like on_each_cpu_cond() does. > > However, the difference in overhead might be small enough that > we might not notice. Preferences? Yeah, so the difference is the case where the mask allocation fails; in that case we're under severe memory pressure and performance sucks anyway, right? In which case using on_each_cpu_cond() seems the simpler option.