linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miao Xie <miaox@cn.fujitsu.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH V2 0/6] reduce the lock contention when reading pages
Date: Thu, 25 Jul 2013 19:22:31 +0800	[thread overview]
Message-ID: <1374751357-3327-1-git-send-email-miaox@cn.fujitsu.com> (raw)

Before applying this patchset, we had to do extent state operation by
the block size when reading pages because we need cache the checksum value
of each block into the extent state, it was inefficient and increased the lock
contenttion of extent state. Besides that, the acquisition of the extent map
during the page read was also inefficient, we searched it every time we dealt
with a page.

In fact, if we don't cache the checksum into the extent state, we can batch
those extent state operation to reduce the time of the operations and the lock
contention. Patch 3-5 do this work.

Besides that, the acquisition of the extent map during the page read was also
inefficient, we searched it every time we dealt with a page. In fact, it is
very likely that the extent map objects are the same one. So we can cache
the extent map object to reduce its search time and the lock contention
of the extent map tree. Patch 6 does this work.

I tested this patchset by sysbench on my SSD, it makes the performance of
the random read be faster by ~7%. The lock contention is reduced by ~97%.

Miao Xie (6):
  Btrfs: remove unnecessary argument of bio_readpage_error()
  Btrfs: add branch prediction hints in the read page end IO function
  Btrfs: don't cache the csum value into the extent state tree
  Btrfs: batch the extent state operation in the end io handle of the read page
  Btrfs: batch the extent state operation when reading pages
  Btrfs: cache the extent map struct when reading several pages

 fs/btrfs/btrfs_inode.h |  21 +++
 fs/btrfs/ctree.h       |   4 +-
 fs/btrfs/disk-io.c     |   5 +-
 fs/btrfs/extent_io.c   | 392 ++++++++++++++++++++++++++++++-------------------
 fs/btrfs/extent_io.h   |  10 +-
 fs/btrfs/file-item.c   |  81 ++++++----
 fs/btrfs/inode.c       |  85 +++++------
 fs/btrfs/volumes.h     |   7 +
 8 files changed, 370 insertions(+), 235 deletions(-)

-- 
1.8.1.4


             reply	other threads:[~2013-07-25 11:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25 11:22 Miao Xie [this message]
2013-07-25 11:22 ` [PATCH V2 1/6] Btrfs: remove unnecessary argument of bio_readpage_error() Miao Xie
2013-07-25 11:22 ` [PATCH V2 2/6] Btrfs: add branch prediction hints in the read page end IO function Miao Xie
2013-07-25 11:22 ` [PATCH V2 3/6] Btrfs: don't cache the csum value into the extent state tree Miao Xie
2013-07-25 11:22 ` [PATCH V2 4/6] Btrfs: batch the extent state operation in the end io handle of the read page Miao Xie
2013-07-25 11:22 ` [PATCH V2 5/6] Btrfs: batch the extent state operation when reading pages Miao Xie
2013-07-25 11:22 ` [PATCH V2 6/6] Btrfs: cache the extent map struct when reading several pages Miao Xie

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=1374751357-3327-1-git-send-email-miaox@cn.fujitsu.com \
    --to=miaox@cn.fujitsu.com \
    --cc=linux-btrfs@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).