Thread (2 messages) 2 messages, 2 authors, 2002-09-15

Re: kiobuf interface / PG_locked flag

From: Jan Hudec <hidden>
Date: 2002-09-15 15:54:41

On Fri, Sep 13, 2002 at 03:45:41PM +0100, Stephen C. Tweedie wrote:
Hi,

On Fri, Sep 13, 2002 at 02:41:27PM +0200, Jan Hudec wrote:
quoted
Ref-counts protect from swapping out. But it's the PG_locked flag, that
protects from starting other IO. If you are writing, read must not
happen. If you are reading, nothing else at all must happen. So that's
the difference. map_use_kiobuf fault the pages in. lock_kiovec make
sure, that noone (else) is doing ANU IO on the pages.
Depends on what semantics you want.  There's nothing to stop a kiobuf
from being modified in flight.  All the app has to do is create a
thread and modify the buffer from within that thread.
Well, if a multithread application writes to a buffer in one buffer
while doing IO in another, it's asking for trouble. But kernel must make
sure it does not start parallel IO on the same page, so the application
does not get garbage when it behaves correctly (btw, share read-write
mmap will probably get you in trouble anyway - or does kernel modify
PTEs on locking a page?).

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec [off-list ref]
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help