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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F131C433F5 for ; Fri, 8 Apr 2022 04:15:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 788026B0071; Fri, 8 Apr 2022 00:15:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 737D56B0072; Fri, 8 Apr 2022 00:15:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5D9226B0074; Fri, 8 Apr 2022 00:15:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 4C1686B0071 for ; Fri, 8 Apr 2022 00:15:02 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 069722092D for ; Fri, 8 Apr 2022 04:15:02 +0000 (UTC) X-FDA: 79332396402.05.F086051 Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by imf25.hostedemail.com (Postfix) with ESMTP id 7557EA0006 for ; Fri, 8 Apr 2022 04:15:01 +0000 (UTC) Received: by mail-pg1-f173.google.com with SMTP id q142so6722703pgq.9 for ; Thu, 07 Apr 2022 21:15:01 -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=OTGO9aNeHOjfgXl3aWvzx027xd3fiYanXMq3BuiZnx4oTQveG3qAHo7D7BoOzWXksd sbilyDqqOxwRdYvwwCvUejqD9VGBlyoqDh8JUqNzXLPsk4aXmhkqnF28XceWblxLCzru 8hJQMdgGJ6tXTTD+WYor25/XcXFNbZEmVMtN5iDHy3lfDj+5zinKN0AoOGSG9hPSt2y8 aJ3fDoq1XO1068JU7WnuDAqaEvLOHiienVcYbJqw8Dsslfo8/2OC5uInTiU4Mn1m1KVS wSTOF1irTwlVXVcSrxjvIq5VjT4JoQ9Ud4hEpCPrKDYq1MtL4VfkLyatVseatNCCzmV1 dt0g== X-Gm-Message-State: AOAM531MMGw0k4uSD81fAuqCjeDxvZ8i/sAJkjeIoAvswmlDohEYejUx TlDtPIiubJHPkkPNkpEl4vH82A== X-Google-Smtp-Source: ABdhPJxJxGb8VUnjuiRO0COy24E2Vzk3Io06caBr41iKv2K+P5tj3YHBgTo/DBgjCuUKEqSAwf3Wlg== 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-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 7557EA0006 X-Stat-Signature: dtpoonesbqk6didax6y79djmwb3bg1xo Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=A6eqfmfv; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf25.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.215.173 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com X-Rspam-User: X-HE-Tag: 1649391301-231036 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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