Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp152165rwd; Mon, 12 Jun 2023 11:23:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6kIpVIChjGCtalbjyD5O9WaEjmE3huiP/5dCq87E2JAMQ+i0Yw3ySBicEwOXAEBzh9tThQ X-Received: by 2002:a05:6a00:98f:b0:650:154:8bd with SMTP id u15-20020a056a00098f00b00650015408bdmr13459630pfg.17.1686594184318; Mon, 12 Jun 2023 11:23:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686594184; cv=none; d=google.com; s=arc-20160816; b=B/nOpAWvWYjobYP2dCmc2Agb4ZE6/QhsR6Blky2XnilrqnJ8whe3UgfIuySu2d/LG9 afw3BfBKeGG4Zwx8IVKjB4YH7SEuzTIXaGr3KIPFPSgeyB3pkbYLhxp3q7yX0UoojEyl 7365D2Pezngxww4LWr5VrQc/6/hJ3o0Od/b4trMnaatBVbmAjh8BM5xtGvqOi95L5oBw kZ4+XyehgRLTlYN6iCCJbB77kZ0ptWa1wQi0Zv0RXXIvo01KgaItJnzRbhSr9J9i9Ozu wj8gUIL3zffaZkfRkWeHHXtYRoPRHwRaJIa9H7Z67lvBHzGFdh2BSDuubfVViqLlKlsi wpmg== 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=OyB2HATrYe07EZyc2MwF8RbLQn+UFgKmybbWs9IGAwU=; b=TteX1v8+3xWEmlekFvqCXS/91z0tnZag8BsjQbTUX+bRBvWJ8yZ0OHP5EPXp4h/Cmk FQRKKIdCGmaoovKl9Xtu58NjuklL1EItv2hNh5gB1p66WRnGZEwJBwhv5E7Gnf0kd/mM iMgLNJI6ZzLPXC3ZFSGvjZ1F15Kz1HJznwTUO08kav+JMnmng8wSD1UNqJPMp1OYpbq/ mhy2NjoN5PwCobyEmJH5N8+oCef9kVc8hG358BfyjSX9ZsGgnb0NiR3ryD6tYPrPlcPZ BgUPZArZPMFXLEKqZuiQ6S6kVGfMOhnTvUtNr8oCo/fozBx1Gv2DoT4woZBfr28jlA83 qaLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=MywNV8fX; 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 194-20020a6218cb000000b00660059ccf19si3942924pfy.225.2023.06.12.11.22.50; Mon, 12 Jun 2023 11:23:04 -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=MywNV8fX; 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 S236558AbjFLRye (ORCPT + 99 others); Mon, 12 Jun 2023 13:54:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236691AbjFLRy3 (ORCPT ); Mon, 12 Jun 2023 13:54:29 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D30510E7 for ; Mon, 12 Jun 2023 10:54:13 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-543ae6ce8d1so3193170a12.2 for ; Mon, 12 Jun 2023 10:54:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686592453; x=1689184453; 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=OyB2HATrYe07EZyc2MwF8RbLQn+UFgKmybbWs9IGAwU=; b=MywNV8fXHWlAfDdphSSsN0f4MvLWc/0kHWE8dxMLiZxkJpjRJopoFLoiugeDzOVyoA Jb+4YLDxBH4R7sOPubDpy/zC0pBC3fntcZBvZV3NpqGTi40BKjNdSjNzlNEQzQIpvovW CB6xZaqfU4IrOddgVEn8QSfbpCP8230BKbOhhQ9Gi58cTcxcqhNZ5Zp/N32eIaJK817X 8h5A2xwYoOlg8TY8CfC1K33aD/PqJOobF3kVxBC7INCcFnqz3e9wNNyHkeaI/kSMwDoi Sj2zRkfrSImmLnb5UiYie6xT56qOYxa2ZRwap5HG6x5w+oEmtltFv1BA2/q+g0rgz5BG nk5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686592453; x=1689184453; 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=OyB2HATrYe07EZyc2MwF8RbLQn+UFgKmybbWs9IGAwU=; b=UxDcDy8xpgCcUHRpPbqYLnA9MkB3pbyTWPJiZh+UxLYgpbhK9fYZ02kDQI6qDfV94t aDXe/RTW25Trf/XlQGNtewS6StBt9CStnq1I+vKy+8CJZ8MNlx/W7av7/wtjS8kixF/g 40nybC0+bHEyVmFszVUZFwnOZ7KS/yC2OxxN6XZTU7T6Typ5Tmw6k3VBVynWNYBigQ50 xJy6egUHmX9IE3MmpHCYrErWBAmY+01JyhbcgU/r/M4Zdj0WtJia/1toAf4koF9Qzd6k SkNQHaXzCojxchfQkR1vWpZhW2fHI/Vwd7wK2tiJVvcx5utQ/5PgQ7NPhBuavkgmmZd1 o3ng== X-Gm-Message-State: AC+VfDzZpM7CH5w59UQ5Li9L1kYExu7zSC99Itr0pORTfqd/KcOALgzS PEIuHDI8wWBQOKf8xWFC83c= X-Received: by 2002:a17:902:ea01:b0:1ac:4735:45d7 with SMTP id s1-20020a170902ea0100b001ac473545d7mr8990405plg.6.1686592452544; Mon, 12 Jun 2023 10:54:12 -0700 (PDT) Received: from localhost (dhcp-72-235-13-41.hawaiiantel.net. [72.235.13.41]) by smtp.gmail.com with ESMTPSA id a7-20020a170902ecc700b00198d7b52eefsm8488904plh.257.2023.06.12.10.54.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 10:54:12 -0700 (PDT) Sender: Tejun Heo Date: Mon, 12 Jun 2023 07:54:16 -1000 From: Tejun Heo To: Yuanhan Zhang Cc: jiangshanlai@gmail.com, linux-kernel@vger.kernel.org, pmladek@suse.com, zyhtheonly@yeah.net, zwp10758@gmail.com, tiozhang@didiglobal.com, fuyuanli@didiglobal.com Subject: Re: [PATCH] workqueue: introduce queue_work_cpumask to queue work onto a given cpumask Message-ID: References: <20230606093135.GA9077@didi-ThinkCentre-M930t-N000> 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 Fri, Jun 09, 2023 at 02:28:19PM +0800, Yuanhan Zhang wrote: > // I resend this to put it into the same thread, sorry for the confusion. This got resent quite a few times and I don't know which one to reply to. Just picking the one which seems like the latest. > > Can you elaborate the intended use cases? > > Thanks for your reply! Please let me use myself as an example to explain this. > > In my scenario, I have 7 cpus on my machine (actually it is uma, so > queue_work_node > or using UNBOUND do not works for me), and for some unlucky reasons > there are always some irqs running on cpu 0 and cpu 6, since I'm using arm64 > with irqs tuning into FIFO threads, those threaded irqs are always running on > cpu 0 and 6 too (for affinity). And this would not be fixed easily in > short terms :( > > So in order to help async init for better boot times for my devices, > I'd like to prevent > works from running on cpu 0 and 6. With queue_work_cpumask(), it would be simply > done by: > > ... > cpumask_clear_cpu(0, cpumask); // actually I use sysfs to parse my cpumask > cpumask_clear_cpu(6, cpumask); > queue_work_cpumask(cpumask, my_wq, &my_work->work); > ... But this would require explicit code customization on every call site which doesn't seem ideal given that this is to work around something which is tied to the specific hardware. Wouldn't it be better to add a kernel parameter to further constrain wq_unbound_cpumask? Right now, on boot, it's only determined by isolcpus but it shouldn't be difficult to add a workqueue parameter to further constrain it. Thanks. -- tejun