Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp1967223rwp; Thu, 13 Jul 2023 21:13:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlFCMTRybaB/t78PFwJ2jdHkG89oPemol9y0n9u3JT/C3NXnbHj0Yr/T+7Z+PEtSoPtZp7Bg X-Received: by 2002:a17:902:c14d:b0:1b8:4607:c3d7 with SMTP id 13-20020a170902c14d00b001b84607c3d7mr3152116plj.41.1689307987313; Thu, 13 Jul 2023 21:13:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689307987; cv=none; d=google.com; s=arc-20160816; b=s/Wvr+50AFc/j66y4xvix1Yv6g8kcU9lUHBThuxu7ZIHe4nIHmb+TST8X4g51B2dRZ 3UVAe4SdJZI+CbqMjTHuvvkRiJ2OGaVfyDKNhK4GaZ2IesYFeMXhpabBxItHIbpImXx8 eI+VsHtctrpPFnmXUnzKAgpBah5s+HZG+p8jszuIEpE7ci3C6vFsmhaCX1bUSmSMLRKj 45lSMtDnydhp+qmDn+qtjFCy4PH3URhWl+zQnjCwPWKTb1+osa6vFtnMFax16RkyhM5P SI/lAtn5VhWbsUFwnaKdWJM7RrrGvWyGrgMRWmeqBu+s/5LCxP7fhRZeJh4dUVeyS7/Y z7rg== 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:subject:user-agent:mime-version:date:message-id; bh=Zwd59nP/ASw/HFlV4EhBtFBCnyrWO7K1fZtY0DydADo=; fh=/kw63FWpCDN7FJzreQhICvCQrHIhgtvrHI4YkdLf3uQ=; b=by7o5so/XBqWjYG8VsuXk2hI/KWuM8CIV2vBNnPdgWds6z1YpPglGvGxjIxWoJnWN6 TmUXAbxXfHXcSMEb2ncRGOZ9+GIWrErip3MOI+1HwA4zG0ZljakoOYbM8W+NwdqpLqx0 JEFVBdPpo3PAjbQz4sUa5xSOXVdeYpadEYmO6vhnFCEx3THeibxgsDGRt2/wJVu4vw9N sIf+QBxrIXfbyGyQ7KrX0wgt8ALNbUrhZ7UEQTrMTJ3qEE7/XnEszwDg9PU+A0VAxHRi hou0iEDfLWKbP+PBBtUFmYgib2Yvzd5NUH99cGGY7rGkWUnkME6fRuW3huBpDPA8tIXg q8eQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w9-20020a1709026f0900b001b9dc549fefsi509044plk.135.2023.07.13.21.12.53; Thu, 13 Jul 2023 21:13:07 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234753AbjGNDRR (ORCPT + 99 others); Thu, 13 Jul 2023 23:17:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234822AbjGNDRH (ORCPT ); Thu, 13 Jul 2023 23:17:07 -0400 Received: from out30-110.freemail.mail.aliyun.com (out30-110.freemail.mail.aliyun.com [115.124.30.110]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A76230F4; Thu, 13 Jul 2023 20:17:00 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R391e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0VnK7oAI_1689304613; Received: from 172.20.10.3(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0VnK7oAI_1689304613) by smtp.aliyun-inc.com; Fri, 14 Jul 2023 11:16:56 +0800 Message-ID: <058e7ee9-0380-eb1b-d9a8-b184cba6ed53@linux.alibaba.com> Date: Fri, 14 Jul 2023 11:16:52 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v1] rcu: Fix and improve RCU read lock checks when !CONFIG_DEBUG_LOCK_ALLOC To: paulmck@kernel.org, Sandeep Dhavale Cc: Frederic Weisbecker , Neeraj Upadhyay , Josh Triplett , Boqun Feng , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Matthias Brugger , AngeloGioacchino Del Regno , linux-erofs@lists.ozlabs.org, xiang@kernel.org, Will Shiu , kernel-team@android.com, rcu@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Joel Fernandes References: <20230713003201.GA469376@google.com> <161f1615-3d85-cf47-d2d5-695adf1ca7d4@linux.alibaba.com> <0d9e7b4d-6477-47a6-b3d2-2c9d9b64903d@paulmck-laptop> <87292a44-cc02-4d95-940e-e4e31d0bc6f2@paulmck-laptop> <894a3b64-a369-7bc6-c8a8-0910843cc587@linux.alibaba.com> <58b661d0-0ebb-4b45-a10d-c5927fb791cd@paulmck-laptop> <7d433fac-a62d-4e81-b8e5-57cf5f2d1d55@paulmck-laptop> From: Gao Xiang In-Reply-To: <7d433fac-a62d-4e81-b8e5-57cf5f2d1d55@paulmck-laptop> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 2023/7/14 10:16, Paul E. McKenney wrote: > On Thu, Jul 13, 2023 at 09:33:35AM -0700, Paul E. McKenney wrote: >> On Thu, Jul 13, 2023 at 11:33:24AM -0400, Joel Fernandes wrote: ... >>> >>> >From what Sandeep described, the code path is in an RCU reader. My >>> question is more, why doesn't it use SRCU instead since it clearly >>> does so if BLK_MQ_F_BLOCKING. What are the tradeoffs? IMHO, a deeper >>> dive needs to be made into that before concluding that the fix is to >>> use rcu_read_lock_any_held(). >> >> How can this be solved? >> >> 1. Always use a workqueue. Simple, but is said to have performance >> issues. >> >> 2. Pass a flag in that indicates whether or not the caller is in an >> RCU read-side critical section. Conceptually simple, but might >> or might not be reasonable to actually implement in the code as >> it exists now. (You tell me!) >> >> 3. Create a function in z_erofs that gives you a decent >> approximation, maybe something like the following. >> >> 4. Other ideas here. > > 5. #3 plus make the corresponding Kconfig option select > PREEMPT_COUNT, assuming that any users needing compression in > non-preemptible kernels are OK with PREEMPT_COUNT being set. > (Some users of non-preemptible kernels object strenuously > to the added overhead from CONFIG_PREEMPT_COUNT=y.) I'm not sure if it's a good idea, we need to work on CONFIG_PREEMPT_COUNT=n (why not?), we could just always trigger a workqueue for this. Anyway, before we proceed, I also think it'd be better to get some performance numbers first for this (e.g. with dm-verity) and record the numbers in the commit message to justify this. Otherwise, I guess the same question will be raised again and again. Thanks, Gao Xiang