From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95588EB64D7 for ; Tue, 20 Jun 2023 14:52:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 35A908D0005; Tue, 20 Jun 2023 10:52:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 30A9F8D0001; Tue, 20 Jun 2023 10:52:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1AB938D0005; Tue, 20 Jun 2023 10:52:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 0BABF8D0001 for ; Tue, 20 Jun 2023 10:52:39 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id C86A61C93DA for ; Tue, 20 Jun 2023 14:52:38 +0000 (UTC) X-FDA: 80923417596.09.DDC4DFE Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf21.hostedemail.com (Postfix) with ESMTP id 2FAEF1C0009 for ; Tue, 20 Jun 2023 14:52:35 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=E+2rvkch; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf21.hostedemail.com: domain of ypodemsk@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=ypodemsk@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687272756; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=No1ZAzXRenHK6Spay7fCIW5zNaUlPsGtRXWs40EaAkg=; b=FUY9Q38Wp5UEh87sbgSxsF9yw2YoND1fUUCERsP6hrhrcGEr3VoMox4Wovqd2Xh8xUN31H NlEqVBPonkyNWBn2SCtt9oYLuPRZpVtoT1eijphaSIu3UhcTWt9L77CHwk2KjykAZoF9We Jc9acpBXVILwfWrqj+7mEb/1fwlbZ94= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=E+2rvkch; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf21.hostedemail.com: domain of ypodemsk@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=ypodemsk@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687272756; a=rsa-sha256; cv=none; b=zJn25ay728UaF9hpi+BMpXjiSWPxP+4gH4AykTaAMfuOTFZ2gP+nbWnA837sXcdEyK8Zqt vhyWdK2Im0Q+oOPJZLPxnxtup1G3IdYN2dx9GVws1CvmjFI/R6yO+N5mZniwW+b1Fa3zJQ rrLGE6WiQKBpo+FUynSEUNN949daE3I= 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-Rspamd-Queue-Id: 2FAEF1C0009 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 7qrbs4cgjgx6fs4ybc1m5wcfa15pcem5 X-HE-Tag: 1687272755-302714 X-HE-Meta: U2FsdGVkX1/iSwI5LZpv40qhtVoG0ECsfta+vBtKvLDLgxZKqX9AL0rwZE/KKyYnwaiEIs+KtbJArLPJaEfJdrD+safIXaFod1/G/wzA/pEYLBBDQrrvp/t4VRJLekZFA+RBn65QWJkaOMN22g/jtQlDFH8gxhbcJIABiT/qVryX5NlMsp5DEAlaGP0VFkKr15YuwLH5S+LWmp+NRjyhvMgaJTvS9FMMxxFuNw/3IiRypF8dkzkwPb5M4M1fWzPrqbMKV1JdwBJ/zvMHVchQIphuJsUoX6/L0zxr85lmKEVz7g6kFRcJxzEsj1FjfpW46Y7mVsEuqr2VSrl6r20/e+3u/SpkGKmBObhq4iREJqqtQJnPCn/8av6e/qyLaccUyE6FIOjsKLbIORSe1AdYNftURdEtMDq5o7fJiqlNwsOcL5n81HivgHAqMnkoml62Rb3Jiwr1f7Y8bAco2MebfTi1+uhqxGS5aeNxa+vlomCOf08U98G4fQLpuHTkrblN1+VGguXxy1v9Ln3uRM1bQDgcqc1K9rLf2XO+RXlyxSfpu6cHX5aW1zn314Y7Y+nfy83mK9Duz1pDI9wbGM7NNNFpWu1jBSOUf967koRHspE5YHMV4bSIH3kSlmY+L5633TELBv7xQzqgTKZZtSa5341UXVYkzS69PjpK1g4j5c1VFvegDOjENAFARVF9VTMoOCwDUX5CDd6pS6weFAurHFljpSoozC8fxc4IPTTHoIJRlLiGYWwqlzr+A+DDaynOLWYAtxLiGaY0iz6wsd4paxFZZkPSsd83uc7R9DssVcGpVX2CFdwEw3o7ZKXjT1XnfiMuMtl6qh3UOZ0N7z/yoFMo3+FCm6sUnbE6nwQZErUPm5+bW3/Z4/4TKq3ZdAWZtnzdtw18hyX/NUxCE2VGv2OemQJnQw9vhJlfbg1nE5G9HxFdVL8ePcIxicnKWhydck+0jwBzg09NddJtj8R H1QYx7dk T63q9jKWAjbqoHLCDjtRdHbbsRhx2nmjpkb11Cu3Tc8hpAFTvdQ+9apknIsl+zQLw0IStfWJef9H3YxRbn1+dnwjU/6D2xlKlRHHROengAzYRg61qkede4E010Gk+nRnc4eV0IcAhAHJAHRenX84PSbd6pjz6Nu7Y+zUWPTFfXCWWJgc/7Fx1YHN6Mt0rsS1HLVBvEq4s2z90t7FxLBx7gMKmLdpBduKDnuAuLiHYSksQxep2WZWDtqriqRetBcKszIF/x0BD8babC9Tj4AL4o+qT9PRt1hpNqGgPD1TNsABtDGnI3dLvdLeod6UVkpxArtTgus6pdnWwYvFtvfS1uGTq1X9m+Y7bFfyRC+5HFRGnAi5Chmy6g6eulQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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