kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: zhengda1936@gmail.com (Zheng Da)
To: kernelnewbies@lists.kernelnewbies.org
Subject: which local FS supports concurrent direct IO write?
Date: Sun, 15 Jan 2012 16:48:38 -0500	[thread overview]
Message-ID: <CAFLer83YWdkGdLKdvVb-FyfY6frngn3A_pjCYhc-1mi-Rz742w@mail.gmail.com> (raw)
In-Reply-To: <20120115212223.GA59459@Xye>

On Sun, Jan 15, 2012 at 4:22 PM, Raghavendra D Prabhu <
raghu.prabhu13@gmail.com> wrote:

> Hi Zheng,
>
> Interesting analysis.
> * On Sun, Jan 15, 2012 at 03:17:12PM -0500, Zheng Da <
> zhengda1936 at gmail.com> wrote:
>
>> Thanks. I was reading the code of kernel 3.0. XFS starts to support
>> concurrent direct IO since kernel 3.1.5.
>> But concurrent direct IO write still doesn't work well in kernel 3.2.
>>
> From what I have heard it has supported it from sometime back. I think you
> may need to ask in xfs general ML about this.

I didn't know this ML. I'll ask them for help.

>
>  I wrote a test program that accesses a 4G file randomly (read and write),
>> and
>> I ran it with 8 threads and the machine has 8 cores. It turns out that
>> only
>> 1 core is running. I'm pretty sure xfs_rw_ilock is locked
>> with XFS_IOLOCK_SHARED in xfs_file_dio_aio_write.
>>
>> lockstat shows me that there is a lot of wait time in ip->i_lock. It seems
>> the lock is locked exclusively.
>>              &(&ip->i_lock)->mr_lock-W:         31568          36170
>>     0.24       20048.25     7589157.99         130154        3146848
>>     0.00         217.70     1238310.72
>>              &(&ip->i_lock)->mr_lock-R:         11251          11886
>>     0.24       20043.01     2895595.18          46671         526309
>>     0.00          63.80      264097.96
>>              -------------------------
>>                &(&ip->i_lock)->mr_lock          36170
>> [<ffffffffa03be122>] xfs_ilock+0xb2/0x110 [xfs]
>>                &(&ip->i_lock)->mr_lock          11886
>> [<ffffffffa03be15a>] xfs_ilock+0xea/0x110 [xfs]
>>              -------------------------
>>                &(&ip->i_lock)->mr_lock          38555
>> [<ffffffffa03be122>] xfs_ilock+0xb2/0x110 [xfs]
>>                &(&ip->i_lock)->mr_lock           9501
>> [<ffffffffa03be15a>] xfs_ilock+0xea/0x110 [xfs]
>>
>> Then I used systemtap to instrument xfs_ilock and find there are at least
>> 3
>> functions that lock ip->i_lock exclusively during write.
>>
>
> From what I saw in xfs_file_dio_aio_write code, it uses EXCL only if there
> is unaligned IO   or there are cached pages to be invalidated after shared
> lock is obtained *but* it demotes that lock to SHARED just before
> generic_file_direct_write.

 Actually, there are two locks for an inode, i_lock and i_iolock. systemtap
shows me that i_iolock is already locked to SHARED, but i_lock is locked
exclusively somewhere else. Even though I don't think I have found the
right spot that hurts concurrency so badly.

Thanks,
Da
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120115/8c2ff3e1/attachment.html 

      reply	other threads:[~2012-01-15 21:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13 21:41 which local FS supports concurrent direct IO write? Zheng Da
2012-01-14 11:45 ` Raghavendra D Prabhu
2012-01-15 20:17   ` Zheng Da
2012-01-15 21:22     ` Raghavendra D Prabhu
2012-01-15 21:48       ` Zheng Da [this message]

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=CAFLer83YWdkGdLKdvVb-FyfY6frngn3A_pjCYhc-1mi-Rz742w@mail.gmail.com \
    --to=zhengda1936@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.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).