Re: [RFC] kill sleep_on
From: Trond Myklebust
Date: Sun Jan 18 2004 - 12:08:58 EST
På su , 18/01/2004 klokka 03:18, skreiv Manfred Spraul:
> I think the purpose of i_sem or lock_kernel is to protect the file
> pointer. Most local filesystems use i_sem, it's noticably faster -
> global vs. per-object locking.
Err... Not in the case where someone else has the file open for writing.
In that case, the i_sem can be held for quite long periods of time 'cos
NFS has to flush out conflicting writes, and it has to serialize w/r
reads on pages.
> Btw, generic_mapping_read should also lock it's accesses to f_pos: right
> now it reads and writes f_pos without any locking...
Is there really any sane application that relies on 2 threads sharing
the same file descriptor, and doing llseek()/read()/write() without some
form of userland serialization mechanism?
It sounds to me as if that is going to be pretty much broken whether or
not we protect the integrity of f_pos in the kernel.
Cheers,
Trond
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/