From: Andrew Morton <akpm@linux-foundation.org>
To: Hisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [RESEND] [PATCH] lseek: remove i_mutex
Date: Thu, 5 Feb 2009 16:33:18 -0800 [thread overview]
Message-ID: <20090205163318.108f6af2.akpm@linux-foundation.org> (raw)
In-Reply-To: <6.0.0.20.2.20090206091511.0764d0a8@172.19.0.2>
On Fri, 06 Feb 2009 09:20:30 +0900
Hisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp> wrote:
>
> 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 know. That's why I specified "with respect to other i_mutex holders".
This patch makes things worse.
At very very minimum the changelog should explain that this patch makes
things worse, and demonstrate why this is justifiable.
> I think seqlock is needed to make f_pos access atomic.
Maybe. Or atomic64_t, or spinlocking, or i_mutex, or something else.
next prev parent reply other threads:[~2009-02-06 0:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-03 8:04 [RESEND] [PATCH] lseek: remove i_mutex Hisashi Hifumi
2009-02-05 20:05 ` Andrew Morton
2009-02-06 0:20 ` Hisashi Hifumi
2009-02-06 0:33 ` Andrew Morton [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-05-14 0:26 [RESEND][PATCH] " Hisashi Hifumi
2009-05-14 5:57 ` Eric Dumazet
2009-06-25 4:41 Hisashi Hifumi
2009-06-25 4:54 ` Al Viro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090205163318.108f6af2.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=hifumi.hisashi@oss.ntt.co.jp \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).