Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp26100pxh; Thu, 7 Apr 2022 21:48:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyupXSiaHT/CAticBG5nawCwnPuGq/+RvnGgkxQjYvTXTtq+X8ZtldfyGZ30KdyM4Ran3u4 X-Received: by 2002:a17:902:e5c7:b0:157:1905:f4bc with SMTP id u7-20020a170902e5c700b001571905f4bcmr4269229plf.83.1649393331037; Thu, 07 Apr 2022 21:48:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649393331; cv=none; d=google.com; s=arc-20160816; b=Ro8Qjdo+8+LgugwHcks0s2adhUi5zXkk9MZ85AyfgoBNFy2k28iEqb3xikafLZZ68e uDyWZ0QJWwAFB5V86OJuDtvMbNEaT4m+yjZzkC0REldUc59guejWd/onu9Ogex2+8+dX VhuAC8PG82D3hkIUYR+eDLMZNrlXEkU7KXmL9ycR16DYLcV1367qStpDH0wG4t/qijYg g1cH5xaQRKE9ZckgyzH+z7mFxzT6C/fXiEt6n7o/Z0b0cCYGzRxiC+2RSln+biD9ldRw uSERaU5Acbh8kIlGXAopFjYUaYrgz7vqFJnPufIws//DVw9ZD/sM95EKtCS13l9kFhP0 UXaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=pOCryi92y3m1WkTBJLqgjo+HtAoZSo+2BAEOkz/hDyU=; b=RcxegxXTMEu8OFqGj79YNTpBDoran7VQyMUIXoGQZP2rYvgTP34OQv7yHXjBJh8DTb vZW+vad4ckpf3d1mC+fxACXj9jKyXGC88Vblo84rH0HmCbMs4+JTzhpJSIema9viIuf1 dANlaVt1zdmFjgTuUcsGaiB3/wPoNJDJrO/dWH9rCyo1NVi/wED/OGl7rVfDp2lpa6vs 4AeEinKmoPAQNBNMx7alnsTlzMYciGWgUIoJDb+aMlEmtd2fcHIB/k1ATtcbho5B/ira cotJsjClCb6au2F4lq+126RL/Ef2f5WrysKhJccDLrIxiX9PY/PaP5qYyZDWjWNkzW/y surA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=A6eqfmfv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id cp2-20020a170902e78200b001568acea039si1475126plb.554.2022.04.07.21.48.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 21:48:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=A6eqfmfv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E97C12D7FBA; Thu, 7 Apr 2022 21:15:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234189AbiDHERH (ORCPT + 99 others); Fri, 8 Apr 2022 00:17:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232658AbiDHERD (ORCPT ); Fri, 8 Apr 2022 00:17:03 -0400 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAFAD2D3126 for ; Thu, 7 Apr 2022 21:15:00 -0700 (PDT) Received: by mail-pg1-x533.google.com with SMTP id r66so6765550pgr.3 for ; Thu, 07 Apr 2022 21:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=pOCryi92y3m1WkTBJLqgjo+HtAoZSo+2BAEOkz/hDyU=; b=A6eqfmfvzLeXiy68rSdZQhgf8H4Hu16PlZ9UlNjlgjJW9F8Jo7pIiIJhwksooVtT4t FMb6AbovM2vuBKTG7o8khYQoaE9a7ZGGZwx1GSP8hjCT8wQYJk3CrGHJGBey/3GFGjZp MV2djrxZBLrthdxvzrq12WcuypZRrTtg6NVhClVhwTDHwU+6Cge4yzEkU8wmfZ1PJPcr VIahloi7EeAuO18oAMqY1TVrLSTpKIWmcaJbjfUQsxy4VhxaoQ8TX31kD8pxP87mPqJb 49BRaKRo5dEzCWYjthE663qTY7z4XHNus5FupBEBJn0TV09kQthVsUfiSsxBpP1trUZy h4WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=pOCryi92y3m1WkTBJLqgjo+HtAoZSo+2BAEOkz/hDyU=; b=kYhPNQv3Di4RN2R1xJjr/4OvtFybiVWleBifuVYUmfA9yFtT8Wvkbi7aIyBY+ImABu RndKSprC++RHSjvoZLa5NDwM8ErSbAO4EMvHZ8v4dCb/sLex+5eb5ErTwiqbJEdDyqcm Ee33Qh6FToFQGEkW+U+hUoSBkwNc/Rw4uFsvUfhIeI5FsoEPP8LTwlUcpFDM+UFJbC18 KbbaoGB2SXih8H4yd5ez9G2stV5XNowarw9t6sFnU4elWuujuhr+x4aXIoXZ3Pn/5Myo vZ6FpScIzcmnbfQVtNqd5TD4VOpX2osiWGdwqM51o6R4tq2xRIHlm8//rg4iov8Gc4px cBUA== X-Gm-Message-State: AOAM532dPKYpP7/aOGD2RuAQBhgIjPXUtCGa7Y0Dob+bbpRkCugnaQuM gd4rHUGPkAjOM6ji95QtdKJjXw== X-Received: by 2002:a63:6984:0:b0:398:8db9:7570 with SMTP id e126-20020a636984000000b003988db97570mr13741565pgc.373.1649391300498; Thu, 07 Apr 2022 21:15:00 -0700 (PDT) Received: from [10.255.182.146] ([139.177.225.255]) by smtp.gmail.com with ESMTPSA id p13-20020a056a000b4d00b004faecee6e89sm24915810pfo.208.2022.04.07.21.14.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Apr 2022 21:14:59 -0700 (PDT) Message-ID: Date: Fri, 8 Apr 2022 12:14:54 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] percpu_ref: call wake_up_all() after percpu_ref_put() completes Content-Language: en-US To: Andrew Morton Cc: Muchun Song , dennis@kernel.org, tj@kernel.org, cl@linux.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, zhouchengming@bytedance.com References: <20220407103335.36885-1-zhengqi.arch@bytedance.com> <20220407205419.f656419a8f4665a2dc781133@linux-foundation.org> <35195a61-d531-aeb2-5565-146e345f8bf6@bytedance.com> <20220407211018.875696691e4411a7b5c8f63f@linux-foundation.org> From: Qi Zheng In-Reply-To: <20220407211018.875696691e4411a7b5c8f63f@linux-foundation.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 2022/4/8 12:10 PM, Andrew Morton wrote: > On Fri, 8 Apr 2022 12:06:20 +0800 Qi Zheng wrote: > >> >> >>>>>> Signed-off-by: Qi Zheng >>>>> >>>>> Are any users affected by this? If so, I think a Fixes tag >>>>> is necessary. >>>> >>>> Looks all current users(blk_pre_runtime_suspend() and set_in_sync()) are >>>> affected by this. >>>> >>>> I see that this patch has been merged into the mm tree, can Andrew help >>>> me add the following Fixes tag? >>> >>> Andrew is helpful ;) >>> >>> Do you see reasons why we should backport this into -stable trees? >>> It's 8 years old, so my uninformed guess is "no"? >> >> Hmm, although the commit 490c79a65708 add wake_up_all(), it is no >> problem for the usage at that time, maybe the correct Fixes tag is the >> following: >> >> Fixes: 210f7cdcf088 ("percpu-refcount: support synchronous switch to >> atomic mode.") >> >> But in fact, there is no problem with it, but all current users expect >> the refcount is stable after percpu_ref_switch_to_atomic_sync() returns. >> >> I have no idea as which Fixes tag to add. > > Well the solution to that problem is to add cc:stable and let Greg > figure it out ;) > > The more serious question is "should we backport this". What is the > end-user-visible impact of the bug? Do our users need the fix or not? The impact on the current user is that it is possible to miss an opportunity to reach 0 due to the case B in the commit message: /* The value of &ref is unstable! */ percpu_ref_is_zero(&ref) (B)percpu_ref_put(ref); Thanks, Qi > -- Thanks, Qi