Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp4153163rwb; Tue, 16 Aug 2022 15:53:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR5ujSXYann1dgJek9thv75UJGRRrRa0yAYtA8pH40Hfx7ysNMhRoejRUw6vpQsXVYWCUlVB X-Received: by 2002:a17:90a:9486:b0:1fa:ac31:3fdc with SMTP id s6-20020a17090a948600b001faac313fdcmr810428pjo.234.1660690384667; Tue, 16 Aug 2022 15:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660690384; cv=none; d=google.com; s=arc-20160816; b=FRfLMDYTyd4eWOIVaivmJSQPa/uPXLH6fuWwmMeLWmZZSwipQKwaSA9c0lj0tVHzYh GE6myN658kLgY38veMQZXhI84UZLYQJxldPNXQnK992Qhm1tqvHpl2+ekOQUBjOLKTeb 8d0D0ifDPnLtFISqHPBdIdVSMLQ7C2rcKoMpqbF147HSjW2JEVe/MZGcX7DpWHvYEOQi 57VfTYSujsUhYSqLotmrV6ahd+5zAG8EEBH6JRw+NFzia5Y5CinoxgURLbxK88ocEcBp pyRSUr1+jVPq2/wkPYnpBoLhrqvtDBSAs+NW5Q9blSEAd+fA/2EsoLHacyU4673hy52m 0y0w== 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=Xy5yxh/I32wlGw5oKAxZXq3yjkNZl4S3110U7/IRHRY=; b=XeTWoONQ7f0FHUwA4dxkxivfVzRoU7B73XUd42bT6AAORPe1zTSLl9gtjMLKbWMH6n nAfcMyBJfFSQ5GgGEBOh8rfVJ3Y+xjSbT17mmcjI5fsAjI0tH909H9qFClHxmUmmkiaF EaILaadPC30Vcetq1d6xdQ+KHj0RsDVuYEO1r7cyvzJb03es+RicmWJeazRrHiBAQFmo usAT401q5u3GLSwZIQHBKciX43M5dwKlddPNMo+NVB+VRkR4O/81WdwGKs2fb6Cnmak6 uaap87khuomq8Mah0VC/YSCl6u5IlHCoM1YYzb0DtsdL9NcK+ddfAn451A+VWBImv+gq wLUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kL9Tid3T; 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 w12-20020a63b74c000000b004161e72a055si16246531pgt.310.2022.08.16.15.52.54; Tue, 16 Aug 2022 15:53: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=20210112 header.b=kL9Tid3T; 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 S237861AbiHPWJF (ORCPT + 99 others); Tue, 16 Aug 2022 18:09:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237848AbiHPWIz (ORCPT ); Tue, 16 Aug 2022 18:08:55 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 925CC4BA55 for ; Tue, 16 Aug 2022 15:08:49 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id s31-20020a17090a2f2200b001faaf9d92easo134065pjd.3 for ; Tue, 16 Aug 2022 15:08:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc; bh=Xy5yxh/I32wlGw5oKAxZXq3yjkNZl4S3110U7/IRHRY=; b=kL9Tid3TvpH+rvEDopq2GJcBPo8qrV7hNo7JG77jrEcvwdGudFYB8+z1TZ81V1TX+j RODXvkYxbAiaWw8s1uwBvSsXfTp4X7kzSkmYtCjZHtVDmJfcKC0RNN/4lZ88tZOxKmfE oWapAVbTPGJ1OtVcFq22cy3xJY/jSQwqNgWLU352COjHBqm50FT7EKABMiRG6ndRMrsB 0i4Q+MM5uI7UA2KasjwFXn4qyULzsKEcECxU1BC3kCUP+do8KYF1xh2hs5XjBhTieIrg 7+119ejQNEfntNvQxGYWqYDNA9whMwQUPAKyoeo99zWcBZMZZTnSqPJsclEAnjf1JELe /QEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc; bh=Xy5yxh/I32wlGw5oKAxZXq3yjkNZl4S3110U7/IRHRY=; b=cffmr7IfxR0WzYRi6KfN1ylJuQ6g0fTabYguyyst7SwR10qWTu07BgRCuVof5UGEUX mK99FlvEYbqp2h7iOfJMpCWKO9+wXq/6DcAjhGrAmgkduvILQFFvF1k5mIwc8BAviIgh bgW3njXgAWfdFybPNRjNjEHuZqbKB/3JFQk5R3kaRZ5Aw3A2LxN73uA2MkusLLOA9DZx jMR4nQi+j3NrUUhxZ6tukPz/ZJsNTqr8WEmKB1szWBiLJUq9ixO7IuBWdVKUpEDMowsM 0kZWFaoK85dhlALYjw1OGCLejvhpuRrsc586jbWit8wX35OZgOyEHZfOczR5YbS4mHWx qawQ== X-Gm-Message-State: ACgBeo3/SjGhTlMrR2sQ86n2FKwi3CkI0azVu54Q5x7kBV/1zLZbJwXW 1eHmQbWE86nY57zVE28zjAIFiHX3tf4= X-Received: by 2002:a17:902:d2c8:b0:16e:ea4e:36e0 with SMTP id n8-20020a170902d2c800b0016eea4e36e0mr23994315plc.37.1660687727814; Tue, 16 Aug 2022 15:08:47 -0700 (PDT) Received: from localhost ([2620:10d:c090:400::5:7229]) by smtp.gmail.com with ESMTPSA id fh23-20020a17090b035700b001fab11cbc5esm29469pjb.43.2022.08.16.15.08.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Aug 2022 15:08:46 -0700 (PDT) Sender: Tejun Heo Date: Tue, 16 Aug 2022 12:08:45 -1000 From: Tejun Heo To: Lai Jiangshan Cc: linux-kernel@vger.kernel.org, Lai Jiangshan Subject: Re: [RFC PATCH 7/8] workqueue: Remove the outer loop in maybe_create_worker() Message-ID: References: <20220804084135.92425-1-jiangshanlai@gmail.com> <20220804084135.92425-8-jiangshanlai@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220804084135.92425-8-jiangshanlai@gmail.com> 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 On Thu, Aug 04, 2022 at 04:41:34PM +0800, Lai Jiangshan wrote: > worker_thread() always does the recheck after getting the manager role, > so the recheck in the maybe_create_worker() is unneeded and is removed. So, before if multiple workers need to be created, a single manager would create them all. After, we'd end up daisy chaining, right? One manager creates one worker and goes to process one work item. The new worker wakes up and becomes the manager and creates another worker and so on. That doesn't seem like a desirable behavior. Thanks. -- tejun