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 47390EB64D8 for ; Thu, 22 Jun 2023 13:41:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BC2E08D0003; Thu, 22 Jun 2023 09:41:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B73188D0001; Thu, 22 Jun 2023 09:41:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A3AC88D0003; Thu, 22 Jun 2023 09:41:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 95A368D0001 for ; Thu, 22 Jun 2023 09:41:58 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 5B9B780BA9 for ; Thu, 22 Jun 2023 13:41:58 +0000 (UTC) X-FDA: 80930497116.20.527F1E8 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf17.hostedemail.com (Postfix) with ESMTP id 3F32E4001E for ; Thu, 22 Jun 2023 13:41:55 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=OUygbH0Z; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf17.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=mtosatti@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687441316; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=eFmMS1U29te7tFKtgkPWLc+o83wVHmxe900XZpUTdy8=; b=gDEGkStGrvOmFaWaah0rqyZXHRJmy+30OwT89S/zyqantHrBiULlnu8C/nYAAUZuSsvvom pQSB4MydmfTCctOcK/fmMlsoTvmCV4CdtZbA0beMZK+Nfe3DMPD15Hb2VKmPih8ggfhaKi gUeEmekRUL6VUJcLnhiSf7nxTu2fYq8= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=OUygbH0Z; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf17.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=mtosatti@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687441316; a=rsa-sha256; cv=none; b=4qXH0jgEGvEQMAMGJk5gwAoqVZ2ctvd6mDWrIRDEgBvNbYtWBhkwflM92DQFPMC0CZmt2D ON6MEOsDUTfhaHNsT/bMCCM99Pup9H2l0iJLIpDU7PWM7GIsAPQhKNEPd29k2X68POsIk2 bHH5My5g/lt83ungvvhgiuI5Oekzw8w= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687441315; 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: in-reply-to:in-reply-to:references:references; bh=eFmMS1U29te7tFKtgkPWLc+o83wVHmxe900XZpUTdy8=; b=OUygbH0Z7/xVJtfDMECuHspEMsFbG4RnWly9nE+FwBoOFufkOj5NpIAWTkYIb66cbbH3Mj uUiNSKyytAWOAQdUGe2qOYDiU6goThYv0Im6FRgoz+vsBhoF+0Cb6BhQjwYfLReF+ohh7m mpN0tkDqMU/ZSUEk3a0qY5QOhetuZTg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-522-gHPWKO21MFaNd35SQfD9XQ-1; Thu, 22 Jun 2023 09:41:52 -0400 X-MC-Unique: gHPWKO21MFaNd35SQfD9XQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D2FA8104458A; Thu, 22 Jun 2023 13:41:48 +0000 (UTC) Received: from tpad.localdomain (ovpn-112-2.gru2.redhat.com [10.97.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9FD83112132C; Thu, 22 Jun 2023 13:41:47 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id 7AF94400E05F5; Thu, 22 Jun 2023 09:47:22 -0300 (-03) Date: Thu, 22 Jun 2023 09:47:22 -0300 From: Marcelo Tosatti To: Peter Zijlstra Cc: Yair Podemsky , 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, 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 Subject: Re: [PATCH v2 0/2] send tlb_remove_table_smp_sync IPI only to necessary CPUs Message-ID: References: <20230620144618.125703-1-ypodemsk@redhat.com> <20230621074337.GF2046280@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230621074337.GF2046280@hirez.programming.kicks-ass.net> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Rspamd-Queue-Id: 3F32E4001E X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: pdm6tkthm1bswy1y6p49rhngk9j7c6fe X-HE-Tag: 1687441315-915576 X-HE-Meta: U2FsdGVkX18EWwMeqlPxHOFUQH6Ylu2AXvVSjoht1h8BQI7ojMoEt/spRlkmAt9dcVMCyCn38tSuLr6eJySamyIFCReGoKAsjygk4WP+hd3wykcX7vpraOueWqzfgjCLEsBW75X3UATuA/9vRyAdl+mnYRw7RfXcac0ELrpQTsuZP0OMbsstcUxCJLUFSjvu5oBc01Aq6kwYC9DtIZUsp84r6WCPIbL88ytS6Ixu7RK+W0sisX4NeNlnM/MH79RSIdUAgj75IOmjCrTqM8JQ/XVtFkd+7rwLpS+bF9gAgC5UYWbGTTg4zM7VZLBbSTdUclbEglVjlXIcuyS8/5yy0tbsIYqfJWB7UXLqoxGGLyBy5cSZOgXFsLC/vThVsEAokWohm47Wz1MFPX8IM7opN6Qe/ipFiIK2qI/gNbNxzoQ82S9t3N0Tu0Gtys862TClJYG/dCC01/USElEJWkhiAnOqzJKGSBf0DBQDFmp1NaZf/+IPzglOICBZK/4DdqEJoCz7aoM8jbcR/ZemMB6qRKBCYjUQH3sGCXnNm7YS+RxeLZ9JaQua/KwAozLifZi5s4NXVvtNNlyb9OScgvR9uTfyaqggl7ZFP/Qelc8Z7AldFXiwecxXC8ZK4a2thKxXBZ/R7h3VAGTEAW578FXQUCMQxwC1Jm3p8BnnmeYOy7KQ/dUInrT5XvSDJ+qVHEA0aaAlSvIfq2KCtWZ8whYHCdvPcr38S4QS8T4My1tJeCi2ojFzLTnPVl7d3qzHKklJ5HztJU/yJvS28b60a8QhiUTxb+zGthFuNy4yaWj4MQMYcu7zb/NlBWwy3NhQ7QDOJjIk7LUM1yzzo07gw7sSBVhdzKnajKhL34dxzOOcmrFhhkD0OaTEh3yY/368O84rQaBeJOsaeJ4zm2LsEVcXTHMA59o8+1d/9eMzdSmUhH2hAQHfwt/GHzCib4XqM2c9dKQbi+J+2SIS2NFUYD5 l/B9xbHl T2RFbkhuyVbmv2mDVIAWVH+plv40spnzA3S6wMzc05BqUZspaSKFF3nLScWkZrK6TCKHnPDtoPYW1PQrXQrQ/v46gLupkPdruIyU61XOc1P9id4lHJbCfyrE+dJNcVybVC5NMWLF/YNBYJDr4Uwpe5O8HV0xhm5RPvIOEgZU0EaeT2/f59ixJLrncfACHKdGuMxqTRu2fyUb1ixtmTxUi/fguLDNLSbZ+lIRwzJP/m3jzCh2gcFppQ5RlHwhQfYnovBegHD2x/2BCaZUBHX/OWCHmhN3yvbuPfgAmyVw0XOVtU4Y= 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: On Wed, Jun 21, 2023 at 09:43:37AM +0200, Peter Zijlstra wrote: > On Tue, Jun 20, 2023 at 05:46:16PM +0300, 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. > > 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). > > > > Would it not be much better to fix the root cause? As per the last time, > there's patches that cure the thp abuse of this. The other case where the IPI can happen is: CPU-0 CPU-1 tlb_remove_table tlb_remove_table_sync_one IPI local_irq_disable gup_fast local_irq_enable So its not only the THP case.