Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1346778rwb; Thu, 15 Dec 2022 09:03:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf6FsNkcV5yVkq0h2oMlWewDYYBrCFamrkWBsJFPO/Swzn3jMDLDuaRvlsHoW4a0+sBTbXpz X-Received: by 2002:aa7:dcd0:0:b0:46a:cc65:5797 with SMTP id w16-20020aa7dcd0000000b0046acc655797mr22261456edu.8.1671123798587; Thu, 15 Dec 2022 09:03:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671123798; cv=none; d=google.com; s=arc-20160816; b=H/u6pyWhbAsizUCJnoXrlV8wY7cw67zrdJcrJruJSOjoetREgNyOrdpuOpBAcG0a+1 p69v4jStwGLiLD+Z9+caLfKMMLVBT4kbOTbSXUn+Pw0Sv5Eelqz97C7agrHJ2D4JzTCS tUpNntjqqC2aPSE8V6ESk2z9x6U4ef+sm1MbMhhDpxROpJgIvbdxO0+m7vjd9z9b8Eaw PC3i6vTrzRvzz+jxPUvUgKw6O0bvI5oaMiBmQa3bpi1azzDp5iR2maUIiLnHSiX1SnKm LhBPukabeYksHHMhgdT4NcxbCHKxJe4z3rtZOEJDpLnPl81D5PF1p/dObdd8/bZWh+eb UTnQ== 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=iZn+QJIG+pG2FMov/YvviioMJllEnj55mv0rTOwAEiE=; b=NqvbdLzT3CY4ZiU3E01FkG+vwZDWnkS2QmMh/zJFE/DGWhhwLictYsCceXrFdij9gP RvYKUDhhG/zJOXtDzLu9r7ODGJ9/q5rD/NaHBWJDE899eYx54ZINPy9+XUwvbU+KrWGH UxvtbXrl/NgjeSRDJo8STzAAT3iqljItnf4oXomtNqljMdKlUU7er4d20vDIISwuUPVZ QBV2HDEmva9CqRmvFtq4MgfeBEbMnoi3W42ML8Ib17Odb7I7PHK1GluV7QRl88fYZBOp X5Ev9Tt/RuY3kQmYElvC5dYu2F+vJuDgRjvC5jBXDq/+PasEde+5poSE5EH4nQzbl2nK PsCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OgTU8ACn; 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 q19-20020a056402519300b00461f10cb543si17865752edd.154.2022.12.15.09.02.59; Thu, 15 Dec 2022 09:03:18 -0800 (PST) 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=OgTU8ACn; 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 S229891AbiLOQyd (ORCPT + 69 others); Thu, 15 Dec 2022 11:54:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230349AbiLOQyS (ORCPT ); Thu, 15 Dec 2022 11:54:18 -0500 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9E6C396D2; Thu, 15 Dec 2022 08:54:16 -0800 (PST) Received: by mail-pl1-x635.google.com with SMTP id 17so7544264pll.0; Thu, 15 Dec 2022 08:54:16 -0800 (PST) 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:subject:date:message-id :reply-to; bh=iZn+QJIG+pG2FMov/YvviioMJllEnj55mv0rTOwAEiE=; b=OgTU8ACnECzBXNTgrFTQtc97eoPsgGmtug2GqlsFNG4KyynZ9Cli72P8mSBQTLM9v3 NE/VPRuXPU6mIMOm55/f2MBv9wc+fPQO3qNGoDvKdKAcvBFZAhv7tqlGKNHRjSCBBTKn Iefa/DsMDX8M5Jk2C+Del/o2N7aUjC3JWPHkEhjwhgMPogeZCWsG149Hd027dH3P7vWa FZrmWzLeI/wJO4E9nyL2LebGYy5Z3PPMESE93tC1hY/bAaWrP8P2iFijLfWQcRSb0FtQ Sz/Cex8iHrLmLA2WtV99BUV2Bue1+ZUvI667HeSWVpOAithkUB2YPgRqplIrambaeZ0L EcnQ== 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 :subject:date:message-id:reply-to; bh=iZn+QJIG+pG2FMov/YvviioMJllEnj55mv0rTOwAEiE=; b=hafUjmB7YEWVT1aOc6vjgbmjXdj3e5YSrw5a/RqDwH4teSxAkNsNSAoNrkYi4xz0lD NoDMRvj3gSuYPYBbmOxvdX11vd9iLuEI11WbVl9FgZi2fdSq9QLN4q4rUtJDeW096Qy1 AAQwlOvsO0PWhi2y3eVo4SL6/5AzHBoxYG47iCoqKDpadZYJy23Xk1u2sOsmNf6bwzXF uKk3ssNHCZx7swE6omMn5P24ea2yruGnlGFrh8PYbFRYkPS6tTeSyNuRHjioFucNaMt/ b9Hf3I4Y4Zdk/awnUD6WL5FfakFZZzdWh2AO4pk7D0PhM2KVjKKJUJDREKN8a86N66Tg ISRA== X-Gm-Message-State: ANoB5pkv89+OyjKVTxkZUqX6h6JfLPDBYEuYOyoOSu/SnB8vmQAciKac c4N68ZpY2xwGi9hyaOdvDg93EYse87So7g== X-Received: by 2002:a05:6a20:d68b:b0:9d:efbf:6604 with SMTP id it11-20020a056a20d68b00b0009defbf6604mr35689526pzb.18.1671123256345; Thu, 15 Dec 2022 08:54:16 -0800 (PST) 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 b7-20020a62cf07000000b00562677968aesm1972328pfg.72.2022.12.15.08.54.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 08:54:15 -0800 (PST) Sender: Tejun Heo Date: Thu, 15 Dec 2022 06:54:14 -1000 From: Tejun Heo To: Ming Lei Cc: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Zhong Jinghua , Yu Kuai , Dennis Zhou Subject: Re: [PATCH 3/3] lib/percpu-refcount: drain ->release() in perpcu_ref_exit() Message-ID: References: <20221214025101.1268437-1-ming.lei@redhat.com> <20221214025101.1268437-4-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221214025101.1268437-4-ming.lei@redhat.com> X-Spam-Status: No, score=-1.7 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 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 Wed, Dec 14, 2022 at 10:51:01AM +0800, Ming Lei wrote: > The pattern of wait_event(percpu_ref_is_zero()) has been used in several > kernel components, and this way actually has the following risk: I'd much rather see those components updated to wait for notification from ->release rather than doing this or update percpu_ref_is_zero() to wait for ->release() to finish. Thanks. -- tejun