Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp466093rdb; Thu, 21 Dec 2023 15:01:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2JIHWvc9SEGJ+CLvZzDa110RaUYfs/HCaPwhK10//1Kd0Hz/pFf7IMuwiS6O9uSFcEtpc X-Received: by 2002:ac8:5dd3:0:b0:425:a84d:bccc with SMTP id e19-20020ac85dd3000000b00425a84dbcccmr400140qtx.137.1703199709489; Thu, 21 Dec 2023 15:01:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703199709; cv=none; d=google.com; s=arc-20160816; b=JZ78Y/3q2zq03WZPvL7Tm8mZ0Lb1lO9v7pWEjwNdnipGsc7JiEhiHO0VnpuDaw3HPO QdOVYtGZ+FvKAe/JyZ29hVUhcXs2AojqHD/RV+5bDtu2Tuoj5wELMDAFJsIdW9VXxVec 6xTdPUYVudsV4NiCJQlqzL9snJMtxUi1lXQYRheCx94xoReDbq59nhmsoA6JzfRtK9qv YrO9P9hBK52dvtZUhCX9Feqk818vwVvF5AqyV+vnAg8O7iBFYIcipd4A9PS4ryLCNlCD LR26rnTGI930tCQd83VgOBvMCLECzLWmy/8Gus8y6n/yyi6vZsMX/Mcz8Gbu3JTKYdu2 ILng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:sender:dkim-signature; bh=OsE9gBhCKxjgSiOjZ4BBKtBS0Fenb9nkFdDn3mvQjNM=; fh=TXYzuIld3ZUQeXPpec9E/mX9DSWP5fA80EZAZ3xe2Wo=; b=IP+kLw4qC4VV0Uyk2XNVQWfOSDWUoeBoKqjCvzXLHU0/L8xn+dc8AmhgxG4zuAI3wO 4sDpC3Ivr3VqM9s2blI5LGgkoTTiytDu8yUxwzPczQlKN81yD1408AbNxC8u05ZM0K5t QtbsGHE1wFJdgwxGPleoAp2MFcSx5qwYv7v9N2QMwRHhchRe/BKdE8xRDe0LOM4Bv3HM bKG/drPa9mIVIfAiKJ06+t2TFSdqPee9h0xU0f50unsPXsraUPJHYiOCNzrrL3yxRzfq TpGHTq1cpORgK2LgOwhH57qE232VX1mzek+qLpH11eYRklDSjBKJ4unoc06q1a6M9AZa 4OFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Pw0LhJ8Y; spf=pass (google.com: domain of linux-kernel+bounces-9145-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9145-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id k15-20020ac85fcf000000b0042583d67e55si3127144qta.390.2023.12.21.15.01.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 15:01:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9145-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Pw0LhJ8Y; spf=pass (google.com: domain of linux-kernel+bounces-9145-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9145-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4290C1C23CF8 for ; Thu, 21 Dec 2023 23:01:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E7C378E94; Thu, 21 Dec 2023 23:01:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Pw0LhJ8Y" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86D7D78E7F for ; Thu, 21 Dec 2023 23:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1d0c4d84bf6so9549575ad.1 for ; Thu, 21 Dec 2023 15:01:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703199700; x=1703804500; darn=vger.kernel.org; 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=OsE9gBhCKxjgSiOjZ4BBKtBS0Fenb9nkFdDn3mvQjNM=; b=Pw0LhJ8YFi93VWbdYC0yLUVTgKDyGVYdCVUyAJeCC7Bhz3g3OoLpJlwcZncFlNH1Sb ZwkpdtwiweXBRD+eTuHENug0Z9mov07R8Sq4nzUQoVugAxF+bedt9PiXZne/5X7Ol926 NCbg1qliIjEeJ9UNUmLRWQov3L1wvlThMx2FiaWcXJMa1IOQ5EfgtNqKEzznA6m8AAvR b0VHnvND741TArQMeU7tX3yk1EpsJ3Xp5LMWerWauvpjzzaJ0TBr7DLhtBPhPjMk8xZU SwDS2HCwhBhxXzoGlEc7FIH024m1cD/ydHfZhNNfoauKQj+4ABKMIWURtO8/s4PTMhwm G/RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703199700; x=1703804500; 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=OsE9gBhCKxjgSiOjZ4BBKtBS0Fenb9nkFdDn3mvQjNM=; b=q98P5fXB6OWgvXkv+Uu+RxQ6pP/pH6jBXGG8DwI7wRDAFMD9bph8jy3U4XnqsSu+sF MHzvVj+IHBShlKNREPS08cpREiKSozX0GRbHHJoQnkxyUvbaeSs7zPBsBllIqo6jKsL1 DL4zDEoqM47m/5eMyk/+PJ5TkEX4dzRCKdy/BbcRItZt8nH6+n8wi+Dm64+iXyCXBrKE D30BInhwXiSZ2IDjRcgjOFVjerjiYpcwfr8IiE5oRXTUZR2n8+NTNd7vgkxv/igQ89BS TqdQGaU5w541Yo1tFnMSwu9UE7pp6uJBUeMSkhMu8Of75FqCbx0E31agWic/x+6ZbGYg rCRg== X-Gm-Message-State: AOJu0YzpomC9IfYpIH0diQ/sVv6K3MWPFxgoP/50B9ley/evzUAF0pp8 Mxqgap6rPR4u6HjvvMXmnJo= X-Received: by 2002:a17:902:eb89:b0:1d0:acfc:a662 with SMTP id q9-20020a170902eb8900b001d0acfca662mr290795plg.123.1703199699632; Thu, 21 Dec 2023 15:01:39 -0800 (PST) Received: from localhost ([121.167.227.144]) by smtp.gmail.com with ESMTPSA id ju22-20020a170903429600b001d1cd7e4acesm2180088plb.68.2023.12.21.15.01.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 15:01:38 -0800 (PST) Sender: Tejun Heo Date: Fri, 22 Dec 2023 08:01:35 +0900 From: Tejun Heo To: Lai Jiangshan Cc: linux-kernel@vger.kernel.org, Naohiro.Aota@wdc.com, kernel-team@meta.com Subject: Re: [PATCHSET wq/for-6.8] workqueue: Implement system-wide max_active for unbound workqueues Message-ID: References: <20231220072529.1036099-1-tj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hello, Lai. On Wed, Dec 20, 2023 at 05:20:18PM +0800, Lai Jiangshan wrote: > The patchset seems complicated to me. For me, reverting a bit to the behavior > of 636b927eba5b ("workqueue: Make unbound workqueues to use per-cpu > pool_workqueues"), like the following code (untested, just for showing > the idea), > seems simpler. > > max_active will have the same behavior as before if the wq is configured > with WQ_AFFN_NUMA. For WQ_AFFN_{CPU|SMT|CACHE}, the problem > isn't fixed. Yeah, it is complicated but the complications come from the fact that the domain we count nr_active can't match the worker_pools, and that's because unbound workqueue behavior is noticeably worse if we let them roam across L3 boundaries on modern processors with multiple chiplets or otherwise segmented L3 caches. We need WQ_AFFN_CACHE to behave well on these chips and max_active enforcement breaks if we keep them tied to pool in such cases, so I'm afraid our hands are tied here. The hardware has changed and we have to adapt to it. In this case, that comes at the cost of extra complexity to divorce max_active enforcement domain from worker_pool boundaries. Thanks. -- tejun