Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7954331rwd; Tue, 20 Jun 2023 08:18:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ746Tb0mzzOHJF1CZ9nI2pGjlSi+FgOcWLcAGKNiDn9ebAMDGv0OYsFOF7oKwxo1v0hN/eN X-Received: by 2002:a17:902:f547:b0:1b5:4f0e:eb04 with SMTP id h7-20020a170902f54700b001b54f0eeb04mr7403176plf.24.1687274309634; Tue, 20 Jun 2023 08:18:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687274309; cv=none; d=google.com; s=arc-20160816; b=IW/cycs/LzhHCum1GgMWd8LHCzdovpin6U7M1ItfNFX+IsyCSG9Di0zr633/J/sOjU u+e5/qk/FEdE97fkE9vjKTKljRa2rbBXRPTGaMI7c3sO/k+5XuglsvuotPKfuH6eMYWW B3st7QcCFAkhbjwPvKN31NJlEzOr3jhcTv1oTmxpDyToShwIhsZpTO2gEPbG+rF9PzJ5 puU/npROa0mYZHfsKu8/Ed4R4oDyllcu35brBkB9Px2Sh9QRb/xyiObfsDz2tzhMda+U 95fNrUNWXDRtc4Jg1u7XDPO2dwr1XfMp8Bjplj0clEPTayiw3gxrMOplLFlS9EWx6uC4 b+fQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=No1ZAzXRenHK6Spay7fCIW5zNaUlPsGtRXWs40EaAkg=; b=cDwCDpgmnqKL7KZirPIhe+ZruCSvVXeb5p2bJZg0yiyYyh+VoV8fYG3649HCXUbk9N 5GWy/nPr76VOjeDK4KSdA36YleceamrqXCD5VLzL7JAzZkgLQ/fkGZkd5nUls4v6R8mz Go7pZiYzi+Iv8LeZTf51EDi2dyxMz9bGdGeEpX/trrSdQ6jcXSrLz6y/d3EN0+eg7c2G KxUa8QkhuxKvILfewCqLHZwengJYowHfY+mv87o9JYGMyIrEiiYT+W7dY6pkJGIGfJUj KieT+zUX7g2TjZ/cdCl+xqWK3wU7Lz+sgkYvu9uD1XwRH9A+NE8la5ChnGUkydbsWjn/ dTwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=E+2rvkch; 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 p15-20020a170902e74f00b001ac78ac2c9csi2297590plf.573.2023.06.20.08.18.16; Tue, 20 Jun 2023 08:18:29 -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=E+2rvkch; 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 S232927AbjFTOxY (ORCPT + 99 others); Tue, 20 Jun 2023 10:53:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231954AbjFTOxU (ORCPT ); Tue, 20 Jun 2023 10:53:20 -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 EC527DD for ; Tue, 20 Jun 2023 07:52:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687272755; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=No1ZAzXRenHK6Spay7fCIW5zNaUlPsGtRXWs40EaAkg=; b=E+2rvkchJP4KwUh0RKc+LmD1DNImntu3ru3cT3YZM5g2fZ3aCV7k9kvd+E50KUbgLsG/je mqY1vpdk/BpDRI4qwDcEWwk2l6U9Sc3GAIoSCf+tLzUuglKT8CTOjfSLFdYZz0rAKoNZNG UquCyeAIxvr6KJihM092LKnHoqHv6QQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-400-9hW9-9gWM06uUSep_ULxGA-1; Tue, 20 Jun 2023 10:52:31 -0400 X-MC-Unique: 9hW9-9gWM06uUSep_ULxGA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4169729DD9A3; Tue, 20 Jun 2023 14:46:34 +0000 (UTC) Received: from ypodemsk.tlv.csb (unknown [10.39.195.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 863679E9C; Tue, 20 Jun 2023 14:46:25 +0000 (UTC) From: Yair Podemsky To: mtosatti@redhat.com, ppandit@redhat.com, david@redhat.com, linux@armlinux.org.uk, mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, davem@davemloft.net, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, keescook@chromium.org, paulmck@kernel.org, frederic@kernel.org, will@kernel.org, peterz@infradead.org, ardb@kernel.org, samitolvanen@google.com, juerg.haefliger@canonical.com, arnd@arndb.de, rmk+kernel@armlinux.org.uk, geert+renesas@glider.be, linus.walleij@linaro.org, akpm@linux-foundation.org, sebastian.reichel@collabora.com, rppt@kernel.org, aneesh.kumar@linux.ibm.com, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: ypodemsk@redhat.com Subject: [PATCH v2 0/2] send tlb_remove_table_smp_sync IPI only to necessary CPUs Date: Tue, 20 Jun 2023 17:46:16 +0300 Message-Id: <20230620144618.125703-1-ypodemsk@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 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. By limiting the IPI to only be sent to cpus referencing the effected mm. a config to differentiate architectures that support mm_cpumask from those that don't will allow safe usage of this feature. changes from -v1: - Previous version included a patch to only send the IPI to CPU's with context_tracking in the kernel space, this was removed due to race condition concerns. - for archs that do not maintain mm_cpumask the mask used should be cpu_online_mask (Peter Zijlstra). v1: https://lore.kernel.org/all/20230404134224.137038-1-ypodemsk@redhat.com/ Yair Podemsky (2): arch: Introduce ARCH_HAS_CPUMASK_BITS mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to MM CPUs arch/Kconfig | 8 ++++++++ arch/arm/Kconfig | 1 + arch/powerpc/Kconfig | 1 + arch/s390/Kconfig | 1 + arch/sparc/Kconfig | 1 + arch/x86/Kconfig | 1 + include/asm-generic/tlb.h | 4 ++-- mm/khugepaged.c | 4 ++-- mm/mmu_gather.c | 17 ++++++++++++----- 9 files changed, 29 insertions(+), 9 deletions(-) -- 2.39.3