Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2581366rwb; Sun, 15 Jan 2023 18:26:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXsHGW2FQusz53pPxXH7QJopZCbkzFP3T35ldfOfd7Hfr4kaMpUAbfbBH8oMF6GqzBRMYGui X-Received: by 2002:aa7:db91:0:b0:484:9e05:b356 with SMTP id u17-20020aa7db91000000b004849e05b356mr75629328edt.27.1673836007915; Sun, 15 Jan 2023 18:26:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673836007; cv=none; d=google.com; s=arc-20160816; b=QBR7lbIl3V8sewPgMY/84/8tmbM/x2Bndxw7UI9gGsrPO2J6pUbCggGD684K7zhsIy POuMqXuqwjW8GTzFQDcTIORDynAqWSssbePl5p/EnljAEQA/bv8gHO6L1o+VIILfzzsq vft4UykmrRg754yYwxEVmNQ8lJy5GNSq0+SsU6qtdjPxGgATFtvKa/517ulJt/cpsYmy frVlOSZOIbJv/6Bdm259Ljy8M9o5iyqdHaHZBqrYDurOqyTBDGp2ppQqdtKhSs5pAHY+ QUhyjsu/VMJFh3xuuIkEDapFNSoePGZrN0oK32K2v0rA3pPGVoIS7sPApdU17onFkTgZ AQFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=8jVWHzijAQ//ujltk7lx8lX+8xP6LzYSDh0TbbC9jLw=; b=kqZwgn1qXIqKiPOutgm9QKdGo1OfebIzOeJAnU/GtJZyoEgVvS7f1MufbNIipeBeDZ Ya0GkjAhg8ui6DLC6ytewqrNSHzcvl13juwBuvOPEYxvNSjHEJY0OozAn6sakjyELtD5 SLU8lsnC2IqIFi7/OUPcX2uVoddP45Bf3fN2xxLKqisrHs9HBhDcQQKgB6bgYIU0RqRp /4+SasN48vtiItTfPvpgHlbyuDb5DADawFOPlmN6EcIg529tfc0f6gIyEZEVJxCha+oO BBLbFmwyb05UPtpqE0OdtKU0+jo3WpV4vo/sGs7zD9o0mW3uyBh0x5C+V/t9A5THczoE d8+g== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y19-20020a056402441300b004698188a1b9si32278573eda.557.2023.01.15.18.26.35; Sun, 15 Jan 2023 18:26:47 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231742AbjAPCQq (ORCPT + 52 others); Sun, 15 Jan 2023 21:16:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231661AbjAPCQm (ORCPT ); Sun, 15 Jan 2023 21:16:42 -0500 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2B5A146A3; Sun, 15 Jan 2023 18:16:39 -0800 (PST) Received: from loongson.cn (unknown [10.180.13.185]) by gateway (Coremail) with SMTP id _____8Dxh+mGs8RjEsoBAA--.339S3; Mon, 16 Jan 2023 10:16:38 +0800 (CST) Received: from [10.180.13.185] (unknown [10.180.13.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cxf+SEs8Rj2f4ZAA--.13846S3; Mon, 16 Jan 2023 10:16:37 +0800 (CST) Subject: Re: [PATCH v3] pipe: use __pipe_{lock,unlock} instead of spinlock To: sedat.dilek@gmail.com Cc: Andrew Morton , David Howells , Matthew Wilcox , Alexander Viro , "Christian Brauner (Microsoft)" , Luis Chamberlain , Mauro Carvalho Chehab , Eric Dumazet , "Fabio M. De Francesco" , Christophe JAILLET , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230107012324.30698-1-zhanghongchen@loongson.cn> <9fcb3f80-cb55-9a72-0e74-03ace2408d21@loongson.cn> From: Hongchen Zhang Message-ID: Date: Mon, 16 Jan 2023 10:16:36 +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: 7bit X-CM-TRANSID: AQAAf8Cxf+SEs8Rj2f4ZAA--.13846S3 X-CM-SenderInfo: x2kd0w5krqwupkhqwqxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBjvJXoW7Ww13CFyfXr1DJw18AFW7CFg_yoW8Kw4rpF 93CFn7tr4DJw1UJry29Fn0qFWYv343WryqgrWUKFyUJ3ZYgwnrtF47JryUW3s8uF4FkF4r Aw4Ut3sFgF45AaDanT9S1TB71UUUUUJqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bqxYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_JrI_Jryl8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwA2z4 x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4UJVWxJr1l n4kS14v26r1Y6r17M2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6x ACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1Y6r17McIj6I8E 87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lc7I2V7IY0V AS07AlzVAYIcxG8wCY1x0262kKe7AKxVWUAVWUtwCF04k20xvY0x0EwIxGrwCFx2IqxVCF s4IE7xkEbVWUJVW8JwCFI7km07C267AKxVWUXVWUAwC20s026c02F40E14v26r1j6r18MI 8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41l IxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIx AIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2 jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU89iSPUUUUU== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_PASS,SPF_PASS 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 Hi sedat, On 2023/1/16 am9:52, Sedat Dilek wrote: > On Fri, Jan 13, 2023 at 10:32 AM Sedat Dilek wrote: >> >> On Fri, Jan 13, 2023 at 4:19 AM Hongchen Zhang >> wrote: >>> >>> Hi All, >>> any question about this patch, can it be merged? >>> >>> Thanks >>> On 2023/1/7 am 9:23, 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. >>>> >>>> Reminded by Matthew, I tested this patch using UnixBench's pipe >>>> test case on a x86_64 machine,and get the following data: >>>> 1) before this patch >>>> System Benchmarks Partial Index BASELINE RESULT INDEX >>>> Pipe Throughput 12440.0 493023.3 396.3 >>>> ======== >>>> System Benchmarks Index Score (Partial Only) 396.3 >>>> >>>> 2) after this patch >>>> System Benchmarks Partial Index BASELINE RESULT INDEX >>>> Pipe Throughput 12440.0 507551.4 408.0 >>>> ======== >>>> System Benchmarks Index Score (Partial Only) 408.0 >>>> >>>> so we get ~3% speedup. >>>> >>>> Reminded by Andrew, I tested this patch with the test code in >>>> Linus's 0ddad21d3e99 add get following result: >> >> Happy new 2023 Hongchen Zhang, >> >> Thanks for the update and sorry for the late response. >> >> Should be "...s/add/and get following result:" >> >> I cannot say much about the patch itself or tested it in my build-environment. >> >> Best regards, >> -Sedat- >> > > I have applied v3 on top of Linux v6.2-rc4. > > Used pipebench for a quick testing. > > # fdisk -l /dev/sdb > Disk /dev/sdb: 14,91 GiB, 16013942784 bytes, 31277232 sectors > Disk model: SanDisk iSSD P4 > Units: sectors of 1 * 512 = 512 bytes > Sector size (logical/physical): 512 bytes / 512 bytes > I/O size (minimum/optimal): 512 bytes / 512 bytes > Disklabel type: dos > Disk identifier: 0x74f02dea > > Device Boot Start End Sectors Size Id Type > /dev/sdb1 2048 31277231 31275184 14,9G 83 Linux > > # cat /dev/sdb | pipebench > /dev/null > Summary: > Piped 14.91 GB in 00h01m34.20s: 162.12 MB/second > > Not tested/benchmarked with the kernel w/o your patch. > > -Sedat- > OK, If there is any problem, let's continue to discuss it and hope it can be merged into the main line. Best Regards, Hongchen Zhang