Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2492487rwp; Fri, 14 Jul 2023 07:03:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlG6n1wkQBz57GcWwBXW5TpD54CgCBuoVuj8HZPFf79xxfNxU0Wqwgd+i3TeHN7i5rSqOs6/ X-Received: by 2002:a17:902:e744:b0:1b6:7f96:42ca with SMTP id p4-20020a170902e74400b001b67f9642camr3905781plf.66.1689343424165; Fri, 14 Jul 2023 07:03:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689343424; cv=none; d=google.com; s=arc-20160816; b=cLfUwjxy98xaFGAs9o8gf5Og7IBK5DWoCVshxN5u2IJSV37JqwTTvO4v49iQ+Z4jzv aVzqPPZ/kd94g+KZKcYTbab+I2YxVeAMXTbfAddfxzJYNLc/ZESJsGQtovqCxgRmVn+x R2s589+j1cNXKqc6aV7sxGlqj2/0c7vaLlXhPHp1dScPA5UvORCoOWRffYoBB+s28zsV A39qk+7eZBMm/L1g/dZ9V/2XtkNoblE8p4GHgqAdBX1+F3Lxt/nd5JFYCKjDv1bdwvt7 E6BhvpBg5ED70lPhXeT7XqQzJwhYySDrmiYFcss7UtMAbIMDjYKNEGxonhFa09JpCWE7 dnJg== 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=jpcIq9xBEn3GqPt9qtLJZwLczNi+ePJo4eIHV0FomOc=; fh=zKWaJ3/kUUwFN/05VRRMNtxKYMNCa7Q0iBXd0Xt8oZ8=; b=PMP4buX+x9O8rXwIJqAQPQgh8RIZ8UexPNsC4ag/azTqwssiNSS9bsVcm9naDHeLQx sQ4iuFjLgAzjFTx5HPGfSEZBYjfLcDXtmy8n3Ev/uIdNaJOSepjxk904wA6mjjx6mssZ gC37h7lKji5tAW+ohE3if0JBD4fwrcjRhBlswS8CmVteOWIdAFqFEe5Ev79av+ay68U/ /+vPAkXHsZ4/D6JGLAMVL5J0o1FOy17PGt77QlzeLaAZQuj0iNq/OymySoIqPSH/Znvt w3Z216/3dg7LreciGE2Ost2uAiwmESrklZ6nrwiymlH2MMGsY147UGtJbeNqFTTlhJYE LxkQ== 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 q3-20020a170902e30300b001b8944aa948si6991840plc.518.2023.07.14.07.03.30; Fri, 14 Jul 2023 07:03:44 -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 S235825AbjGNNve (ORCPT + 99 others); Fri, 14 Jul 2023 09:51:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235308AbjGNNvc (ORCPT ); Fri, 14 Jul 2023 09:51:32 -0400 Received: from out30-119.freemail.mail.aliyun.com (out30-119.freemail.mail.aliyun.com [115.124.30.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B827C35A4; Fri, 14 Jul 2023 06:51:26 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045192;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0VnMhNu7_1689342677; Received: from 30.25.236.189(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0VnMhNu7_1689342677) by smtp.aliyun-inc.com; Fri, 14 Jul 2023 21:51:20 +0800 Message-ID: Date: Fri, 14 Jul 2023 21:51:16 +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: Joel Fernandes Cc: paulmck@kernel.org, Sandeep Dhavale , 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 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> <058e7ee9-0380-eb1b-d9a8-b184cba6ed53@linux.alibaba.com> From: Gao Xiang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 21:42, Joel Fernandes wrote: > On Thu, Jul 13, 2023 at 11:17 PM Gao Xiang wrote: >> >> >> >> 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 > > I think it is a fine idea. > >> we need to work on >> CONFIG_PREEMPT_COUNT=n (why not?), we could just always trigger a >> workqueue for this. >> > > So CONFIG_PREEMPT_COUNT=n users don't deserve good performance? ;-) I'm not sure if non-preemptible kernel users really care about such sensitive latencies, I don't know, my 2 cents. Thanks, Gao Xiang > > thanks, > > - Joel