All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jensen <shencanquan@huawei.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: llseek requires to ocfs2 inode lock for the file in SEEK_END
Date: Thu, 27 Jun 2013 16:56:56 +0800	[thread overview]
Message-ID: <51CBFE58.1060104@huawei.com> (raw)
In-Reply-To: <CAEeiSHV=3DBBJ1mweEgyxWRgsA9O8C-25_FTPMxyDbatoX0Fkw@mail.gmail.com>

On 2013/6/27 11:34, Sunil Mushran wrote:

> AFAIR, this behavior has been there since day 1 and changing it will impact performance negatively. I would recommend against making this
> change for one app.
> 

I think it will impact the performance negatively. but I think it is very
very little, because in cluster lock function, the inode size will update
from dlm in lvb. and it don't update by disk (another machine write file
size to disk and this machine read file size from disk to update the inode size)

if the file size update by disk. I think it will impact the performance very much.

> 
> On Wed, Jun 26, 2013 at 6:50 PM, shencanquan <shencanquan at huawei.com <mailto:shencanquan@huawei.com>> wrote:
> 
>     On 2013/6/27 9:25, Andrew Morton wrote:
> 
>     > On Thu, 27 Jun 2013 09:19:52 +0800 shencanquan <shencanquan at huawei.com <mailto:shencanquan@huawei.com>> wrote:
>     >
>     >> On 2013/6/27 5:18, Andrew Morton wrote:
>     >>
>     >>>
>     >>> My guess is that there is some other code path which is modifying
>     >>> inode->i_size without holding inode->i_mutex, and while holding
>     >>> ocfs2_inode_lock().  If so, that code is surely wrong - it should hold
>     >>> i_mutex while modifying i_size.
>     >>
>     >>
>     >> inode->i_mutex lock only protect the inode size on the same machine.
>     >
>     > ah ;)
>     >
>     >>> And all this is only really applicable to 32-bit CPUs, which you
>     >>> probably aren't using.
>     >>
>     >> I don't understand this.
>     >
>     > The i_size_read/i_size_write infrastructure is designed to efficiently
>     > handle the situation where a 32-bit machine reads a 64-bit number which
>     > might be undergoing modification on another CPU.  We don't want the
>     > reading CPU to see an invalid number when the writing CPU is in the
>     > middle of modifying the two 32-bit words.
>     >
>     >
>     >
> 
>     ok. thanks.
> 
> 
>     _______________________________________________
>     Ocfs2-devel mailing list
>     Ocfs2-devel at oss.oracle.com <mailto:Ocfs2-devel@oss.oracle.com>
>     https://oss.oracle.com/mailman/listinfo/ocfs2-devel
> 
> 

  reply	other threads:[~2013-06-27  8:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20  8:23 [Ocfs2-devel] [PATCH] ocfs2: llseek requires to ocfs2 inode lock for the file in SEEK_END shencanquan
2013-06-26 21:18 ` Andrew Morton
2013-06-27  1:19   ` shencanquan
2013-06-27  1:25     ` Andrew Morton
2013-06-27  1:50       ` shencanquan
2013-06-27  3:34         ` Sunil Mushran
2013-06-27  8:56           ` Jensen [this message]
2013-06-27 22:08           ` Andrew Morton
2013-06-27 22:59             ` Sunil Mushran
2013-06-28  9:11               ` Jeff Liu
2013-06-29 13:28                 ` Joel Becker
2013-06-29 13:37 ` Joel Becker
2013-07-01  1:38   ` Jensen
2013-07-02 19:58     ` Mark Fasheh
2013-07-02 21:19       ` Joel Becker

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=51CBFE58.1060104@huawei.com \
    --to=shencanquan@huawei.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.