All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benoit Depail <benoit.depail@nbs-system.com>
To: Keith Busch <keith.busch@intel.com>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>,
	xen-users@lists.xen.org, WebDawg <webdawg@gmail.com>,
	linux-block@vger.kernel.org
Subject: Re: [Xen-users] File-based domU - Slow storage write since xen 4.8
Date: Fri, 21 Jul 2017 12:19:39 +0200	[thread overview]
Message-ID: <3443d6ac-9011-85fb-3613-bacdee184fcc@nbs-system.com> (raw)
In-Reply-To: <20170720173606.GD1202@localhost.localdomain>

On 07/20/17 19:36, Keith Busch wrote:
> On Thu, Jul 20, 2017 at 05:12:33PM +0200, Benoit Depail wrote:
>> ##### Dom0 with a kernel >= 4.4.2, or a custom 4.4.1 including commit
>> d2081cfe624b5decaaf68088ca256ed1b140672c
>>
>> On the dom0:
>> # dd if=/dev/zero of=/mnt/d-anb-nab2.img bs=4M count=1280
>> 1280+0 records in
>> 1280+0 records out
>> 5368709120 bytes (5.4 GB) copied, 46.3234 s, 116 MB/s
>>
>> # dd if=/dev/zero of=/dev/loop1 bs=4M count=1280
>> 1280+0 records in
>> 1280+0 records out
>> 5368709120 bytes (5.4 GB) copied, 44.948 s, 119 MB/s
>>
>> On the domU:
>> # dd if=/dev/zero of=/dev/xvdb bs=4M count=1280
>> 1280+0 records in
>> 1280+0 records out
>> 5368709120 bytes (5.4 GB) copied, 102.943 s, 52.2 MB/s
>>
>>
>> For completeness sake, I'll put my findings below:
>>
>>> I used git bisect on the linux-stable source tree to build (a lot of)
>>> tests kernels, and was able to find this commit as the first one
>>> introducing the regression :
>>>
>>> d2081cfe624b5decaaf68088ca256ed1b140672c is the first bad commit
>>> commit d2081cfe624b5decaaf68088ca256ed1b140672c
>>> Author: Keith Busch <keith.busch@intel.com>
>>> Date:   Tue Jan 12 15:08:39 2016 -0700
>>>
>>>     block: split bios to max possible length
>>>
>>> In term of kernel version, the first one showing bad performances in my
>>> case is 4.4.2 (with, obviously, 4.4.1 working as expected).
>>>
>>> Interestingly, this commit is an improvement of
>>> d3805611130af9b911e908af9f67a3f64f4f0914, which is present in 4.4-rc8
>>> but do not show any performance issue in our case.
>>>
>>> I can also confirm that this issue is still present in the latest
>>> unstable kernel (we tested 4.13-rc1).
> 
> I admit I don't have a good working knowledge of xen block. I've spent a
> few minutes looking over the code, and the best I can tell is that this
> patch will build requests up to 88 blocks ((11 segments * 4k) / 512)
> that would have been fewer blocks without this patch. The resulting bio
> vectors may also have offsets that weren't there before.
> 
> I'm not sure what the significance is. Perhaps it's causing the number
> of grants to exceed BLKIF_MAX_SEGMENTS_PER_REQUEST, which appears to take
> a less optimal path in the code, but I'm not sure why that would only
> harm writes.
> 
> As a test, could you throttle the xvdb queue's max_sectors_kb? If I
> followed xen-blkfront correctly, the default should have it set to 44.
> Try setting it to 40.
> 
>   echo 40 > /sys/block/xvdb/queue/max_sectors_kb
> 

The default value on my domU is 128.

I ran a couple of tests with different values, starting from 40 and up
to 128, clearing the cache between each tests.

The only value that showed the issue is 128. Even setting max_sectors_kb
to 127 is enough to get normal behaviour.

Best regards,

-- 
Benoit Depail
Senior Infrastructures Architect
NBS System

  reply	other threads:[~2017-07-21 10:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5554bd39-6e0a-5c17-2b64-bb80d4a6502b@nbs-system.com>
     [not found] ` <CAKdd5H9f_=NCYMmhLcvHKFw7m_sKvygSVqz3+Z0YPAGiPMxKxQ@mail.gmail.com>
     [not found]   ` <5b562ef2-36e2-a08e-1683-6ffc7cfa54de@nbs-system.com>
     [not found]     ` <20170717124931.rsiqxkzzkmvfofd7@MacBook-Pro-de-Roger.local>
     [not found]       ` <5dd18982-cbcf-a675-1e07-5b4c4e4da50e@nbs-system.com>
     [not found]         ` <20170717164658.drliebetcnil3wjb@dhcp-3-128.uk.xensource.com>
     [not found]           ` <bba4e389-b975-fbb8-b680-c9c4039617ca@nbs-system.com>
2017-07-20  8:52             ` [Xen-users] File-based domU - Slow storage write since xen 4.8 Roger Pau Monné
2017-07-20 15:12               ` Benoit Depail
2017-07-20 15:33                 ` Keith Busch
2017-07-20 15:57                   ` Benoit Depail
2017-07-20 17:36                 ` Keith Busch
2017-07-21 10:19                   ` Benoit Depail [this message]
2017-07-21 15:53                     ` Keith Busch
2017-07-21 16:07                       ` Roger Pau Monné
2017-07-21 17:07                         ` Benoit Depail
2017-07-25 22:25                           ` Keith Busch
2017-07-28 14:50                             ` Benoit Depail
2017-08-01  9:48                               ` Roger Pau Monné
2017-08-02 16:29                                 ` Benoit Depail
2017-08-23 15:54                                   ` Benoit Depail

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=3443d6ac-9011-85fb-3613-bacdee184fcc@nbs-system.com \
    --to=benoit.depail@nbs-system.com \
    --cc=keith.busch@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=roger.pau@citrix.com \
    --cc=webdawg@gmail.com \
    --cc=xen-users@lists.xen.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 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.