lkml.org 
[lkml]   [2009]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RESEND] [PATCH] lseek: remove i_mutex

At 05:05 09/02/06, Andrew Morton wrote:
>On Tue, 03 Feb 2009 17:04:40 +0900
>Hisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp> wrote:
>
>> I removed i_mutex from generic_file_llseek.
>> I think that the reason of protecting lseek with i_mutex is just
>> touching i_size atomically.
>>
>> So I introduce i_size_read here so i_mutex is no longer needed.
>>
>> Following patch removes i_mutex from generic_file_llseek, and deletes
>> generic_file_llseek_nolock totally.
>>
>> Currently there is i_mutex contention not only around lseek, but also
>fsync or write.
>> So, I think we can mitigate i_mutex contention between fsync lseek and
>write by
>> removing i_mutex.
>
>Prior to this change, generic_file_llseek() modified file->f_pos
>atomically with respect to other i_mutex holders.
>
>After this change, it doesn't.

Hi Andrew.

Even before this change is applied, file->f_pos access is not atomic.
sys_read change f_pos value through file_pos_write without i_mutex.
I think seqlock is needed to make f_pos access atomic.



\
 
 \ /
  Last update: 2009-02-06 01:25    [W:0.047 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site