Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp524593rwb; Thu, 18 Aug 2022 07:50:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR6p2oeNY/gsEvQC7H6OJr+DkH8gUZKTiJFwWcwPyiFa2p3NiMj5eblj1BlDzdcS2chxhG4w X-Received: by 2002:a17:906:5d04:b0:722:f46c:b891 with SMTP id g4-20020a1709065d0400b00722f46cb891mr2161901ejt.4.1660834238070; Thu, 18 Aug 2022 07:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660834238; cv=none; d=google.com; s=arc-20160816; b=oKiPKZbUMTj/oKypTvjJUqwTTrkEoz0Lv/tizMrgFWEoBH117kXRGmI9uJPv7spZX7 4zWFznvgw50WByhx2bXWrKP1D/3q6XVACOM+kV7AeGVyuOVYgTObgH+chpJOpvh4gJ6x TrX/8DFLplvZuzJQ4f50GJTQn16sCKVuXpMXd5VanPEKAnFD025UgfSSquairLgltjB1 t4gAK2bbPTeBHhOZwF6q/C1o+e+5pT9mAnlysFHyluNwBiqhnQwqA1HM7c0R+22Ofd79 VrmMctxJz6kAMBapop29Qn0WN5Eu7a6NX7x/Uc/nZ9zXcdx0cVxLaMWDnLRGFptlWDsy eFtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=+3dbFH3P6bvqViGYIfGXx24q609p+/zZUcUFtVnI09w=; b=m//fjZTFr4elyXY3V8in9387wEmo1h2iFsUkkBx8u9syCjKVVN1orSBPTmL4Pj9I2M MmeZh6uN1c194GWRK/mdU/7fveG1I/ZghcBx6WiFtAhOmMk2eYfPrxvjzumiPhHu5uTb DssgmVZAVFY9w1ERva53wrTSDRn+SlTjZ+9DWoem+8p0CtCf2xf9NaYjV6RhnQM7uHJ6 87GWvmXFyx5T+Zi6b+xtf3w2P4Y9kg0Sn1CMCNXJSvtC6TS9WPxwIxmpg94h/xI3JdoE sQqNsONdJWOEmogsvxU180xCV0Ye8f29Hv2zJWB7vDS+RGLS0chR95PhuUXGu1cHqqhq fb1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=L6mwgXeu; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f12-20020a170906738c00b0073c42dfe1d1si620368ejl.219.2022.08.18.07.50.08; Thu, 18 Aug 2022 07:50:38 -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=L6mwgXeu; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343671AbiHROoW (ORCPT + 99 others); Thu, 18 Aug 2022 10:44:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245280AbiHROoS (ORCPT ); Thu, 18 Aug 2022 10:44:18 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9532927FF0 for ; Thu, 18 Aug 2022 07:44:15 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id k17so939101wmr.2 for ; Thu, 18 Aug 2022 07:44:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=+3dbFH3P6bvqViGYIfGXx24q609p+/zZUcUFtVnI09w=; b=L6mwgXeuMhhLgumt/3Ptf4T89zmo0JcbbGqfHsUYqVm99xFzBG7RCJyBKCkbPm1zqQ fFwCpgXUwa+PFojDFRcpYwXiIQSMfihC2nr3iobJifvqxNd4KIYp9GjbSpqaA/tpLN0+ 4nbKfZ2B9BaiF4WMV/Ut2iryuZYz7t7ic+KyBs+RcoHVzCrc0zlVodorn81Df7CnvEFF 8g4IvOWMpLQtJCXPrnOOO4bntMzJq3djLPn1M7SkhfzQjiWqTwUmSlsj318Z8JFz+a6d 9u5cNtXO9c5NV1sEqSXurbTw0KZ7edpToqaogOLEAclMCGXwTAxsbuC7sicfVIbQkJ3x Rm2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=+3dbFH3P6bvqViGYIfGXx24q609p+/zZUcUFtVnI09w=; b=RpvcRpoq1dQipLgiqm1z+AO0hwVhA8MRSFDsMN2sut9+jCeeXpt8kKyxBzACTdvZaC UFZCgPfWqRv0ShILkbkgXykSZ1YWdOMdm9n8wkVOoP1ZdmRwKxGyH9lwwYtN2oH8+6Iy cwkL6XKev1LCKNCOrVeLB1gHK8G5ABgiPFo4HjnDJ55yYu+SyLJ0FS/5ibTZ4jaNkkLq EtcTnWutnH4EyoYcmrLCNQLeDjD4pYoeNDVg7dhAN+1kvsSJzUIohKVFQcxLkE7ptxcU 2tymk4gDwkq68uG4Ryze9wfrM1Zn+Z8Twab2dAukwuo9IEtW3SrEBgIFxnpoV57njv1j fPSw== X-Gm-Message-State: ACgBeo3CP3PRDDnY7IjMxnW1SH4J4/KhKXRB9iqA3IdwZAWQu/8Cm9Ty ET6CYKoTD9xVjK6xQhFFSmDO9z4lv6jUGDOeXYw= X-Received: by 2002:a7b:cb55:0:b0:3a5:41a:829c with SMTP id v21-20020a7bcb55000000b003a5041a829cmr5422048wmj.153.1660833853933; Thu, 18 Aug 2022 07:44:13 -0700 (PDT) MIME-Version: 1.0 References: <20220804084135.92425-1-jiangshanlai@gmail.com> <20220804084135.92425-8-jiangshanlai@gmail.com> In-Reply-To: From: Lai Jiangshan Date: Thu, 18 Aug 2022 22:44:02 +0800 Message-ID: Subject: Re: [RFC PATCH 7/8] workqueue: Remove the outer loop in maybe_create_worker() To: Tejun Heo Cc: LKML , Lai Jiangshan Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 Wed, Aug 17, 2022 at 6:08 AM Tejun Heo wrote: > > 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. > The recheck is always in the same pool lock critical section, so the behavior isn't changed before/after this patch.