Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp10942433rwd; Thu, 22 Jun 2023 06:56:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6fTm1wxkDLGoKPeQwyaBpDvgNLsT0hTULantKY3hIJqs25KB2Ht7IYaXKiJfo4NmvlQSql X-Received: by 2002:a92:cac8:0:b0:341:d30d:173e with SMTP id m8-20020a92cac8000000b00341d30d173emr17188074ilq.15.1687442187140; Thu, 22 Jun 2023 06:56:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687442187; cv=none; d=google.com; s=arc-20160816; b=gtIwlkUzGSTGCGhz9dQJQGWubKxXPp8qU1JWlFBzDh08DPyp9NyAsyGz9aaD+v1w1m toS57szTouHTg+90eglFP3friRmDD16P27tur2+jgJGORklyXyIezLYgzhtl/dlYsfy4 fJgmx6Z4kYMjW2bgyZYQMZX++LP4d1L322zZUww2kzpmZdCK28B290aO2DtrWAGKsUsF wU3H3nY9PY0fjVeIcOvOTjCRexnDlKeoivfy8CGkMGNY3putGJHbtwdgaIcrIit4Z8FQ Fz+mnmG65PVxN3jlL2rdqL/QgSZYDMbVs0weHAfu/zmylk1P0qWLyunExR5umezfYR39 stfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=eFmMS1U29te7tFKtgkPWLc+o83wVHmxe900XZpUTdy8=; b=ZtGkJZqUoNtokvdXd6zwkS9iOGieDwgI/qXGiJ5z3kTlrL+9eOsXvBbpruGpdGrk/g UubtgrdOhMHIR7YxsbTD6ghIABVA/lvusyD4bYU9+9Tw8xt8BJOxYhKSlFBLW9kKkHkL KG+OLsBm/K7+JXd2ugJvf/DckNVJO5Q0CRg5W0aNTDWT7MWSUb7upQfZvXLRSgffN+he /LQQkkjXIgysQ0dUtlsi7bDThIsQSipmK+L54nVodHgb4CXOBGh8sbafJF/N4uhwi+pv bxN6J8BCZHejsN9Y16dNHKQIpSW7QyB9+EPaH3acipK5ZZR5xyDPqzcfK1ZCAfCQvEkW iOXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KYQsJetN; 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 m28-20020a637d5c000000b00544059be66bsi5106767pgn.810.2023.06.22.06.56.14; Thu, 22 Jun 2023 06:56:27 -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=KYQsJetN; 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 S230039AbjFVNml (ORCPT + 99 others); Thu, 22 Jun 2023 09:42:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229874AbjFVNmk (ORCPT ); Thu, 22 Jun 2023 09:42:40 -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 4874C1735 for ; Thu, 22 Jun 2023 06:41:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687441314; 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=KYQsJetNVO4CB77BH1qhcrSzLyRnFbjUq87hVEoUpynS/XaVj1X5G7XOtNqw0byEwIsqmo N6Z1eNDOaMKwAkw+OJfxRvGy11+oTdvYqbZu4KND/Dapd0muVW1/NNJQWHto7N8qnbNQeG /A2YJtVns/hp15EEM4TH9vyrbmoldHg= 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-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=ham 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 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.