Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7797610rwr; Wed, 10 May 2023 12:48:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ44+LvXhZjFiP5JdAFRnQpxwv4nZttEjoqn2ozh+hqiEPX04v0QnobMDHL/exnysSLHYEh9 X-Received: by 2002:a05:6a20:8e09:b0:100:9eff:9b95 with SMTP id y9-20020a056a208e0900b001009eff9b95mr14698904pzj.18.1683748108951; Wed, 10 May 2023 12:48:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683748108; cv=none; d=google.com; s=arc-20160816; b=zUd+ChjJkpfnlSlHehIuEAsYWO4XqkO4OzWJPHKBjALbMivailHfAhjboyxRhTnXZ+ m14OEnCzOeLhwo2RmR9sdsplZ2IFXQe+MzPgJ8DuJmSHnZbQNShZ6lnov6Wmc5HBzUiq koy2+VZ8bXqLquqZpEJm2sFF58G1QTBq59tjHMhWhnXqilAvZd1P6z3BmsJC2EOBGPJc 7xS0qjvtcoZq654uGQfvvaE10mWU9mHXTbn0VZOaIpXJVcB8bo4N91hS0QZQSU6Lbc84 oRnNaMG8P2lPCHB4Cm26Zc0nMPQCJuxE4fJqDrHpG+o4/9/TacrJi0H3ebOXVdaysx8m pkCQ== 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:sender:dkim-signature; bh=vdKoW9P2jhBRnfmfNK6oFRBXOmfqdpLVW/L7FZNRlBQ=; b=KDW53Hfxuy5UIlsa0cHpwIkW6ny+Ipt/cCLRHO/OIoKOvD4VDdZj2NbwCe4CLx6Znw czj/IctTS9B7hBzwQMJ1+9UrZ/kUll4ljTII7ItN9y937lBhEroqPnXAp+NCz3skH5F8 9LeY+aAVRg8U+Ii0I3JrHYMceOcClXMC5aKYN1BzJuXbtQFZ1G9SZrv9eZw2cxg0bc+6 FibmPI6aE1GhuBLjL6+CG69kfMGpdOWf2KTsF6a4V+J2XFL4mXNC8XkPHe81TZfAVO68 XFC7IcnsmxUrTEHROo5ehjpIuWpBuetabIkbe6+/xVNxdtFyxwSS9cYSYPTV+L0u2klB MM3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=RPF5HXOj; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m15-20020a638c0f000000b0051bb433f5d3si4697389pgd.862.2023.05.10.12.48.11; Wed, 10 May 2023 12:48:28 -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=@gmail.com header.s=20221208 header.b=RPF5HXOj; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236036AbjEJTTY (ORCPT + 99 others); Wed, 10 May 2023 15:19:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230200AbjEJTTX (ORCPT ); Wed, 10 May 2023 15:19:23 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB78F5255; Wed, 10 May 2023 12:19:22 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6439e6f5a33so4431114b3a.2; Wed, 10 May 2023 12:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683746362; x=1686338362; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=vdKoW9P2jhBRnfmfNK6oFRBXOmfqdpLVW/L7FZNRlBQ=; b=RPF5HXOjB1S+X34THeUgO74GhOevm4XKHWyln3kcxR64HMWwEYRMAiv1yihOGbxoOY V68pDwIC6StEtl85K2ZEvsrtryxcSaTDq5fB5gSK849T/Y7nrVESXimWoInf04t8SqQD ugZEhVj6IAhE+5df0H8ElTx8vUhoxXLjstdOUdEU7cauKmrKgeTbrivxOxCsPsEfBubs x+FOeiipp2XiYXuLQYlRkHnh4BBDzK6Vu/WgbUE7LcLq3l+nGqvR9k51fhCDko5r2jXB eismONkkFymXXp6+VZy7E5uNPwWetYXO+8CJH1GRfWeAjDlA2QpJqHAFcJKfMR3E+tPf 4NGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683746362; x=1686338362; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vdKoW9P2jhBRnfmfNK6oFRBXOmfqdpLVW/L7FZNRlBQ=; b=EXUAkhoqi4SJ62AAhcKaKGnhCJn2dwP/sl8mxIkiaPAvCxc8xMaFLJQqMC912l9V5I Xsx7XOdYzDdLFZu2NWJMmDtMjaOq2OanC20IhznRy4SUN+89O5vuvz411qp5dSWpfrrP IqaD0B4SbjjSFiE+SP3Jp9sB5253VkNHfhhTNygXP+mkDvEtqC90uJ87BfvsKnC3HBUq kJ9QGZuM47H0lWTXtRJBl9v9beOPfll9v05rjSltnCOmPJEnQ46C/MtEaGK2UD+H/cMP o11pqTuhCR/WN50H054ehBKGNOOeIJitYlVuizlvgjqAqQaTkvJQyLFpFKv45Fu6UiSX h80A== X-Gm-Message-State: AC+VfDy5WZo2gr1VLfwDWNyY3GrhRu4p6LGV6dpWDFcyzE5K4UC8EP4r vNhUu5Kn1AuQe26d7x5SU5o= X-Received: by 2002:a05:6a00:248d:b0:63a:8f4c:8be1 with SMTP id c13-20020a056a00248d00b0063a8f4c8be1mr27949390pfv.10.1683746362066; Wed, 10 May 2023 12:19:22 -0700 (PDT) Received: from localhost (2603-800c-1a02-1bae-a7fa-157f-969a-4cde.res6.spectrum.com. [2603:800c:1a02:1bae:a7fa:157f:969a:4cde]) by smtp.gmail.com with ESMTPSA id n22-20020aa79056000000b0063d24fcc2b7sm3918870pfo.1.2023.05.10.12.19.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 May 2023 12:19:21 -0700 (PDT) Sender: Tejun Heo Date: Wed, 10 May 2023 09:19:20 -1000 From: Tejun Heo To: Brian Norris Cc: jiangshanlai@gmail.com, linux-kernel@vger.kernel.org, kernel-team@meta.com, Amitkumar Karwar , Ganapathi Bhat , Sharvari Harisangam , Xinming Hu , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Pin-yen Lin Subject: Re: [PATCH 02/13] wifi: mwifiex: Use default @max_active for workqueues Message-ID: References: <20230509015032.3768622-1-tj@kernel.org> <20230509015032.3768622-3-tj@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hello, On Wed, May 10, 2023 at 11:57:41AM -0700, Brian Norris wrote: > Test case: iperf TCP RX (i.e., hits "MWIFIEX_RX_WORK_QUEUE" a lot) at > some of the higher (VHT 80 MHz) data rates. > > Hardware: Mediatek MT8173 2xA53 (little) + 2xA72 (big) CPU > (I'm not familiar with its cache details) > + > Marvell SD8897 SDIO WiFi (mwifiex_sdio) Yeah, we had multiple of similar cases on, what I think are, similar configurations, which is why I'm working on improving workqueue locality. > We're looking at a major regression from our 4.19 kernel to a 5.15 > kernel (yeah, that's downstream reality). So far, we've found that > performance is: That's curious. 4.19 is old but I scanned the history and there's nothing which can cause that kind of perf regression for unbound workqueues between 4.19 and 5.15. > (1) much better (nearly the same as 4.19) if we add WQ_SYSFS and pin the > work queue to one CPU (doesn't really matter which CPU, as long as it's > not the one loaded with IRQ(?) work) > > (2) moderately better if we pin the CPU frequency (e.g., "performance" > cpufreq governor instead of "schedutil") > > (3) moderately better (not quite as good as (2)) if we switch a > kthread_worker and don't pin anything. Hmm... so it's not just workqueue. > We tried (2) because we saw a lot more CPU migration on kernel 5.15 > (work moves across all 4 CPUs throughout the run; on kernel 4.19 it > mostly switched between 2 CPUs). Workqueue can contribute to this but it seems more likely that scheduling changes are also part of the story. > We tried (3) suspecting some kind of EAS issue (instead of distributing > our workload onto 4 different kworkers, our work (and therefore our load > calculation) is mostly confined to a single kernel thread). But it still > seems like our issues are more than "just" EAS / cpufreq issues, since > (2) and (3) aren't as good as (1). > > NB: there weren't many relevant mwifiex or MTK-SDIO changes in this > range. > > So we're still investigating a few other areas, but it does seem like > "locality" (in some sense of the word) is relevant. We'd probably be > open to testing any patches you have, although it's likely we'd have the > easiest time if we can port those to 5.15. We're constantly working on > getting good upstream support for Chromebook chips, but ARM SoC reality > is that it still varies a lot as to how much works upstream on any given > system. I should be able to post the patchset later today or tomorrow. It comes with sysfs knobs to control affinity scopes and strictness, so hopefully you should be able to find the configuration that works without too much difficulty. Thanks. -- tejun