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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A5D1C636D4 for ; Fri, 3 Feb 2023 02:25:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231643AbjBCCZG (ORCPT ); Thu, 2 Feb 2023 21:25:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229667AbjBCCZE (ORCPT ); Thu, 2 Feb 2023 21:25:04 -0500 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 48BD34741C; Thu, 2 Feb 2023 18:25:02 -0800 (PST) Received: from loongson.cn (unknown [10.180.13.185]) by gateway (Coremail) with SMTP id _____8AxW+p9cNxjcRENAA--.26401S3; Fri, 03 Feb 2023 10:25:01 +0800 (CST) Received: from [10.180.13.185] (unknown [10.180.13.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Ax+717cNxjezEoAA--.12681S3; Fri, 03 Feb 2023 10:25:00 +0800 (CST) Subject: Re: Re: [PATCH v4] pipe: use __pipe_{lock,unlock} instead of spinlock To: Linus Torvalds Cc: Alexander Viro , Andrew Morton , "Christian Brauner (Microsoft)" , Luis Chamberlain , David Howells , Mauro Carvalho Chehab , Eric Dumazet , "Fabio M. De Francesco" , Christophe JAILLET , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, maobibo , Matthew Wilcox , Sedat Dilek References: <20230129060452.7380-1-zhanghongchen@loongson.cn> From: Hongchen Zhang Message-ID: <3abdd2bf-49ba-6c85-3ff6-29915eb40ac4@loongson.cn> Date: Fri, 3 Feb 2023 10:24:58 +0800 User-Agent: Mozilla/5.0 (X11; Linux loongarch64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8Ax+717cNxjezEoAA--.12681S3 X-CM-SenderInfo: x2kd0w5krqwupkhqwqxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBjvdXoWrKrW5Kr4Dury5ZrWDZr45Awb_yoW3CrcEva 4F9rs7KwsrXr43X3WYqry3CrWSgw1kXr1Uu3s5Ar42qw1rta4DC3WrZr93ArW5JF48G347 CryUZ34agrWa9jkaLaAFLSUrUUUU8b8apTn2vfkv8UJUUUU8wcxFpf9Il3svdxBIdaVrn0 xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUO 07kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3w AFIxvE14AKwVWUXVWUAwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK 6xIIjxv20xvE14v26r4j6ryUM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j6F4UM28EF7 xvwVC2z280aVAFwI0_Cr0_Gr1UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr0_Cr1UM2kK e7AKxVWUXVWUAwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI 0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUAVWUtwAv7VC2z280 aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcVAKI48JMxk0xIA0c2IEe2 xFo4CEbIxvr21lc7CjxVAaw2AFwI0_JF0_Jw1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC 6x0Yz7v_Jr0_Gr1l4IxYO2xFxVAFwI0_Jrv_JF1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s 026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF 0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0x vE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv 6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUxYiiDUUUU Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Linus, On 2023/1/29 下午3:33, Linus Torvalds wrote: > On Sat, Jan 28, 2023 at 10:05 PM Hongchen Zhang > wrote: >> >> Use spinlock in pipe_{read,write} cost too much time,IMO >> pipe->{head,tail} can be protected by __pipe_{lock,unlock}. >> On the other hand, we can use __pipe_{lock,unlock} to protect >> the pipe->{head,tail} in pipe_resize_ring and >> post_one_notification. > > No, we really can't. > > post_one_notification() is called under the RCU lock held, *and* with > a spinlock held. > > It simply cannot do a sleeping lock like __pipe_lock(). > > So that patch is simply fundamentally buggy, I'm afraid. > > Linus > Thanks for your review,Let me find out if there is any way to solve the problem you said. Best Regards Hongchen Zhang