All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Li Wang <liwang@redhat.com>
Cc: LTP List <ltp@lists.linux.it>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	David Howells <dhowells@redhat.com>
Subject: Re: [LTP] [PATCH v4 3/3] syscalls/pipe2_03: Add new test for pipe2 O_DIRECT flag
Date: Thu, 30 Apr 2020 11:23:34 +0800	[thread overview]
Message-ID: <36bd1e20-414b-ec24-f7e3-16ef7e2395d9@cn.fujitsu.com> (raw)
In-Reply-To: <CAHk-=wg7u4AjZQd49VjrZXikDMfK-HchOKHYqoUFwcXjsbJ3XQ@mail.gmail.com>

Hi Linus


> On Sun, Apr 26, 2020 at 4:59 AM Li Wang <liwang@redhat.com> wrote:
>>
>>  From kernel code seems you are right. The pipe indeed takes use of PAGE_SIZE(ppc64le: 64kB) to split the writes data in the packetized mode (marked by O_DIRECT). But in the manual page, O_DIRECT indicates us the PIPE_BUF is the correct atomic unit.
> 
> The manual is correct.
> 
> PIPE_BUF is the size we _guarantee_ can be used atomically.
> 
> The fact that in practice we do have bigger buffers on some platforms
> is an implementation detail.
> 
> Yes, that implementation detail can be visible, but basically any test
> code that tries to test for "what if we use a bigger bug that
> PIPE_BUF" is buggy. It's simply not guaranteed to work any more.
> 
> O_DIRECT is kind of immaterial, except it's just one of those things
> where the atomic size is slightly more visible. But basically,
> packetized pipes with bigger packets than PIPE_BUF is random behavior.
> It may work. It may not.
Thanks for your explanation. I am more curious about the user scene of 
this flag.

@Li, so how to design this test? In this test, we don't have complex 
scene to test this automic unit.

Best Regards
Yang Xu
> 
>                  Linus
> 
> 



WARNING: multiple messages have this Message-ID (diff)
From: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v4 3/3] syscalls/pipe2_03: Add new test for pipe2 O_DIRECT flag
Date: Thu, 30 Apr 2020 11:23:34 +0800	[thread overview]
Message-ID: <36bd1e20-414b-ec24-f7e3-16ef7e2395d9@cn.fujitsu.com> (raw)
In-Reply-To: <CAHk-=wg7u4AjZQd49VjrZXikDMfK-HchOKHYqoUFwcXjsbJ3XQ@mail.gmail.com>

Hi Linus


> On Sun, Apr 26, 2020 at 4:59 AM Li Wang <liwang@redhat.com> wrote:
>>
>>  From kernel code seems you are right. The pipe indeed takes use of PAGE_SIZE(ppc64le: 64kB) to split the writes data in the packetized mode (marked by O_DIRECT). But in the manual page, O_DIRECT indicates us the PIPE_BUF is the correct atomic unit.
> 
> The manual is correct.
> 
> PIPE_BUF is the size we _guarantee_ can be used atomically.
> 
> The fact that in practice we do have bigger buffers on some platforms
> is an implementation detail.
> 
> Yes, that implementation detail can be visible, but basically any test
> code that tries to test for "what if we use a bigger bug that
> PIPE_BUF" is buggy. It's simply not guaranteed to work any more.
> 
> O_DIRECT is kind of immaterial, except it's just one of those things
> where the atomic size is slightly more visible. But basically,
> packetized pipes with bigger packets than PIPE_BUF is random behavior.
> It may work. It may not.
Thanks for your explanation. I am more curious about the user scene of 
this flag.

@Li, so how to design this test? In this test, we don't have complex 
scene to test this automic unit.

Best Regards
Yang Xu
> 
>                  Linus
> 
> 



  reply	other threads:[~2020-04-30  3:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-22 10:45 [LTP] [PATCH v4 1/3] syscalls/pipe2_01: convert into new API Yang Xu
2020-04-22 10:45 ` [LTP] [PATCH v4 2/3] syscalls/pipe2_02: Add new test for pipe2 O_CLOEXEC flag Yang Xu
2020-04-22 10:45 ` [LTP] [PATCH v4 3/3] syscalls/pipe2_03: Add new test for pipe2 O_DIRECT flag Yang Xu
2020-04-23  8:08   ` Li Wang
2020-04-23  8:45     ` Yang Xu
2020-04-23 10:04       ` Li Wang
2020-04-23 10:30         ` Yang Xu
2020-04-26 11:59           ` Li Wang
2020-04-26 17:45             ` Linus Torvalds
2020-04-26 17:45               ` Linus Torvalds
2020-04-30  3:23               ` Yang Xu [this message]
2020-04-30  3:23                 ` Yang Xu
2020-04-30  6:57                 ` Li Wang
2020-04-26  9:31 ` [LTP] [PATCH v4 1/3] syscalls/pipe2_01: convert into new API Li Wang

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=36bd1e20-414b-ec24-f7e3-16ef7e2395d9@cn.fujitsu.com \
    --to=xuyang2018.jy@cn.fujitsu.com \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.