Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp9407569rwr; Thu, 11 May 2023 14:40:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ClkRpckaX6kWlV/8UaliK8q+6RSFq6w2sMDvL8cdZUS2hXdsW5XntE4boYjwggw5LMRlo X-Received: by 2002:a17:90a:db8c:b0:24b:52cb:9a31 with SMTP id h12-20020a17090adb8c00b0024b52cb9a31mr31348155pjv.22.1683841203654; Thu, 11 May 2023 14:40:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683841203; cv=none; d=google.com; s=arc-20160816; b=i4cgSKVjzAnPwCUzY3du7ry/BBRa5h51R11pS/6pR42bniR7s+PXVZB1nwNHxqTjUw PqKon+rqod6hv2WyO4Exdc74ytPtR9TWk5Zlq9luwJHbMzf0TFNAUMHDoLgPiw88StU2 bowxPDthSphbnHTJRNXhiPWKxqULwHyCOLqOBuwvU+pzt1QwED6IsKIr8sO6hqjMyMyF RRjF0CyLYS9Bt08S8VW2t8Ow2Y2ruRAMJBrcP+m3zTXe+aH902KDRMv/9NGNK/gqcC3F ibKEEzveM5vC3ATG15RUJ+UorjQOq89/UbA7pjrR/6B4oOtrhmfKrsQvw057sEQeQEZw N2Pg== 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:dkim-signature; bh=m7d/EZDyz9vAqfe7UDdO6jyEpmZlnIBccJBZScC5AWI=; b=en3UYLfzQ90lx+FeRjXMOdOLIfiFYc/mCNN8hsnqgTk3aW44+dxERxLXWGu5ckUO3z ZPWe82Wg4w3P6eG9oduC7wiRy1FyGrrylzWZPhMGbEDt/B+L6K4GA8SfBztMg0BkTjSV 1iV2ZuK8R5vFvX6MqzRt9mdmBl5TVnkSAnHviJQHJdmc7K6zgoXT0Wk1EIvB718RL5YU LlsUGPBmCmHLIZLMwVyPisKaRQBPFSQK6xoZ//3HKhlD20oChaGnAns9KJHvwGP0RCzL CUky3m85kizVPl0/syblID9P5/lJRROLp0dCTXMQ5IapKN+LCYBjgua0AgG8ubAv4QM2 GmIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b="S2ppX/Xx"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bj5-20020a170902850500b001a987371830si7326270plb.120.2023.05.11.14.39.51; Thu, 11 May 2023 14:40:03 -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=@infradead.org header.s=desiato.20200630 header.b="S2ppX/Xx"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239206AbjEKV0f (ORCPT + 99 others); Thu, 11 May 2023 17:26:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232437AbjEKV0e (ORCPT ); Thu, 11 May 2023 17:26:34 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AC696587 for ; Thu, 11 May 2023 14:26:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=m7d/EZDyz9vAqfe7UDdO6jyEpmZlnIBccJBZScC5AWI=; b=S2ppX/Xxbfve592D3dMjbCBJSF gSdEmibX40/741Jr5RvFPh+1V8ko1aTx82h7UobgaAsWo+o8+QB9q64t1gN5XH5n9bMz49tKzV8Wb kb84+JHGT0Vb9UtLDE9S4yA8SyL83NB0vPUOYScL/plE8oxl2utFc+ajqk8JUZrk9XLiapjnHW8xW zvUqpkiGUQ8VhY94RaHQ7LTzV/6dSAuGssHc436eHtJtQCEo/HjkNfazffF5gYP5UsSggP1o6SMIl BbINJ/iX/RHlVLPRlkE6XBPYDXORYG1cYHJqa9z9g0HrpD2iSB/2vuP9NXZ3ukhC9+dQguxM5pDRJ NvC0guvw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pxDnc-008Og4-2g; Thu, 11 May 2023 21:26:11 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 28E27300244; Thu, 11 May 2023 23:26:07 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 0780124829418; Thu, 11 May 2023 23:26:07 +0200 (CEST) Date: Thu, 11 May 2023 23:26:06 +0200 From: Peter Zijlstra To: Tejun Heo Cc: jiangshanlai@gmail.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH 6/7] workqueue: Report work funcs that trigger automatic CPU_INTENSIVE mechanism Message-ID: <20230511212606.GI2296992@hirez.programming.kicks-ass.net> References: <20230511181931.869812-1-tj@kernel.org> <20230511181931.869812-7-tj@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230511181931.869812-7-tj@kernel.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Thu, May 11, 2023 at 08:19:30AM -1000, Tejun Heo wrote: > Workqueue now automatically marks per-cpu work items that hog CPU for too > long as CPU_INTENSIVE, which excludes them from concurrency management and > prevents stalling other concurrency-managed work items. If a work function > keeps running over the thershold, it likely needs to be switched to use an > unbound workqueue. > > This patch adds a debug mechanism which tracks the work functions which > trigger the automatic CPU_INTENSIVE mechanism and report them using > pr_warn() with exponential backoff. > > Signed-off-by: Tejun Heo > Suggested-by: Peter Zijlstra I did do wonder why you chose for external storage for this -- I figured it was to keep the cost down since it shouldn't really be happening, so storage in the normal data structures is a waste etc..? Otherwise seems fine; thanks!