lkml.org 
[lkml]   [2000]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Nbd is broken


On Mon, 6 Mar 2000, Andrea Arcangeli wrote:

> On Mon, 6 Mar 2000, Alexander Viro wrote:
>
> >AFAICS the original logics looked so:
> > a) you update ->sector and ->nr_sectors in the same place where
> >you do the IO. E.g. in the interrupt handler.
>
> This make no sense IMHO. Why don't you also update the rest? Without
> updating the rest only updating such two fields is useless. You lose
> synchrony with the fields updating them in different places.

Because that's all you really need for IO within a segment? Notice that
pointer to data is also updated.

> head_active drivers could have no knowledge at all about merging an
> end_request could do all the work as it does when there's an error.

It's not about merging (and predates it, BTW). Just that if request covers
several sectors (block size > 512, absolutely common situation) you _have_
to keep track of the sector number and memory address. And it's either
global variables <bletch>, or allocating structures and storing this thing
there (allocating... deep in the IO path? could you spell "deadlocks"?)
_or_ using the request fields.

> That problem has anything to do with plugging logic. If the request_fn
> blocks dropping the lock even if you avoid plugging you can have merged
> requests in the queue.

Right, but odds went up when plugging was allowed. That's when it became
really visible - no races were required to trigger the thing.

> If we want to provide backwards compatibility we must add a
> "merging" field in the blk_dev_struct and skip the merging path if it's
> set to zero.

Yeah, and we both know how Linus reacts to such ideas. Frankly, I
understand him very well on that - it's _the_ way to nightmarish code.

> >I'm not sure. Updating the ->sector and ->nr_sectors at the actual IO time
> >looks perfectly sane to me. Code in end_request() is rather a "OK, we got
> >an error, so let's skip the rest of this segment" thing.
>
> It's very insane IMHO (see first paragraph).

OK, so where do you keep the current sector number during the IO for
multi-sector bh? Now merging, just a block larger than sector.
end_request() is not going to help you - it's not going to be called after
each sector. Come on, look for this stuff in drivers/block/hd.c.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.042 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site