public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Stefan Metzmacher <[email protected]>, Jens Axboe <[email protected]>,
	Artyom Pavlov <[email protected]>,
	[email protected]
Subject: Re: Adding read_exact and write_all OPs?
Date: Wed, 17 Aug 2022 11:36:33 +0100	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 8/16/22 19:46, Stefan Metzmacher wrote:
> Hi Jens,
> 
>>> In application code it's quite common to write/read a whole buffer and
>>> only then continue task execution. The traditional approach is to wrap
>>> read/write sycall/OP in loop, which is often done as part of a
>>> language std. In synchronous context it makes sense because it allows
>>> to process things like EINTR. But in asynchronous (event-driven)
>>> context I think it makes a bit less sense.
>>>
>>> What do you think about potential addition of OPs like read_exact and
>>> write_all, i.e. OPs which on successful CQE guarantee that an input
>>> buffer was processed completely? They would allow to simplify user
>>> code and in some cases to significantly reduce ring traffic.
>>
>> That may make sense, and there's some precedence there for sockets with
>> the WAITALL flags.
> 
> I remember we got short reads/writes from some early kernel versions
> and had to add a retry in samba.
> 
> But don't we already have a retry in current kernels?

Right, both short reads and writes will be retried when possible. Not
all file types are covered but fs and block should be fine. We also try
to handle short send/recv.

> At least for the need_complete_io() case?
> io_rw_should_reissue() also seem to be related and also handles S_ISREG,
> but it's hidden behind CONFIG_BLOCK.
> 
> Are there really systems without CONFIG_BLOCK?

-- 
Pavel Begunkov

      reply	other threads:[~2022-08-17 10:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02 21:04 Adding read_exact and write_all OPs? Artyom Pavlov
2022-08-03 15:01 ` Jens Axboe
2022-08-16 17:11   ` Artyom Pavlov
2022-08-16 18:46   ` Stefan Metzmacher
2022-08-17 10:36     ` Pavel Begunkov [this message]

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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