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

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?
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?

metze


  parent reply	other threads:[~2022-08-16 18:46 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 [this message]
2022-08-17 10:36     ` Pavel Begunkov

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] \
    /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