lkml.org 
[lkml]   [1999]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: parallel writes to the same file, 2.3.7

On 22 Jun 1999, Linus Torvalds wrote:

> In article <Pine.LNX.3.96.990622182153.13031Q-100000@chiara.csoma.elte.hu>,
> Ingo Molnar <mingo@chiara.csoma.elte.hu> wrote:
> >
> >check out block_*_write(), we get the inode semaphore when we allocate new
> >blocks. So most races should be taken care of.
>
> Nope. I removed the semaphore, because it protected the wrong thing.
>
> The semaphore either has to protect _everything_ like it did in 2.2.x,
> or it has to protect the file length changes wrt buffer allocation.
> Protecting writes a page at a time is incorrect, and makes the semaphore
> useless (we do a much better job with the per-page lock bit for that
> kind of protection).

hm, i thought we want to protect preallocated blocks and other 'on the
fly' nonpersistent inode-metadata with the inode semaphore, so we can
later on remove the big kernel lock _and_ the per-filesystem superblock
lock without worrying too much. Now we rely on the superblock semaphore
alone, which is correct but more coarse grained than the inode semaphore i
think. I'm happy with this change nevertheless, my original patch that got
rid of the write semaphore did exactly what we do now, i was just unsure
wether it's correct ;)

> So I decided to just get rid of the semaphore on the write side. There
> are possibly cases we still have to check, but we'll do that with some
> other mechanism. With the semaphore gone, we can do swapping better
> anyway, no need for kpiod.

cool :)

-- mingo


-
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:52    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site