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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DD9BEEB64D8 for ; Thu, 22 Jun 2023 13:12:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Mime-Version:References:In-Reply-To: Date:Cc:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OXW7erIj6QDJzFDuAVAjwTSxiCRnaLQ7lFSVAjoPjQM=; b=qGrrrE9y2u24uM 0Wwa5fnBtvVRrKBGdcQOUtBfqtIjBtsycmpvtEB6HkHdHxSVmkWato0G3sLUNCVo5YtVN6D07CZzG DBSP7nBB30Rhv0Ko5ASPDltvilFq43of7HlYC+pPPjEN8lqveqnqczyWvzr5MY5wfLXIFD//+H/Hv Y2dltW9YjqgALB4JAnYczJxjatyV2DizSkX3YFcapWBQNtOsj+NQtoUlMm20YJdW8sbVCktPSOtsY /c6BfXJjZ1ClZMAw7RIdJQzC+eCyqfveGb1MxEHrEeVXXvkNr8YHlnx7sgjJhJbLF7OSet4dnqsiy AfHaOXpbo1izUhF/90Zg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qCK6D-000ikk-0a; Thu, 22 Jun 2023 13:11:45 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qCK6A-000iix-1E for linux-arm-kernel@lists.infradead.org; Thu, 22 Jun 2023 13:11:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687439500; 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=sL8itRGmxApUKDOrvea4cRz5mnSUjX/8ZLxFKQlLox8=; b=CLGYB8PI6b4R3Ja0/X/dITVP9zfCpmEHxZYg+ZbdgX79gZVY5007ypxpd3+obrThZJlrRD wuctEKM8wYyPmExS8rzxvvDFH2KVAaucv5HiN9FMN+JdvwwYmEKEayqkZD8G36FkK+bJBn 5n71BY3nNxQBeloGOZmih1Ym6iMvPwo= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-582-8qNYKTYZNmurxDcyocto2A-1; Thu, 22 Jun 2023 09:11:39 -0400 X-MC-Unique: 8qNYKTYZNmurxDcyocto2A-1 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-4f63eed2413so5332175e87.1 for ; Thu, 22 Jun 2023 06:11:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687439496; x=1690031496; 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=sL8itRGmxApUKDOrvea4cRz5mnSUjX/8ZLxFKQlLox8=; b=cLiIAOYsdetD/Lb52+jI5a3fmfALOFyXdTqaSAwcuLyZCe+qlUyTvh6Tp5xdJ8HbcK Sj6Qkb+by/L/am9LhtlmEt8eRG1gegGT8GpZoS8LQtHyynFT18reRmfgGUtbYG2W/aHh tRWSa0Wr0NYQe5guYqycaTq9EYfTGb8MjpmkXZCZBOPtgFwMQHtyY+uC8IazMzM/URlA wwgKcGSlbOZBd81jeLlvsMuXObG4ECIXn1IiQOXHk/Wda4CY63XNpIq5uhU3nCC3UJnm jyBbv8hdTtZ62wKuHXKQ4tlWczfXkh+UQmqIWqYZwz5yye2LViRT0gxnzqmjGwbCzvsJ Wk1w== X-Gm-Message-State: AC+VfDwqEb33d1fhf3XBsuf1VPHemI3UxEKjdBaDfZ0yxRSqBsQ5o4GB z0jEGX65kUJNEK+oxbO7naKRlj+1qodLaHzUK3Z2YFs+eJppyPOjWOFVcK5Dt9kATD2tMNHcXJZ xes8k/zntzuoD6R7fJboTQ0ZwkG08cQ8GxRE= X-Received: by 2002:a19:7710:0:b0:4f8:6800:86f6 with SMTP id s16-20020a197710000000b004f8680086f6mr7663747lfc.49.1687439496650; Thu, 22 Jun 2023 06:11:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6XeMu+ILD2rIWpjmZgWGZlKWI9+Th3UDxS632DqbBLE4GiDliqEnF0ulmrbywCCnR/Rw0JbA== X-Received: by 2002:a19:7710:0:b0:4f8:6800:86f6 with SMTP id s16-20020a197710000000b004f8680086f6mr7663723lfc.49.1687439496259; Thu, 22 Jun 2023 06:11:36 -0700 (PDT) Received: from ypodemsk.tlv.csb (IGLD-84-229-250-192.inter.net.il. [84.229.250.192]) by smtp.gmail.com with ESMTPSA id k37-20020a05600c1ca500b003f9b3829269sm2706502wms.2.2023.06.22.06.11.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 06:11:35 -0700 (PDT) Message-ID: <7a9f193e6fa9db1d5fa0eb4a91927a866909f13c.camel@redhat.com> Subject: Re: [PATCH v2 0/2] send tlb_remove_table_smp_sync IPI only to necessary CPUs From: ypodemsk@redhat.com To: Peter Zijlstra Cc: 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, 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 Date: Thu, 22 Jun 2023 16:11:32 +0300 In-Reply-To: <20230621074337.GF2046280@hirez.programming.kicks-ass.net> References: <20230620144618.125703-1-ypodemsk@redhat.com> <20230621074337.GF2046280@hirez.programming.kicks-ass.net> X-Mailer: Evolution 3.28.5 (3.28.5-22.el8) Mime-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230622_061142_507977_E7229A11 X-CRM114-Status: GOOD ( 25.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 2023-06-21 at 09:43 +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. > Hi Peter, Thanks for your reply. There are two code paths leading to this IPI, one is the thp, But the other is the failure to allocate page in tlb_remove_table, It is the the second path that we are most interested in as it was found to cause interference in a real time process for a client (That system did not have thp). So while curing thp abuses is a good thing, it will not unfortunately solve our root cause. If you have any idea of how to remove the tlb_remove_table_sync_one() usage in the tlb_remove_table()->tlb_remove_table_one() call path -- the usage that's relevant for us -- that would be great. As long as we can't remove that, I'm afraid all we can do is optimize for it to not broadcast an IPI to all CPUs in the system, as done in this patch. Thanks, Yair _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel