Re: kiobuf interface / PG_locked flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:
> 
> > 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 <bulb@ucw.cz>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux