From: Mike Snitzer <snitzer@redhat.com>
To: Jeffle Xu <jefflexu@linux.alibaba.com>
Cc: joseph.qi@linux.alibaba.com, ejt@redhat.com, dm-devel@redhat.com,
agk@redhat.com
Subject: Re: [PATCH v2] dm-thin: wakeup worker only when deferred bios exist
Date: Mon, 18 Nov 2019 10:13:30 -0500 [thread overview]
Message-ID: <20191118151330.GA9830@redhat.com> (raw)
In-Reply-To: <1574041838-92149-1-git-send-email-jefflexu@linux.alibaba.com>
On Sun, Nov 17 2019 at 8:50pm -0500,
Jeffle Xu <jefflexu@linux.alibaba.com> wrote:
> Single thread fio test (read, bs=4k, ioengine=libaio, iodepth=128,
> numjobs=1) over dm-thin device has poor performance versus bare nvme
> disk.
>
> Further investigation with perf indicates that queue_work_on() consumes
> over 20% CPU time when doing IO over dm-thin device. The call stack is
> as follows.
>
> - 40.57% thin_map
> + 22.07% queue_work_on
> + 9.95% dm_thin_find_block
> + 2.80% cell_defer_no_holder
> 1.91% inc_all_io_entry.isra.33.part.34
> + 1.78% bio_detain.isra.35
>
> In cell_defer_no_holder(), wakeup_worker() is always called, no matter
> whether the tc->deferred_bio_list list is empty or not. In single thread
> IO model, this list is most likely empty. So skip waking up worker thread
> if tc->deferred_bio_list list is empty.
>
> A significant IO performance of single thread can be seen with this patch.
> The original IO performance is 448 MiB/s with the fio test previously
> described, while it is 646 MiB/s after applying the patch, which is a
> 44% performance improvement.
>
> Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
> ---
> Changes since V1:
> 1. Check whether tc->deferred_bio_list list is empty or not, rather than
> cell->bios as before.
> 2. Retest the performance with the new version of this patch, and update
> the statistics in the commit message.
I've staged this with slight revisions to the header and renamed the
empty variable to has_work, please see:
https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-5.5&id=d256d796279de0bdc227ff4daef565aa7e80c898
Thanks.
parent reply other threads:[~2019-11-18 15:13 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1574041838-92149-1-git-send-email-jefflexu@linux.alibaba.com>]
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=20191118151330.GA9830@redhat.com \
--to=snitzer@redhat.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=ejt@redhat.com \
--cc=jefflexu@linux.alibaba.com \
--cc=joseph.qi@linux.alibaba.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.