All of lore.kernel.org
 help / color / mirror / Atom feed
* [QUESTION] Long read latencies on mixed rw buffered IO
@ 2019-03-24 18:18 Amir Goldstein
  2019-03-25  0:10 ` Dave Chinner
  0 siblings, 1 reply; 21+ messages in thread
From: Amir Goldstein @ 2019-03-24 18:18 UTC (permalink / raw)
  To: linux-xfs; +Cc: Christoph Hellwig

[-- Attachment #1: Type: text/plain, Size: 1523 bytes --]

Hi All,

Christoph's re-factoring to xfs_ilock() brought up this question,
but AFAICS, current behavior seems to have always been that
way for xfs (?).

Since commit 6552321831dc ("xfs: remove i_iolock and use
i_rwsem in the VFS inode instead"), xfs_file_buffered_aio_read()
is the only call sites I know of to call generic_file_read_iter() with
i_rwsem read side held.

This lock is killing performance of multi-threaded buffered
read/write mixed workload on the same file [1].
Attached output of bcc tools [2] script xfsdist and ext4dist
for latency distribution on the same mixed read/write workload.
Compared to ext4, avg. read latency on RAID of spindles
can be two orders of magnitude higher (>100ms).
I can provide more performance numbers if needed with fio,
but they won't surprise anyone considering the extra lock.

This workload simulates a performance issue we are seeing
on deployed systems. There are other ways for us to work
around the issue, not using xfs on those systems would be
one way, but I wanted to figure out the reason for this
behavior first.

My question is, is the purpose of this lock syncing
dio/buffered io?
If so, was making this behavior optional via mount option
ever considered for xfs?
Am I the first one who is asking about this specific workload
on xfs (Couldn't found anything on Google), or is this a known
issue/trade off/design choice of xfs?

Thanks,
Amir.

[1] https://github.com/amir73il/filebench/blob/overlayfs-devel/workloads/randomrw.f
[2] https://github.com/iovisor/bcc

[-- Attachment #2: ext4dist.out --]
[-- Type: application/octet-stream, Size: 3928 bytes --]

operation = read
     usecs               : count     distribution
         0 -> 1          : 0        |                                        |
         2 -> 3          : 8        |                                        |
         4 -> 7          : 2610     |****************************************|
         8 -> 15         : 57       |                                        |
        16 -> 31         : 53       |                                        |
        32 -> 63         : 11       |                                        |
        64 -> 127        : 2        |                                        |
       128 -> 255        : 1        |                                        |
       256 -> 511        : 24       |                                        |
       512 -> 1023       : 20       |                                        |
      1024 -> 2047       : 32       |                                        |
      2048 -> 4095       : 232      |***                                     |
      4096 -> 8191       : 632      |*********                               |
      8192 -> 16383      : 925      |**************                          |
     16384 -> 32767      : 408      |******                                  |
     32768 -> 65535      : 129      |*                                       |
     65536 -> 131071     : 86       |*                                       |
    131072 -> 262143     : 106      |*                                       |
    262144 -> 524287     : 95       |*                                       |
    524288 -> 1048575    : 110      |*                                       |
   1048576 -> 2097151    : 21       |                                        |
   2097152 -> 4194303    : 4        |                                        |
   4194304 -> 8388607    : 4        |                                        |
   8388608 -> 16777215   : 0        |                                        |

operation = write
     usecs               : count     distribution
         0 -> 1          : 0        |                                        |
         2 -> 3          : 0        |                                        |
         4 -> 7          : 16732    |*****                                   |
         8 -> 15         : 81712    |**************************              |
        16 -> 31         : 121450   |****************************************|
        32 -> 63         : 29638    |*********                               |
        64 -> 127        : 1271     |                                        |
       128 -> 255        : 171      |                                        |
       256 -> 511        : 126      |                                        |
       512 -> 1023       : 39       |                                        |
      1024 -> 2047       : 6        |                                        |
      2048 -> 4095       : 2        |                                        |
      4096 -> 8191       : 4        |                                        |
      8192 -> 16383      : 48       |                                        |
     16384 -> 32767      : 160      |                                        |
     32768 -> 65535      : 147      |                                        |
     65536 -> 131071     : 73       |                                        |
    131072 -> 262143     : 134      |                                        |
    262144 -> 524287     : 18       |                                        |
    524288 -> 1048575    : 17       |                                        |
   1048576 -> 2097151    : 3        |                                        |
   2097152 -> 4194303    : 10       |                                        |
   4194304 -> 8388607    : 9        |                                        |
   8388608 -> 16777215   : 7        |                                        |

[-- Attachment #3: xfsdist.out --]
[-- Type: application/octet-stream, Size: 3933 bytes --]

operation = 'read'
     usecs               : count     distribution
         0 -> 1          : 8        |***                                     |
         2 -> 3          : 21       |********                                |
         4 -> 7          : 17       |******                                  |
         8 -> 15         : 4        |*                                       |
        16 -> 31         : 0        |                                        |
        32 -> 63         : 0        |                                        |
        64 -> 127        : 0        |                                        |
       128 -> 255        : 0        |                                        |
       256 -> 511        : 0        |                                        |
       512 -> 1023       : 0        |                                        |
      1024 -> 2047       : 1        |                                        |
      2048 -> 4095       : 0        |                                        |
      4096 -> 8191       : 0        |                                        |
      8192 -> 16383      : 4        |*                                       |
     16384 -> 32767      : 8        |***                                     |
     32768 -> 65535      : 17       |******                                  |
     65536 -> 131071     : 55       |*********************                   |
    131072 -> 262143     : 41       |***************                         |
    262144 -> 524287     : 104      |****************************************|
    524288 -> 1048575    : 101      |**************************************  |
   1048576 -> 2097151    : 34       |*************                           |
   2097152 -> 4194303    : 2        |                                        |
   4194304 -> 8388607    : 0        |                                        |
   8388608 -> 16777215   : 4        |*                                       |

operation = 'write'
     usecs               : count     distribution
         0 -> 1          : 0        |                                        |
         2 -> 3          : 0        |                                        |
         4 -> 7          : 10087    |***********                             |
         8 -> 15         : 34815    |****************************************|
        16 -> 31         : 32446    |*************************************   |
        32 -> 63         : 3888     |****                                    |
        64 -> 127        : 155      |                                        |
       128 -> 255        : 10       |                                        |
       256 -> 511        : 12       |                                        |
       512 -> 1023       : 1        |                                        |
      1024 -> 2047       : 0        |                                        |
      2048 -> 4095       : 0        |                                        |
      4096 -> 8191       : 0        |                                        |
      8192 -> 16383      : 3        |                                        |
     16384 -> 32767      : 6        |                                        |
     32768 -> 65535      : 18       |                                        |
     65536 -> 131071     : 60       |                                        |
    131072 -> 262143     : 33       |                                        |
    262144 -> 524287     : 96       |                                        |
    524288 -> 1048575    : 108      |                                        |
   1048576 -> 2097151    : 34       |                                        |
   2097152 -> 4194303    : 4        |                                        |
   4194304 -> 8388607    : 0        |                                        |
   8388608 -> 16777215   : 4        |                                        |


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2025-06-20 13:46 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-24 18:18 [QUESTION] Long read latencies on mixed rw buffered IO Amir Goldstein
2019-03-25  0:10 ` Dave Chinner
2019-03-25  6:51   ` Christoph Hellwig
2019-03-25  6:55     ` Amir Goldstein
2019-03-25  7:49   ` Amir Goldstein
2019-03-25 15:47     ` Darrick J. Wong
2019-03-25 16:41       ` Matthew Wilcox
2019-03-25 17:30         ` Amir Goldstein
2019-03-25 18:22           ` Matthew Wilcox
2019-03-25 19:18             ` Amir Goldstein
2019-03-25 19:40               ` Matthew Wilcox
2019-03-25 19:57                 ` Amir Goldstein
2019-03-25 23:48                   ` Dave Chinner
2019-03-26  3:44                     ` Amir Goldstein
2019-03-27  1:29                       ` Dave Chinner
2019-03-25 17:56       ` Amir Goldstein
2019-03-25 18:02         ` Christoph Hellwig
2019-03-25 18:44           ` Amir Goldstein
2019-03-25 23:43     ` Dave Chinner
2019-03-26  4:36       ` Amir Goldstein
2025-06-20 13:46   ` [PATCH] xfs: Remove i_rwsem lock in buffered read Jinliang Zheng

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.