From: Kanchan Joshi <joshiiitr@gmail.com> To: Damien Le Moal <Damien.LeMoal@wdc.com> Cc: "hch@infradead.org" <hch@infradead.org>, Jens Axboe <axboe@kernel.dk>, Pavel Begunkov <asml.silence@gmail.com>, Kanchan Joshi <joshi.k@samsung.com>, "viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>, "bcrl@kvack.org" <bcrl@kvack.org>, Matthew Wilcox <willy@infradead.org>, "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "linux-aio@kvack.org" <linux-aio@kvack.org>, "io-uring@vger.kernel.org" <io-uring@vger.kernel.org>, "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>, "linux-api@vger.kernel.org" <linux-api@vger.kernel.org>, SelvaKumar S <selvakuma.s1@samsung.com>, Nitesh Shetty <nj.shetty@samsung.com>, Javier Gonzalez <javier.gonz@samsung.com>, Johannes Thumshirn <Johannes.Thumshirn@wdc.com> Subject: Re: [PATCH v4 6/6] io_uring: add support for zone-append Date: Fri, 31 Jul 2020 15:08:34 +0530 Message-ID: <CA+1E3rJasyUAcDZZFPjFSckUuLKu7rMkn0bmLJWdywxTC0u-7w@mail.gmail.com> (raw) In-Reply-To: <MWHPR04MB375863C20C1EF2CB27E62703E74E0@MWHPR04MB3758.namprd04.prod.outlook.com> On Fri, Jul 31, 2020 at 1:44 PM Damien Le Moal <Damien.LeMoal@wdc.com> wrote: > > On 2020/07/31 16:59, Kanchan Joshi wrote: > > On Fri, Jul 31, 2020 at 12:29 PM Damien Le Moal <Damien.LeMoal@wdc.com> wrote: > >> > >> On 2020/07/31 15:45, hch@infradead.org wrote: > >>> On Fri, Jul 31, 2020 at 06:42:10AM +0000, Damien Le Moal wrote: > >>>>> - We may not be able to use RWF_APPEND, and need exposing a new > >>>>> type/flag (RWF_INDIRECT_OFFSET etc.) user-space. Not sure if this > >>>>> sounds outrageous, but is it OK to have uring-only flag which can be > >>>>> combined with RWF_APPEND? > >>>> > >>>> Why ? Where is the problem ? O_APPEND/RWF_APPEND is currently meaningless for > >>>> raw block device accesses. We could certainly define a meaning for these in the > >>>> context of zoned block devices. > >>> > >>> We can't just add a meaning for O_APPEND on block devices now, > >>> as it was previously silently ignored. I also really don't think any > >>> of these semantics even fit the block device to start with. If you > >>> want to work on raw zones use zonefs, that's what is exists for. > >> > >> Which is fine with me. Just trying to say that I think this is exactly the > >> discussion we need to start with. What interface do we implement... > >> > >> Allowing zone append only through zonefs as the raw block device equivalent, all > >> the O_APPEND/RWF_APPEND semantic is defined and the "return written offset" > >> implementation in VFS would be common for all file systems, including regular > >> ones. Beside that, there is I think the question of short writes... Not sure if > >> short writes can currently happen with async RWF_APPEND writes to regular files. > >> I think not but that may depend on the FS. > > > > generic_write_check_limits (called by generic_write_checks, used by > > most FS) may make it short, and AFAIK it does not depend on > > async/sync. > > Johannes has a patch (not posted yet) fixing all this for zonefs, > differentiating sync and async cases, allow short writes or not, etc. This was > done by not using generic_write_check_limits() and instead writing a > zonefs_check_write() function that is zone append friendly. > > We can post that as a base for the discussion on semantic if you want... There is no problem in about how-to-do-it. That part is simple - we have the iocb, and sync/async can be known whether ki_complete callback is set. This point to be discussed was whether-to-allow-short-write-or-not if we are talking about a generic file-append-returning-location. That said, since we are talking about moving to indirect-offset in io-uring, short-write is not an issue anymore I suppose (it goes back to how it was). But the unsettled thing is - whether we can use O/RWF_APPEND with indirect-offset (pointer) scheme. > > This was one of the reason why we chose to isolate the operation by a > > different IOCB flag and not by IOCB_APPEND alone. > > For zonefs, the plan is: > * For the sync write case, zone append is always used. > * For the async write case, if we see IOCB_APPEND, then zone append BIOs are > used. If not, regular write BIOs are used. > > Simple enough I think. No need for a new flag. Maybe simple if we only think of ZoneFS (how user-space sends async-append and gets result is a common problem). Add Block I/O in scope - it gets slightly more complicated because it has to cater to non-zoned devices. And there already is a well-established understanding that append does nothing...so code like "if (flags & IOCB_APPEND) { do something; }" in block I/O path may surprise someone resuming after a hiatus. Add File I/O in scope - It gets further complicated. I think it would make sense to make it opt-in rather than compulsory, but most of them already implement a behavior for IOCB_APPEND. How to make it opt-in without new flags. New flags (FMODE_SOME_NAME, IOCB_SOME_NAME) serve that purpose. Please assess the need (for isolation) considering all three cases.
next prev parent reply index Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <CGME20200724155244epcas5p2902f57e36e490ee8772da19aa9408cdc@epcas5p2.samsung.com> 2020-07-24 15:49 ` [PATCH v4 0/6] zone-append support in io-uring and aio Kanchan Joshi [not found] ` <CGME20200724155258epcas5p1a75b926950a18cd1e6c8e7a047e6c589@epcas5p1.samsung.com> 2020-07-24 15:49 ` [PATCH v4 1/6] fs: introduce FMODE_ZONE_APPEND and IOCB_ZONE_APPEND Kanchan Joshi 2020-07-24 16:34 ` Jens Axboe 2020-07-26 15:18 ` Christoph Hellwig 2020-07-28 1:49 ` Matthew Wilcox 2020-07-28 7:26 ` Christoph Hellwig [not found] ` <CGME20200724155324epcas5p18e1d3b4402d1e4a8eca87d0b56a3fa9b@epcas5p1.samsung.com> 2020-07-24 15:49 ` [PATCH v4 2/6] fs: change ki_complete interface to support 64bit ret2 Kanchan Joshi 2020-07-26 15:18 ` Christoph Hellwig [not found] ` <CGME20200724155329epcas5p345ba6bad0b8fe18056bb4bcd26c10019@epcas5p3.samsung.com> 2020-07-24 15:49 ` [PATCH v4 3/6] uio: return status with iov truncation Kanchan Joshi [not found] ` <CGME20200724155341epcas5p15bfc55927f2abb60f19784270fe8e377@epcas5p1.samsung.com> 2020-07-24 15:49 ` [PATCH v4 4/6] block: add zone append handling for direct I/O path Kanchan Joshi 2020-07-26 15:19 ` Christoph Hellwig [not found] ` <CGME20200724155346epcas5p2cfb383fe9904a45280c6145f4c13e1b4@epcas5p2.samsung.com> 2020-07-24 15:49 ` [PATCH v4 5/6] block: enable zone-append for iov_iter of bvec type Kanchan Joshi 2020-07-26 15:20 ` Christoph Hellwig [not found] ` <CGME20200724155350epcas5p3b8f1d59eda7f8fbb38c828f692d42fd6@epcas5p3.samsung.com> 2020-07-24 15:49 ` [PATCH v4 6/6] io_uring: add support for zone-append Kanchan Joshi 2020-07-24 16:29 ` Jens Axboe 2020-07-27 19:16 ` Kanchan Joshi 2020-07-27 20:34 ` Jens Axboe 2020-07-30 16:08 ` Pavel Begunkov 2020-07-30 16:13 ` Jens Axboe 2020-07-30 16:26 ` Pavel Begunkov 2020-07-30 17:16 ` Jens Axboe 2020-07-30 17:38 ` Pavel Begunkov 2020-07-30 17:51 ` Kanchan Joshi 2020-07-30 17:54 ` Jens Axboe 2020-07-30 18:25 ` Kanchan Joshi 2020-07-31 6:42 ` Damien Le Moal 2020-07-31 6:45 ` hch 2020-07-31 6:59 ` Damien Le Moal 2020-07-31 7:58 ` Kanchan Joshi 2020-07-31 8:14 ` Damien Le Moal 2020-07-31 9:14 ` hch 2020-07-31 9:34 ` Damien Le Moal 2020-07-31 9:41 ` hch 2020-07-31 10:16 ` Damien Le Moal 2020-07-31 12:51 ` hch 2020-07-31 13:08 ` hch 2020-07-31 15:07 ` Kanchan Joshi 2020-08-05 7:35 ` Damien Le Moal 2020-08-14 8:14 ` hch 2020-08-14 8:27 ` Damien Le Moal 2020-08-14 12:04 ` hch 2020-08-14 12:20 ` Damien Le Moal 2020-09-07 7:01 ` Kanchan Joshi 2020-09-08 15:18 ` hch 2020-09-24 17:19 ` Kanchan Joshi 2020-09-25 2:52 ` Damien Le Moal 2020-09-28 18:58 ` Kanchan Joshi 2020-09-29 1:24 ` Damien Le Moal 2020-09-29 18:49 ` Kanchan Joshi 2020-07-31 9:38 ` Kanchan Joshi [this message] 2020-07-31 7:08 ` Kanchan Joshi 2020-07-30 15:57 ` 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 \ --in-reply-to=CA+1E3rJasyUAcDZZFPjFSckUuLKu7rMkn0bmLJWdywxTC0u-7w@mail.gmail.com \ --to=joshiiitr@gmail.com \ --cc=Damien.LeMoal@wdc.com \ --cc=Johannes.Thumshirn@wdc.com \ --cc=asml.silence@gmail.com \ --cc=axboe@kernel.dk \ --cc=bcrl@kvack.org \ --cc=hch@infradead.org \ --cc=io-uring@vger.kernel.org \ --cc=javier.gonz@samsung.com \ --cc=joshi.k@samsung.com \ --cc=linux-aio@kvack.org \ --cc=linux-api@vger.kernel.org \ --cc=linux-block@vger.kernel.org \ --cc=linux-fsdevel@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=nj.shetty@samsung.com \ --cc=selvakuma.s1@samsung.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
Linux-api Archive on lore.kernel.org Archives are clonable: git clone --mirror https://lore.kernel.org/linux-api/0 linux-api/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 linux-api linux-api/ https://lore.kernel.org/linux-api \ linux-api@vger.kernel.org public-inbox-index linux-api Example config snippet for mirrors Newsgroup available over NNTP: nntp://nntp.lore.kernel.org/org.kernel.vger.linux-api AGPL code for this site: git clone https://public-inbox.org/public-inbox.git