From: Daniel Phillips <phillips@bonn-fries.net>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Andreas Dilger <adilger@turbolabs.com>,
Andrea Arcangeli <andrea@suse.de>,
Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: linux-2.4.10-pre5
Date: Mon, 10 Sep 2001 02:23:11 +0200 [thread overview]
Message-ID: <20010910001556Z16150-26183+680@humbolt.nl.linux.org> (raw)
In-Reply-To: <Pine.LNX.4.33.0109091615570.22033-100000@penguin.transmeta.com>
In-Reply-To: <Pine.LNX.4.33.0109091615570.22033-100000@penguin.transmeta.com>
On September 10, 2001 01:24 am, Linus Torvalds wrote:
> On Sun, 9 Sep 2001, Daniel Phillips wrote:
> >
> > Needed for basic IO functionality:
> > atomic_t b_count; /* users using this block */
> > unsigned long b_state; /* buffer state bitmap (see above) */
> > unsigned long b_blocknr; /* block number */
> > unsigned long b_flushtime; /* Time when (dirty) buffer should be written */
> > struct page *b_page; /* the page this bh is mapped to */
> > struct buffer_head *b_reqnext; /* request queue */
> > wait_queue_head_t b_wait;
> >
> > Can get from mapping:
> > unsigned short b_size; /* block size */
>
> No.
>
> Don't fall into the trap of thinking that blocksizes are constant for a
> mapping.
>
> Yes, they are _right_now_, if only because of limitations of the old
> buffer cache. But it's very very wrong to think you can get the buffer
> size from the mapping.
Well, I'm happy enough to get this far down the list before getting the first
Bzzt. But why do you think we need different blocks sizes in the same
mapping? Maybe NTFS is bizarre enough to need that, but then why not just
have special mappings for the "misc" sizes?
> Besides - we want to be able to do IO _without_ any mappings at all. The
> "iobuf" thing should be completely mapping-independent, in case somebody
> wants to just do raw IO.
>
> Which means that these two:
>
> > kdev_t b_dev; /* device (B_FREE = free) */
> > void (*b_end_io)(struct buffer_head *bh, int uptodate); /* I/O completion */
>
> also have to be in the iobuf anyway, quite regardless of any other issues.
>
> > Could possibly get rid of (with a page cache mapping):
> > struct buffer_head *b_next; /* Hash queue list */
> > struct buffer_head **b_pprev; /* doubly linked list of hash-queue */
>
> Absolutely.
>
> > Used by raid, loop and highmem, could move to request struct:
> > void *b_private; /* reserved for b_end_io */
>
> No. We only have one request struct, and we can have hundreds of buffers
> associated with it. This is very much a iobuf thing.
Yes, duh.
> > Should die:
> > kdev_t b_rdev; /* Real device */
> > unsigned long b_rsector; /* Real buffer location on disk */
>
> No - these are what all the indirect IO code uses.
They're still warts. It would be nice if the various block remappers could
provide their own pool of remapping structs. Note that bounce buffers are
never in the page cache, so there are a
>
> > struct buffer_head *b_next_free;/* lru/free list linkage */
> > struct buffer_head *b_prev_free;/* doubly linked list of buffers */
>
> Right now we keep the dirty list in these. We should drop it eventually,
> and just every time we mark a buffer dirty we also mark the page dirty,
> and then we use the _real_ dirty lists (which are nicely per-inode etc).
>
> > > Maybe we could do without bh->b_count, but it is at least
> > > currently required for backwards compatibility with all the code that
> > > thinks buffer heads are autonomous entities. But I actually suspect it
> > > makes a lot of sense even for a stand-alone IO entity (I'm a firm believer
> > > in reference counting as a way to avoid memory management trouble).
> >
> > Maybe. We might be able to tell from the state flags and the page use count
> > that the buffer head is really freeable.
>
> I doubt it. Almost all data structures that are reachable many ways need
> to have a _count_.
>
> People who think that locking is a way of "pinning" data structures are
> invariably wrong, stupid, and need to get spanked. Reference counts rule.
I didn't want to get rid of it, it's in line with how all the other objects
are handled. It's robust.
> > > Dan, how much of this do you have?
> >
> > Working code? Just the page cache version of ext2_getblk in the directory
> > indexing patch.
>
> Which is probably fine - we could replace the existing getblk with it, and
> do only minor fixups. Maybe.
Yep, maybe. Christoph was looking at trying this idea with vxfs, I should
ping him on that.
> > One observation: the buffer hash link is currently unused for page cache
> > buffers. We could possibly use that for reverse mapping from logical inode
> > blocks to physical device blocks, to combat aliasing.
>
> That still assumes that we have to look them up, which I'd rather avoid.
> Also, I'd rather get rid of the buffer hash link completely, instead of
> making it more confusing..
Just to start you thinking...
> > A spin-off benefit
> > is, the same mechanism could be used to implement a physical readahead
> > cache which can do things that logical readahead can't.
>
> Considering that 99.9% of all disks do this on a lower hardware layer
> anyway, I very much doubt it has any good properties to make software more
> complex by having that kind of readahead in sw.
Well, I already wrote a longer screed on the subject for your Sunday night
reading pleasure ;-)
--
Daniel
next prev parent reply other threads:[~2001-09-10 0:16 UTC|newest]
Thread overview: 94+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-08 4:18 linux-2.4.10-pre5 Linus Torvalds
2001-09-08 6:32 ` linux-2.4.10-pre5: drivers/net/wan compile fixes Eyal Lebedinsky
2001-09-08 6:36 ` 2.4.9-ac10 (not 2.4.10-pre5!) wan fixes Eyal Lebedinsky
2001-09-08 8:32 ` 2.4.10-pre5 compile error George Bonser
2001-09-08 17:19 ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-08 17:30 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-08 17:57 ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-08 18:01 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09 1:09 ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-09 1:20 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09 1:38 ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-09 1:53 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09 2:22 ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-09 2:31 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09 3:30 ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-09 3:58 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09 4:16 ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-09 4:28 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09 12:09 ` linux-2.4.10-pre5 Rik van Riel
2001-09-09 14:53 ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-09 18:17 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09 20:18 ` linux-2.4.10-pre5 H. Peter Anvin
2001-09-10 0:39 ` linux-2.4.10-pre5 Simon Kirby
2001-09-10 8:30 ` linux-2.4.10-pre5 Kai Henningsen
2001-09-11 5:29 ` linux-2.4.10-pre5 Peter Samuelson
2001-09-11 11:29 ` linux-2.4.10-pre5 Kai Henningsen
2001-09-10 21:22 ` linux-2.4.10-pre5 Stephen C. Tweedie
2001-09-09 14:47 ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-09 16:24 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09 17:29 ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-09 23:56 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-09 4:29 ` linux-2.4.10-pre5 Andreas Dilger
2001-09-09 4:54 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09 6:17 ` linux-2.4.10-pre5 Andreas Dilger
2001-09-09 17:31 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09 19:19 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-09 23:24 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-09 23:54 ` linux-2.4.10-pre5 Alan Cox
2001-09-10 0:04 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-10 0:23 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-10 0:23 ` Daniel Phillips [this message]
2001-09-10 0:38 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-10 1:04 ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-10 1:45 ` linux-2.4.10-pre5 Chris Mason
2001-09-10 1:55 ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-10 2:15 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-10 2:20 ` linux-2.4.10-pre5 Chris Mason
2001-09-10 2:40 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-10 3:02 ` linux-2.4.10-pre5 Chris Mason
2001-09-10 3:36 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-10 19:06 ` linux-2.4.10-pre5 Chris Mason
2001-09-10 2:22 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-10 2:02 ` linux-2.4.10-pre5 Chris Mason
2001-09-10 2:06 ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-10 2:03 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-10 2:41 ` linux-2.4.10-pre5 Chris Mason
2001-09-10 21:18 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-10 21:23 ` linux-2.4.10-pre5 Alex Bligh - linux-kernel
2001-09-10 21:54 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-10 22:39 ` linux-2.4.10-pre5 Alex Bligh - linux-kernel
2001-09-10 23:13 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-10 23:25 ` linux-2.4.10-pre5 Alex Bligh - linux-kernel
2001-09-10 22:15 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-10 22:26 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-10 22:39 ` linux-2.4.10-pre5 Rik van Riel
2001-09-10 23:14 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-10 23:16 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-11 0:53 ` linux-2.4.10-pre5 Rik van Riel
2001-09-11 6:39 ` linux-2.4.10-pre5 Hua Zhong
2001-09-11 15:12 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-11 15:44 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-11 15:48 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-11 16:05 ` linux-2.4.10-pre5 Alex Bligh - linux-kernel
2001-09-11 16:07 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-11 16:07 ` linux-2.4.10-pre5 Alex Bligh - linux-kernel
2001-09-11 16:13 ` linux-2.4.10-pre5 Martin Dalecki
2001-09-11 17:17 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-11 10:02 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-11 20:07 ` linux-2.4.10-pre5 Rik van Riel
2001-09-10 23:20 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-11 0:20 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-11 1:16 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-11 2:27 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-11 7:45 ` linux-2.4.10-pre5 Helge Hafting
2001-09-11 10:27 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-11 15:39 ` linux-2.4.10-pre5 Linus Torvalds
2001-09-11 16:52 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-09 19:51 ` linux-2.4.10-pre5 Daniel Phillips
2001-09-09 9:05 ` linux-2.4.10-pre5 Christoph Hellwig
2001-09-09 13:14 ` linux-2.4.10-pre5 Anton Altaparmakov
2001-09-09 14:31 ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-08 21:15 ` linux-2.4.10-pre5 Andreas Dilger
2001-09-09 0:59 ` linux-2.4.10-pre5 Andrea Arcangeli
2001-09-08 22:01 ` linux-2.4.10-pre5 Thiago Vinhas de Moraes
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=20010910001556Z16150-26183+680@humbolt.nl.linux.org \
--to=phillips@bonn-fries.net \
--cc=adilger@turbolabs.com \
--cc=andrea@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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®