From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: KY Srinivasan <kys@microsoft.com>
Cc: Dexuan Cui <decui@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
"devel\@linuxdriverproject.org" <devel@linuxdriverproject.org>,
"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 5/6] Drivers: hv: vmbus: distribute subchannels among all vcpus
Date: Mon, 27 Apr 2015 15:30:23 +0200 [thread overview]
Message-ID: <87oam9snps.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <BN1PR0301MB0707CF5E57279A9E0244684AA0EC0@BN1PR0301MB0707.namprd03.prod.outlook.com> (KY Srinivasan's message of "Fri, 24 Apr 2015 16:46:52 +0000")
KY Srinivasan <kys@microsoft.com> writes:
>> -----Original Message-----
>> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
>> Sent: Friday, April 24, 2015 2:05 AM
>> To: Dexuan Cui
>> Cc: KY Srinivasan; Haiyang Zhang; devel@linuxdriverproject.org; linux-
>> kernel@vger.kernel.org
>> Subject: Re: [PATCH 5/6] Drivers: hv: vmbus: distribute subchannels among
>> all vcpus
>>
>> Dexuan Cui <decui@microsoft.com> writes:
>>
>> >> -----Original Message-----
>> >> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
>> >> Sent: Tuesday, April 21, 2015 22:28
>> >> To: KY Srinivasan
>> >> Cc: Haiyang Zhang; devel@linuxdriverproject.org; linux-
>> >> kernel@vger.kernel.org; Dexuan Cui
>> >> Subject: [PATCH 5/6] Drivers: hv: vmbus: distribute subchannels among all
>> >> vcpus
>> >>
>> >> Primary channels are distributed evenly across all vcpus we have. When
>> the
>> >> host asks us to create subchannels it usually makes us num_cpus-1 offers
>> >
>> > Hi Vitaly,
>> > AFAIK, in the VSP of storvsc, the number of subchannel is
>> > (the_number_of_vcpus - 1) / 4.
>> >
>> > This means for a 8-vCPU guest, there is only 1 subchannel.
>> >
>> > Your new algorithm tends to make the vCPUs with small-number busier:
>> > e.g., in the 8-vCPU case, assuming we have 4 SCSI controllers:
>> > vCPU0: scsi0's PrimaryChannel (P)
>> > vCPU1: scsi0's SubChannel (S) + scsi1's P
>> > vCPU2: scsi1's S + scsi2's P
>> > vCPU3: scsi2's S + scsi3's P
>> > vCPU4: scsi3's S
>> > vCPU5, 6 and 7 are idle.
>> >
>> > In this special case, the existing algorithm is better. :-)
>> >
>> > However, I do like this idea in your patch, that is, making sure a device's
>> > primary/sub channels are assigned to differents vCPUs.
>>
>> Under special circumstances with the current code we can end up with
>> having all subchannels on the same vCPU with the primary channel I guess
>> :-) This is not something common, but possible.
>>
>> >
>> > I'm just wondering if we should use an even better (and complex)
>> > algorithm :-)
>>
>> The question here is - does sticking to the current vCPU help? If it
>> does, I can suggest the following (I think I even mentioned that in my
>> PATCH 00): first we try to find a (sub)channel with target_cpu ==
>> current_vcpu and only when we fail we do the round robin. I'd like to
>> hear K.Y.'s opinion here as he's the original author :-)
>
> Sorry for the delayed response. Initially I had implemented a scheme that would
> pick an outgoing CPU that was closest to the CPU on which the request came (to maintain
> cache locality especially on NUMA systems). I changed this algorithm to spread the load
> more uniformly as we were trying to improve Linux IOPS on Azure XIO
> (premium storage). We are currently testing
> this code on our Converged Offering - CPS and I am finding that the perf as measured by IOS has regressed.
> I have not narrowed the reason for this regression and it may very well be the change in the
> algorithm for selecting the outgoing channel. In general, I don't think the logic here needs to be
> exact and locality (being on the same CPU or within the same NUMA node) is important. Any change
> to this algorithm will have to be validated on different MSFT
> environments (Azure XIO, CPS etc.).
Thanks, can you please compare two algorythms here:
1) Simple round robin (the one my patch series implement but with issues
fixed, I'll send v2).
2) Try to find a (sub)channel with matching VCPU and round-robin when we
fail (I can actually include it in v2).
We can later decide something based on these testing results.
>
> Regards,
>
> K. Y
--
Vitaly
next prev parent reply other threads:[~2015-04-27 13:30 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-21 14:27 [PATCH 0/6] Drivers: hv: vmbus: fair round robin algorithm for vmbus_get_outgoing_channel() Vitaly Kuznetsov
2015-04-21 14:27 ` [PATCH 1/6] Drivers: hv: vmbus: unify calls to percpu_channel_enq() Vitaly Kuznetsov
2015-04-21 14:27 ` [PATCH 2/6] Drivers: hv: vmbus: briefly comment num_sc and next_oc Vitaly Kuznetsov
2015-04-21 14:27 ` [PATCH 3/6] Drivers: hv: vmbus: decrease num_sc on subchannel removal Vitaly Kuznetsov
2015-04-24 7:02 ` Dexuan Cui
2015-04-24 8:40 ` Vitaly Kuznetsov
2015-04-21 14:27 ` [PATCH 4/6] Drivers: hv: vmbus: move init_vp_index() call to vmbus_process_offer() Vitaly Kuznetsov
2015-04-24 8:38 ` Dexuan Cui
2015-04-24 8:46 ` Vitaly Kuznetsov
2015-04-21 14:27 ` [PATCH 5/6] Drivers: hv: vmbus: distribute subchannels among all vcpus Vitaly Kuznetsov
2015-04-24 8:40 ` Dexuan Cui
2015-04-24 9:05 ` Vitaly Kuznetsov
2015-04-24 16:46 ` KY Srinivasan
2015-04-27 13:30 ` Vitaly Kuznetsov [this message]
2015-04-27 18:09 ` KY Srinivasan
2015-04-21 14:27 ` [PATCH 6/6] Drivers: hv: vmbus: do a fair round robin when selecting an outgoing channel Vitaly Kuznetsov
2015-04-24 8:42 ` Dexuan Cui
2015-04-24 8:59 ` Vitaly Kuznetsov
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=87oam9snps.fsf@vitty.brq.redhat.com \
--to=vkuznets@redhat.com \
--cc=decui@microsoft.com \
--cc=devel@linuxdriverproject.org \
--cc=haiyangz@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@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