On Thu, 5 Sep 2002, Andrew Morton wrote:
> Linus Torvalds wrote:
> >
> > ...
> > I would suggest:
> >
> > - add a "nr of sectors completed" argument to the "bi_end_io()" function,
> > so that it looks like
> >
> > void xxx_bio_end_io(struct bio *bio, unsigned long completed)
> > {
> > /*
> > * Old completion handlers that don't understand it
> > * should just return immediately for partial bio
> > * completion notifiers
> > */
> > if (bio->b_size)
> > return;
> > ...
> > }
> >
> > which would allow things like mpage_end_io_read() to unlock pages as
> > they complete, instead of unlocking them all in one go.
>
> It's a feature! We don't want to have to soak up 20,000 context
> switches a second just reading a file from an 80MB/sec disk.
You didn't think it through.
The current behaviour is a BUG.
A fast disk driver will _never ever_ do a partial request completion. A
high-performance subsystem will put in the scatter-gather list and say
"go" to the controller, and the controller will send exactly one interrupt
back when it is all done.
So for such a system, you'd never see partial completions anyway.
Partial completions are a feature of slow hardware. And slow hardware is
exactly when we want to know about it.
So my approach has no downsides, only upsides.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Sat Sep 07 2002 - 22:00:25 EST