Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2283989rwr; Fri, 28 Apr 2023 08:22:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ap+m0k22Qtb2OEsYwI9IoJqZ0SunMIfoCJezDw3eYM7B2cz/uQss84EHm0DF7TyT80Avc X-Received: by 2002:a05:6a20:3952:b0:f2:535d:9a4f with SMTP id r18-20020a056a20395200b000f2535d9a4fmr7417643pzg.33.1682695362983; Fri, 28 Apr 2023 08:22:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682695362; cv=none; d=google.com; s=arc-20160816; b=Il5cR/nPt8J6UQKW7VsXN0KT8WRqpgyZvTahxP0RuPixj7F+wJ2Ewx+cE/x5HRVYcr 6HF6Lzx4uHfWRfZX9p58W7m5AfAMk95MbQkGKgGHF65Egp9oI/OJQW6+ANcRHiXJYvsL ky/26zpW8dcg1ha3ebeMP/OxBMnx3IVvCckuXdkncze15v7Wt1SvhBEQGIfCG2R6UdWS GoGod9FVruE4kwAsvt770UNRUdOdwvxyrUuIJfrnKU3YgafMIJ/4+xNTd9FW3D8w/HHX zlA3wwQAps/DopMmJo3nVV4kCtNbZ7y7fGhyO+iKbrBJpeS4DYLRo2JxbQGx6WGDyIo/ KLOA== 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=uc6SVgjQVy/8xdDmpqE6kegdWc2XYcBn7ME2NMVrIWg=; b=Lbq7On9kiBBnYtSJwxP3FgH/Os+iGh1VcUR4aZ9OJ2Bo64izaaODE2Q6TjC77oCIm5 4oZJg/sPufdUZLyMNsd6mfMP/AGQEFhzBcFbWecQ2/NXj8X4L09TPrQPbx+/A4HbI1yJ gghjq8wnZ9tCiHuILU93VbEvrB5FnHQF7FS1YvpL7ywZtTXrcij59fBxnmvtYNUP0zn6 l1kpZbLwFpWvotnQYfKzcJbVjfhn6zFn98Mp8MTtUgpIhQsOJozYBWe9Cxdm29pXTnGn BQ7f0e655q1BhdXDgM3S7FxvlpKCcmme1gX8HIXmXFwuTkclEVhDStdTz0GmnQnYSkzP EuCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=a2wQcCSz; 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 q9-20020a632a09000000b00524f1f0d020si17014853pgq.465.2023.04.28.08.22.28; Fri, 28 Apr 2023 08:22:42 -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=a2wQcCSz; 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 S1345949AbjD1PT2 (ORCPT + 99 others); Fri, 28 Apr 2023 11:19:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbjD1PTZ (ORCPT ); Fri, 28 Apr 2023 11:19:25 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F8FD559F for ; Fri, 28 Apr 2023 08:19:25 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1a92513abebso654845ad.2 for ; Fri, 28 Apr 2023 08:19:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682695165; x=1685287165; 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=uc6SVgjQVy/8xdDmpqE6kegdWc2XYcBn7ME2NMVrIWg=; b=a2wQcCSzJiPV6HLT5OJe0dVPUYI8Gp/tKxtd34p+7dwTrPOe9YQf5HbEYpT8Ww1Kot j8r6LIiaBBa5egkwwkWxG6RDsIfc+/f8BNe5dpNw6a8LBOs+UkiIsbWHTH+O5n/8GJjV 2jPvoOTj8CVAeWgkXROOO1oAEqQJrcNIjXG6qKw5625/c2EJLk5sUgLvV0IUq3vkXT8q PXfhfGkGEF2dj51VOShoMbTPW9WubD9RVl5unUt0+hsmDhCYwlCDuuBcXuEg9ugORrbj BVASkxZCltbuQXj6VI8/ya9MaoHC8kaxrYSO/e1I55+WF03+eJAV2Y3PG58vkrj7kBJD QUog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682695165; x=1685287165; 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=uc6SVgjQVy/8xdDmpqE6kegdWc2XYcBn7ME2NMVrIWg=; b=c0Q/U3cYneBbtINNbg69GD2+KPBAvSwJwOPUKaF/m4fthqzIBNvdtr7H+y4iX2MT0x QxDuUhWzPsWQUU3BaOq0zr9rYUQyORlKyfcnLNm23DkLTcO+jgIc2zdkfvc2sS9uB1wQ vNQZGHQBP2T5SnovM6tQBk83Nfnysxv1zLiFK4GBIzZViXl+82ok4lQuDbBiIkil2liv CI6PPOT6uIhwjKKAJX+RD4ZvcWjlleO/IQ5uHYh9JCJCVc9chVlKLOkO20drvHgaV6/6 l+Q87iJQy3MJgwV42YP7oa0Gzc6UPiXu4Eo3GhSiT3fiC8NKZ2F0KAkw6zm8SVfCkIhG D2cA== X-Gm-Message-State: AC+VfDzOEYRu3K6fSiQ5GOVMPA9nktp3HDq05ydb6oprS6drxiiQtSZi 2jKI1el8BK7Jp1ER1kuzmDk= X-Received: by 2002:a17:902:f681:b0:1a9:736a:5251 with SMTP id l1-20020a170902f68100b001a9736a5251mr6464854plg.16.1682695164211; Fri, 28 Apr 2023 08:19:24 -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 io13-20020a17090312cd00b001a212a93295sm1505828plb.189.2023.04.28.08.19.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Apr 2023 08:19:23 -0700 (PDT) Sender: Tejun Heo Date: Fri, 28 Apr 2023 05:19:21 -1000 From: Tejun Heo To: Peter Zijlstra Cc: jiangshanlai@gmail.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH 4/5] workqueue: Automatically mark CPU-hogging work items CPU_INTENSIVE Message-ID: References: <20230418205159.724789-1-tj@kernel.org> <20230418205159.724789-5-tj@kernel.org> <20230425131254.GF1335080@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230425131254.GF1335080@hirez.programming.kicks-ass.net> 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, Peter. On Tue, Apr 25, 2023 at 03:12:54PM +0200, Peter Zijlstra wrote: > On Tue, Apr 18, 2023 at 10:51:58AM -1000, Tejun Heo wrote: > > If a per-cpu work item hogs the CPU, it can prevent other work items from > > starting through concurrency management. A per-cpu workqueue which intends > > to host such CPU-hogging work items can choose to not participate in > > concurrency management by setting %WQ_CPU_INTENSIVE; however, this can be > > error-prone and difficult to debug when missed. > > Well; you could use this very heuristic, and instead of silently trying > to fix up, complain about the missing CPU_INTENSIVE thing. ... > But why not keep it a debug mechanism? Now you're got a heuristic with > all the down-sides that they bring. I'm working on improving the locality of unbound workqueues and it isn't clear whether there's enough space for per-cpu CPU_INTENSIVE work items - ie. if it's gonna saturate the CPU for extended periods of time to the point of requiring CPU_INTENSIVE, it might as well be an unbound work item if the baseline locality can be good enough. There aren't that many users of CPU_INTENSIVE in tree and we can decide based on how unbound workqueues actually work out for them. As for warnings, yeah, that'd be great to have regardless of how CPU_INTENSIVE turns out. Just gotta make sure it doesn't fire spuriously and become a nuisance. Thanks. -- tejun