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 X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CF4CC47094 for ; Tue, 8 Jun 2021 02:13:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D029D6108C for ; Tue, 8 Jun 2021 02:13:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D029D6108C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4AD1E6B006C; Mon, 7 Jun 2021 22:13:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 45D0F6B006E; Mon, 7 Jun 2021 22:13:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2FE2E6B0070; Mon, 7 Jun 2021 22:13:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0096.hostedemail.com [216.40.44.96]) by kanga.kvack.org (Postfix) with ESMTP id ED3E36B006C for ; Mon, 7 Jun 2021 22:13:51 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 88AB96D96 for ; Tue, 8 Jun 2021 02:13:51 +0000 (UTC) X-FDA: 78228935862.18.60907B9 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by imf25.hostedemail.com (Postfix) with ESMTP id DE7CF6000144 for ; Tue, 8 Jun 2021 02:13:48 +0000 (UTC) Received: by mail-pl1-f174.google.com with SMTP id 11so9768132plk.12 for ; Mon, 07 Jun 2021 19:13:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=GN9OGsGoM5q2Wj6TkWBVaSNZ3ULcmdL6q8p7m1JsxfU=; b=KAKRqeqM/EnW/4UM54P+A9EJlb7HswqJaBECriEWn06A6AuPmgEhw53v2jNqs2UbU8 +ipemHkdCeJ7hZf8DGPXqrGtSQiaUtrrBKnBPdJgYjyVozFXY41ptb5hYLJGLFvhNTev ewFaadk+5/gEhStXYpHg6FCtpMK8RgPstlt/1eAppeKlIpE6yPI9Bb4/UIxrHHPu8c2w X5/UbsWQsJ4ttdYqBvk9F53mVXHLXCMepOcCypsou/dkksQrag3RLdK7s6a5G5G5JjOS lXcVAZaZzBjqUyLDv8FhAI9Arq44OUf5eOICCTpZBJt15aYY9+zUAww9XM7MKW8Xp3eo AhGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=GN9OGsGoM5q2Wj6TkWBVaSNZ3ULcmdL6q8p7m1JsxfU=; b=B05ZmLAnrYzVKXgGdJwFIOSW7Q+CvEzd6O+uzmxN2JuI+t8ed31nXLLe7jN63L3jsq D4WNXR5dIFFzJ/glhzanoe2H2nEBS+GDSh0Ubn9SqYH7YARfbUkSlCUazgDwBwjX7Js3 42xLFc2EzM2afbtHUDsRNEHU418j9Qyb+I+MKEgXcZIdAwoD7QEXTtjvK/wvcRiwu4+S 3+MseKDv+jCb/CR4IsvC+T4TpGdnFDE/0aETKQKumHW+83bAhd3HA3rzC3C0iKX5lG/y O3rslGFTh6IkCGr0DDARYLwXVa4wVqGKD1KOJPD2xmvP4u650AF7X/3KoxCrzzlGB2yY UR0w== X-Gm-Message-State: AOAM531QGRlxwdfXhvztr7YH0oOViMwMVT4EknI/2tnFdN8aPskaCFjL 6IoRCPnMP+++VmqUOZDsncQ= X-Google-Smtp-Source: ABdhPJwZostydn6bgzgZ5hc0R5uUZONrVbm87sBVNdPt/3RpSMRkRRnU2eGY1TzJGbBSLvRxXRgFUA== X-Received: by 2002:a17:90a:ff12:: with SMTP id ce18mr23452289pjb.215.1623118430063; Mon, 07 Jun 2021 19:13:50 -0700 (PDT) Received: from localhost (60-242-147-73.tpgi.com.au. [60.242.147.73]) by smtp.gmail.com with ESMTPSA id r92sm637379pja.6.2021.06.07.19.13.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 19:13:49 -0700 (PDT) Date: Tue, 08 Jun 2021 12:13:44 +1000 From: Nicholas Piggin Subject: Re: [PATCH v4 4/4] powerpc/64s: enable MMU_LAZY_TLB_SHOOTDOWN To: Andrew Morton Cc: Anton Blanchard , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, Andy Lutomirski , Randy Dunlap , Rik van Riel References: <20210605014216.446867-1-npiggin@gmail.com> <20210605014216.446867-5-npiggin@gmail.com> <20210607165241.4dcd4cf63f96437c5650d179@linux-foundation.org> In-Reply-To: <20210607165241.4dcd4cf63f96437c5650d179@linux-foundation.org> MIME-Version: 1.0 Message-Id: <1623116405.kj57caxq27.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=KAKRqeqM; spf=pass (imf25.hostedemail.com: domain of npiggin@gmail.com designates 209.85.214.174 as permitted sender) smtp.mailfrom=npiggin@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: DE7CF6000144 X-Stat-Signature: txg1dy3euq35pzzmcw43rpy8uiunojfo X-HE-Tag: 1623118428-769516 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: Excerpts from Andrew Morton's message of June 8, 2021 9:52 am: > On Sat, 5 Jun 2021 11:42:16 +1000 Nicholas Piggin wr= ote: >=20 >> On a 16-socket 192-core POWER8 system, a context switching benchmark >> with as many software threads as CPUs (so each switch will go in and >> out of idle), upstream can achieve a rate of about 1 million context >> switches per second. After this patch it goes up to 118 million. >=20 > Nice. Do we have a feel for the benefit on any real-world workloads? Not really unfortunately. I think it's always been a "known" cacheline, it just showed up badly on will-it-scale tests recently when Anton was doing a sweep of low hanging scalability issues on big systems. We have some very big systems running certain in-memory databases that=20 get into very high contention conditions on mutexes that push context switch rates right up and with idle times pretty high, which would get a lot of parallel context switching between user and idle thread, we might be getting a bit of this contention there. It's not something at the top of profiles though. And on multi-threaded workloads like this, the normal refcounting of the user mm still has fundmaental contention. It's tricky to get the change tested on these workloads (machine time is very limited and I can't drive the software). I suspect it could also show in things that do high net or disk IO rates (enough to need a lot of cores), and do some user processing steps along the way. You'd potentially get a lot of idle switching. >=20 > Could any other architectures benefit from these changes? >=20 The cacheline is going to bounce in the same situations on other archs,=20 so I would say yes. Rik at one stage had some patches to try avoid it for x86 some years ago, I don't know what happened to those. The way powerpc has to maintain mm_cpumask for its TLB flushing makes it relatively easy to do this shootdown, and we decided the additional IPIs were less of a concern than the bouncing. Others have different concerns, but I tried to make it generic and add comments explaining what other archs can do, or possibly different ways it might be achieved. Thanks, Nick