From: Hongchen Zhang <zhanghongchen@loongson.cn>
To: sedat.dilek@gmail.com
Cc: Andrew Morton <akpm@linux-foundation.org>,
David Howells <dhowells@redhat.com>,
Matthew Wilcox <willy@infradead.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
"Christian Brauner (Microsoft)" <brauner@kernel.org>,
Luis Chamberlain <mcgrof@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Eric Dumazet <edumazet@google.com>,
"Fabio M. De Francesco" <fmdefrancesco@gmail.com>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] pipe: use __pipe_{lock,unlock} instead of spinlock
Date: Mon, 16 Jan 2023 10:16:36 +0800 [thread overview]
Message-ID: <c896b0f8-e172-625c-59f2-a78c745c92f6@loongson.cn> (raw)
In-Reply-To: <CA+icZUXWAu_+KT9wYfdn7uSp1=ikO5ZdhM2VFokRi_JfhL455Q@mail.gmail.com>
Hi sedat,
On 2023/1/16 am9:52, Sedat Dilek wrote:
> On Fri, Jan 13, 2023 at 10:32 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>
>> On Fri, Jan 13, 2023 at 4:19 AM Hongchen Zhang
>> <zhanghongchen@loongson.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
next prev parent reply other threads:[~2023-01-16 2:16 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-07 1:23 [PATCH v3] pipe: use __pipe_{lock,unlock} instead of spinlock Hongchen Zhang
2023-01-13 3:19 ` Hongchen Zhang
2023-01-13 9:32 ` Sedat Dilek
2023-01-16 1:52 ` Sedat Dilek
2023-01-16 2:16 ` Hongchen Zhang [this message]
2023-01-16 2:42 ` Sedat Dilek
2023-01-16 3:16 ` maobibo
2023-01-16 4:38 ` Matthew Wilcox
2023-01-16 21:10 ` Al Viro
2023-01-16 22:16 ` Andrew Morton
2023-01-17 6:54 ` Sedat Dilek
2023-01-29 2:29 ` Hongchen Zhang
-- strict thread matches above, loose matches on Subject: below --
2023-01-06 9:48 Hongchen Zhang
2023-01-06 19:13 ` Luis Chamberlain
2023-01-06 20:33 ` Sedat Dilek
2023-01-07 3:31 ` Hongchen Zhang
2023-01-07 0:58 ` Hongchen Zhang
2023-01-06 9:28 Hongchen Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c896b0f8-e172-625c-59f2-a78c745c92f6@loongson.cn \
--to=zhanghongchen@loongson.cn \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dhowells@redhat.com \
--cc=edumazet@google.com \
--cc=fmdefrancesco@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=mchehab@kernel.org \
--cc=sedat.dilek@gmail.com \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).