From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5E26C00140 for ; Thu, 18 Aug 2022 14:44:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245150AbiHROoX (ORCPT ); Thu, 18 Aug 2022 10:44:23 -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-Google-Smtp-Source: AA6agR7FtpY3SYHALc0HRTGEVNcQG61WEvIKRoIuLFVjhE8kpDJE2AmXE5Cu0dESJH9vjePzqrL2kzH7Efg3CP0x6T4= 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" 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.