Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1385009rwl; Sun, 26 Mar 2023 01:09:36 -0700 (PDT) X-Google-Smtp-Source: AKy350YsVUrMf/dH/5jUPKgI3MgFO5Ju3H1T91GV47JEkXpLW/ymmQiInoGceMZtLFXaA+swK94z X-Received: by 2002:a17:906:5d0b:b0:933:3aa7:57a7 with SMTP id g11-20020a1709065d0b00b009333aa757a7mr10253925ejt.49.1679818175897; Sun, 26 Mar 2023 01:09:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679818175; cv=none; d=google.com; s=arc-20160816; b=RYAh6qZDsDivpaF2eaqw3EByJkG39U0J0gdvTTBiiyaT1i2fDgvRDlCcJKiVReUjZ9 ocrVIjXGVWMW9eFBJxNCWTuvISB2ajO/HJBXpIAmAJiybPTeyJPX/FyBRMJDfppcKAFn Erk2Aynj99L3YRg1QsOOgWZUwEvp5cBgCm4+/Vtxvs8jz+beZh2MbMLNhjvmbR4w13dA Sb6xDx2jNaZgM2TnKhu6GSrfdcG+Sx6U+piQg320STUX7tUbfK3rAT1uLExUdd/ubxl8 d9HpBkweB7rog9CLVBFNNIbLvssVitvW40i8Nu59j/t+halRdT0C1c/27C/epA7c0cjb Knfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=51I4tYLSmoNnjzd854BdOPa0P0UjuvWyL9QlaGHcgJs=; b=rNXMwDOqEits+tr5LvrMljq44y3Gln1/Op49wsmrj+2V/4tA8qrpy0tpct3j1Sotk1 xkK/s8V3EJeAhzS16NZLSZPQ5m03HbgSVN8JIhrPrDpz7Zk8Hz6RjOlh17z8PP3sz8RU 9Bzy0gEUgQPJJ93UvYLTpm8V3Xn5IJ0fRdGlwHGSoWVjm7g1cYf71GEtIDmSUHi5AI1P d2s+qPoDTangq/38xM+ZzLJutp73akER3v5lVkQExIZxqY16ruk5IwYJdQI3S/qy16Sd XsThkuXTHtN2dPEdAttf3SyLZ/Mcutofjvrpxmlopku5zUESenYFGZteUG8+Jspg8VGO 59MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=A7TBBCbK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb3-20020a1709077e8300b0093e37416d91si5430624ejc.143.2023.03.26.01.09.10; Sun, 26 Mar 2023 01:09:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=A7TBBCbK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229655AbjCZHlI (ORCPT + 99 others); Sun, 26 Mar 2023 03:41:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbjCZHlG (ORCPT ); Sun, 26 Mar 2023 03:41:06 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34E2C868F for ; Sun, 26 Mar 2023 00:40:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679816417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=51I4tYLSmoNnjzd854BdOPa0P0UjuvWyL9QlaGHcgJs=; b=A7TBBCbKqqqe7GCgCyiVkZ54pHQ3vfGqfGLUApUBr0w889hWlTT0O8TODkY9JPyIcUdixG Y0LDb0wS6W4atnG2oRnncGgAyHZN0F3GCFp5YKIIfrFmP4MP6BoVkBOItrwd2o6D9Ebbki Orxs5xW3Jy4zQms9Fn+ROVrM2b4nZF4= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-654-YwJN95xtMsWytGuFSlU1Zg-1; Sun, 26 Mar 2023 03:40:16 -0400 X-MC-Unique: YwJN95xtMsWytGuFSlU1Zg-1 Received: by mail-qk1-f198.google.com with SMTP id r70-20020a374449000000b00746c31401f0so2576958qka.6 for ; Sun, 26 Mar 2023 00:40:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679816413; h=content-transfer-encoding:mime-version:references:in-reply-to:date :cc:to:from:subject:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=51I4tYLSmoNnjzd854BdOPa0P0UjuvWyL9QlaGHcgJs=; b=JSCRMb/E02vQUGb77uoODoLKDgjpEI6bWtVp8VGxe2IXeGwBsutKlvhHffzT8e7D0W W7W3NVrK9dv7YK9i6gOR1DOwa1GI7bcQPkxGMOlmGy8RaLvOOLygQdtYXV/c40INnfXP J402P0bZh7wCXMDycb/2f0lpjRB7XNgUxDiwUV1D5bsSm8MHOoQdt2i29VqC+/SX43iH 9Re0nHkpmNC/WiHYOrRyTxJn1sGnjlFbWBuLGVoAny9B3N8n8aI4Zi8fAodWFJnYV/i0 MM5iqUbvBrXk9e3aBQ7aj2k6H9QdNP5URVmm7orHtNDvbnObulc77mjqahAt/lKkon+D SEag== X-Gm-Message-State: AO0yUKUZ5DXlkv1+jJ+/kUw47WolpG1HwLHmHip3E5FAeXwgBP9zkoeW XslsgjzPqSbiEir9HBJDBpnxDMomjs7vwQI+J5tnkjmoEeqAvYCy1uritcbwNcMsJMxeJ68qtxo yNEu/YodJ3EUDMZBR/vTl8wMV X-Received: by 2002:ac8:5702:0:b0:3e0:8c58:1dd with SMTP id 2-20020ac85702000000b003e08c5801ddmr14893685qtw.55.1679816413601; Sun, 26 Mar 2023 00:40:13 -0700 (PDT) X-Received: by 2002:ac8:5702:0:b0:3e0:8c58:1dd with SMTP id 2-20020ac85702000000b003e08c5801ddmr14893667qtw.55.1679816413373; Sun, 26 Mar 2023 00:40:13 -0700 (PDT) Received: from ypodemsk.tlv.csb (IGLD-84-229-251-248.inter.net.il. [84.229.251.248]) by smtp.gmail.com with ESMTPSA id u17-20020ac87511000000b003e38f8d564fsm581391qtq.66.2023.03.26.00.40.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Mar 2023 00:40:12 -0700 (PDT) Message-ID: Subject: Re: [PATCH] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to MM CPUs From: ypodemsk@redhat.com To: Will Deacon Cc: Peter Zijlstra , aneesh.kumar@linux.ibm.com, akpm@linux-foundation.org, npiggin@gmail.com, arnd@arndb.de, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, mtosatti@redhat.com, ppandit@redhat.com, alougovs@redhat.com, David Hildenbrand Date: Sun, 26 Mar 2023 10:40:08 +0300 In-Reply-To: <20230324151259.GC27199@willie-the-truck> References: <20230312080945.14171-1-ypodemsk@redhat.com> <20230320084902.GE2194297@hirez.programming.kicks-ass.net> <20230324151259.GC27199@willie-the-truck> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2023-03-24 at 15:13 +0000, Will Deacon wrote: > On Wed, Mar 22, 2023 at 04:11:44PM +0200, ypodemsk@redhat.com wrote: > > On Mon, 2023-03-20 at 09:49 +0100, Peter Zijlstra wrote: > > > On Sun, Mar 12, 2023 at 10:09:45AM +0200, Yair Podemsky wrote: > > > > Currently the tlb_remove_table_smp_sync IPI is sent to all CPUs > > > > indiscriminately, this causes unnecessary work and delays > > > > notable > > > > in > > > > real-time use-cases and isolated cpus, this patch will limit > > > > this > > > > IPI to > > > > only be sent to cpus referencing the effected mm and are > > > > currently > > > > in > > > > kernel space. > > > > > > Did you validate that all architectures for which this is > > > relevant > > > actually set bits in mm_cpumask() ? > > > > > Hi Peter, > > Thank you for bringing this to my attention. > > I reviewed the architectures using the MMU_GATHER_RCU_TABLE_FREE: > > arm, powerpc, s390, sparc and x86 set the bit when switching > > process > > in. > > for arm64 removed set/clear bit in 38d96287504a ("arm64: mm: kill > > mm_cpumask usage") > > The reason given was that mm_cpumask was not used. > > Given that we now have a use for it, I will add a patch to revert. > > Maintaining the mask is also not free, so I'm not keen on adding it > back > unless there's a net win. > > Will > How about adding a Kconfig to mark which architectures set/use the mm_cpumask? This will allow us to use the mm_cpumask on architectures that support it, and use acpu_online_mask on those that don't. Also make it clear which architectures set the bit for the future. Yair