[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c896b0f8-e172-625c-59f2-a78c745c92f6@loongson.cn>
Date: Mon, 16 Jan 2023 10:16:36 +0800
From: Hongchen Zhang <zhanghongchen@...ngson.cn>
To: sedat.dilek@...il.com
Cc: Andrew Morton <akpm@...ux-foundation.org>,
David Howells <dhowells@...hat.com>,
Matthew Wilcox <willy@...radead.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
"Christian Brauner (Microsoft)" <brauner@...nel.org>,
Luis Chamberlain <mcgrof@...nel.org>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Eric Dumazet <edumazet@...gle.com>,
"Fabio M. De Francesco" <fmdefrancesco@...il.com>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] pipe: use __pipe_{lock,unlock} instead of spinlock
Hi sedat,
On 2023/1/16 am9:52, Sedat Dilek wrote:
> On Fri, Jan 13, 2023 at 10:32 AM Sedat Dilek <sedat.dilek@...il.com> wrote:
>>
>> On Fri, Jan 13, 2023 at 4:19 AM Hongchen Zhang
>> <zhanghongchen@...ngson.cn> 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
Powered by blists - more mailing lists