lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 9 May 2020 16:57:48 +0800
From:   Baolin Wang <baolin.wang7@...il.com>
To:     Ming Lei <ming.lei@...hat.com>
Cc:     Sagi Grimberg <sagi@...mberg.me>,
        Christoph Hellwig <hch@...radead.org>, axboe@...nel.dk,
        Ulf Hansson <ulf.hansson@...aro.org>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Arnd Bergmann <arnd@...db.de>,
        Linus Walleij <linus.walleij@...aro.org>,
        Paolo Valente <paolo.valente@...aro.org>,
        Orson Zhai <orsonzhai@...il.com>,
        Chunyan Zhang <zhang.lyra@...il.com>,
        linux-mmc <linux-mmc@...r.kernel.org>,
        linux-block <linux-block@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH v2 1/7] block: Extand commit_rqs() to do batch processing

On Sat, May 9, 2020 at 7:22 AM Ming Lei <ming.lei@...hat.com> wrote:
>
> Hi Sagi,
>
> On Fri, May 08, 2020 at 03:19:45PM -0700, Sagi Grimberg wrote:
> > Hey Ming,
> >
> > > > Would it make sense to elevate this flag to a request_queue flag
> > > > (QUEUE_FLAG_ALWAYS_COMMIT)?
> > >
> > > request queue flag usually is writable, however this case just needs
> > > one read-only flag, so I think it may be better to make it as
> > > tagset/hctx flag.
> >
> > I actually intended it to be writable.
> >
> > > > I'm thinking of a possibility that an I/O scheduler may be used
> > > > to activate this functionality rather than having the driver set
> > > > it necessarily...
> > >
> > > Could you explain a bit why I/O scheduler should activate this
> > > functionality?
> >
> > Sure, I've recently seen some academic work showing the benefits
> > of batching in tcp/ip based block drivers. The problem with the
> > approaches taken is that I/O scheduling is exercised deep down in the
> > driver, which is not the direction I'd like to go if we are want
> > to adopt some of the batching concepts.
> >
> > I spent some (limited) time thinking about this, and it seems to
> > me that there is an opportunity to implement this as a dedicated
> > I/O scheduler, and tie it to driver specific LLD stack optimizations
> > (net-stack for example) relying on the commit_rq/bd->last hints.
> >
> > When scanning the scheduler code, I noticed exactly the phenomenon that
> > this patchset is attempting to solve and Christoph referred me to it.
> > Now I'm thinking if we can extend this batching optimization for both
> > use-cases.
>
> Got it, thanks for the sharing.
>
> >
> > > batching submission may be good for some drivers, and currently
> > > we only do it in limited way. One reason is that there is extra
> > > cost for full batching submission, such as this patch requires
> > > one extra .commit_rqs() for each dispatch, and lock is often needed
> > > in this callback.
> >
> > That is not necessarily the case at all.
>
> So far, all in-tree .commit_rqs() implementation requires lock.
>
> >
> > > IMO it can be a win for some slow driver or device, but may cause
> > > a little performance drop for fast driver/device especially in workload
> > > of not-batching submission.
> >
> > You're mostly correct. This is exactly why an I/O scheduler may be
> > applicable here IMO. Mostly because I/O schedulers tend to optimize for
> > something specific and always present tradeoffs. Users need to
> > understand what they are optimizing for.
> >
> > Hence I'd say this functionality can definitely be available to an I/O
> > scheduler should one exist.
> >
>
> I guess it is just that there can be multiple requests available from
> scheduler queue. Actually it can be so for other non-nvme drivers in
> case of none, such as SCSI.
>
> Another way is to use one per-task list(such as plug list) to hold the
> requests for dispatch, then every drivers may see real .last flag, so they
> may get chance for optimizing batch queuing. I will think about the
> idea further and see if it is really doable.

How about my RFC v1 patch set[1], which allows dispatching more than
one request from the scheduler to support batch requests?

[1]
https://lore.kernel.org/patchwork/patch/1210034/
https://lore.kernel.org/patchwork/patch/1210035/

-- 
Baolin Wang

Powered by blists - more mailing lists