mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Nate Diller" <nate.diller@gmail.com>
To: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
Cc: "Jens Axboe" <jens.axboe@oracle.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [patch] speed up single bio_vec allocation
Date: Thu, 7 Dec 2006 13:46:04 -0800	[thread overview]
Message-ID: <5c49b0ed0612071346g5bccedd5q709e5ba66808c7fc@mail.gmail.com> (raw)
In-Reply-To: <000101c71a37$00b12000$ff0da8c0@amr.corp.intel.com>

On 12/7/06, Chen, Kenneth W <kenneth.w.chen@intel.com> wrote:
> Nate Diller wrote on Thursday, December 07, 2006 11:22 AM
> > > > I still can't help but think we can do better than this, and that this
> > > > is nothing more than optimizing for a benchmark. For high performance
> > > > I/O, you will be doing > 1 page bio's anyway and this patch wont help
> > > > you at all. Perhaps we can just kill bio_vec slabs completely, and
> > > > create bio slabs instead with differing sizes. So instead of having 1
> > > > bio slab and 5 bio_vec slabs, change that to 5 bio slabs that leave room
> > > > for the bio_vec list at the end. That would always eliminate the extra
> > > > allocation, at the cost of blowing the 256-page case into a order 1 page
> > > > allocation (256*16 + sizeof(*bio) > PAGE_SIZE) for the 4kb 64-bit archs,
> > > > which is something I've always tried to avoid.
> > >
> > > I took a quick query of biovec-* slab stats on various production machines,
> > > majority of the allocation is on 1 and 4 segments, usages falls off quickly
> > > on 16 or more.  256 segment biovec allocation is really rare.  I think it
> > > makes sense to heavily bias towards smaller biovec allocation and have
> > > separate biovec allocation for really large ones.
> >
> > what file system?  have you tested with more than one?  have you
> > tested with file systems that build their own bio's instead of using
> > get_block() calls?  have you tested with large files or streaming
> > workloads?  how about direct I/O?
> >
> > i think that a "heavy bias" toward small biovecs is FS and workload
> > dependent, and that it's irresponsible to make such unjustified
> > changes just to show improvement on your particular benchmark.
>
> It is no doubt that the above data is just a quick estimate on one
> usage model. There are tons of other usage in the world.  After all,
> any algorithm in the kernel has to be generic and self tune to
> specific environment.
>
> On very large I/O, the relative overhead in allocating biovec will
> decrease because larger I/O needs more code to do setup, more code
> to perform I/O completion, more code in the device driver etc. So
> time spent on one mempool alloc will amortize over the size of I/O.
> On a smaller I/O size, the overhead is more visible and thus makes
> sense to me to cut down that relative overhead.
>
> In fact, the large I/O already have unfair advantage.  If you do 1MB
> I/O, only 1 call to mempool to get a 256 segment bio.  However if you
> do two 512K I/O, two calls to mempool is made.  So in some sense,
> current scheme is unfair to small I/O.

so that's a fancy way of saying "no, i didn't do any benchmarks", yes?

the current code is straightforward and obviously correct.  you want
to make the alloc/dealloc paths more complex, by special-casing for an
arbitrary limit of "small" I/O, AFAICT.  of *course* you can expect
less overhead when you're doing one large I/O vs. two small ones,
that's the whole reason we have all this code to try to coalesce
contiguous I/O, do readahead, swap page clustering, etc.  we *want*
more complexity if it will get us bigger I/Os.  I don't see why we
want more complexity to reduce the *inherent* penalty of doing smaller
ones.

btw, i am happy to see that you are working on performance, especially
to the degree you reduce overhead by cleaning things up and removing
cruft and unneeded complexity...

NATE

  reply	other threads:[~2006-12-07 21:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-04 19:27 Chen, Kenneth W
2006-12-04 20:06 ` Jens Axboe
2006-12-04 20:36   ` Chen, Kenneth W
2006-12-04 20:43     ` Jens Axboe
2006-12-06 10:08       ` Jens Axboe
2006-12-06 10:56         ` Jens Axboe
2006-12-06 18:19         ` Chen, Kenneth W
2006-12-07 19:22           ` Nate Diller
2006-12-07 19:36             ` Chen, Kenneth W
2006-12-07 21:46               ` Nate Diller [this message]
2006-12-07 21:52                 ` Chen, Kenneth W
2006-12-07 22:33                   ` Nate Diller
2006-12-08  8:01                     ` Jens Axboe
2006-12-08  2:27 ` Andi Kleen
2006-12-08  4:23   ` Chen, Kenneth W
2006-12-08  4:37     ` Andi Kleen
2006-12-08 22:14 Chen, Kenneth W
2006-12-14 20:23 ` Jens Axboe

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=5c49b0ed0612071346g5bccedd5q709e5ba66808c7fc@mail.gmail.com \
    --to=nate.diller@gmail.com \
    --cc=jens.axboe@oracle.com \
    --cc=kenneth.w.chen@intel.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®