Re: 2.3.29: ramdisk still broken.

Stephen C. Tweedie (sct@redhat.com)
Tue, 30 Nov 1999 18:19:40 +0000 (GMT)


Hi,

On Mon, 29 Nov 1999 06:03:54 +0100 (CET), Mike Galbraith
<mikeg@weiden.de> said:

> (when I said I'd taken the ramdisk out of the buffer cache, I meant only
> the persistent data.. copied that unconditionally to/from vmalloc'd area
> instead of pegging down buffers. works fine but is slooo)

Slow, perhaps, but it's probably the only way to preserve proper buffer
cache semantics now given the fancy tricks with moving blocks in memory
that the filesystem layers are playing.

> What I'd like to do is to set up an address space (still have to figure
> out exactly howto.. swap_state.c) and use page cache functions to map
> and unmap the incoming data into the ramdisk's address space. Trouble
> is, it looks like a page can only be in one address space.. correct?

Yes.

> For blocksize = PAGE_SIZE ramdisks, I _think_ I could avoid the copy by
> keeping track of allocated blocks and when a write request comes in do
> something like..

> if (block_table[blk] != request_bh->b_page) {
> if (block_table[blk])
> put_page(block_table[blk]);
> get_page(request_bh->b_page);
> block_table[blk] = request_bh->b_page;
> }

That should work, *if* you are sure that there are no other users of the
old buffer_head at the time. You'd have to take the appropriate buffer
cache spinlock to make sure of that.

--Stephen

-
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/