Received: by 10.223.176.46 with SMTP id f43csp1133909wra; Wed, 24 Jan 2018 11:10:28 -0800 (PST) X-Google-Smtp-Source: AH8x224BiahV4skg/QgZJygjaKkJ1lYFK7l1JVYB3e1yfcLsCQ3Ipkhc3Um5y/J3oVBYOZ4DdeyR X-Received: by 10.99.122.15 with SMTP id v15mr11242468pgc.175.1516821028841; Wed, 24 Jan 2018 11:10:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516821028; cv=none; d=google.com; s=arc-20160816; b=eENjwNZJEp/eNzTmE7Y2sWHbt0pk8gXi61cFfuokrvf04gRG7rHQ7CriPppDkO3BG3 uB8gSyvrJNZ3KT2Dk86fr0GY4MVbDx88GGdoE+RsF/UpKbZ+aaZffT3TKZInCvIEUntU cZ6A6k3SwnLY+o3B6G1jZjSk/ui3ZUDKxtotgEVvWsUz/SeZszY+rbaGPZ5QItLtTxJU DDEUmLxJ7gptAjVqTeZi6RPtwXYcs9G9M+VGo/oL35QzNBxHruoRYd5zyG3OAUISKKeH 3PtDuOINPKaLBWnNKOLFym6/Jfrr5a26kFfLelUdy4nRAhYZsWJhN773nglFANweLSDv Dftw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=aS8h1MUD/Xd02D0MbGvyw1x5IbU0feq2f7MLM14FfXQ=; b=J5nlD6mNdPCoxgqc3Ckft/Ms7dE6Nt7pREAv9o8k+QAmxC8S0d1gB5HtHzasuOKo43 ylPpIksLw7joxGQy5cI2NmKrtldhWRJsfpKDBFkLpvDUpgM6q2y+lkirDc8feU09ddoT RHGC1l1n3E5UOINmkI52yT3GYKmD5BH7x82WqlI2H83PSQ8dG3FXcelRdPAdCuQQpDnQ mBCrWnREBEWOdJSOVmWi+7tDICXRYM6eBF/7CKEzebOr9uppbVFhdvaW0Rk71PT/2AfK vAO1QVJQ4WLJhd1npg+O0MuMmqoX8PaZuiUn3L3njFJoRcidd0fNTAoahojNNXSg1g+2 BFRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v203si472509pgb.474.2018.01.24.11.10.14; Wed, 24 Jan 2018 11:10:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965107AbeAXTJl (ORCPT + 99 others); Wed, 24 Jan 2018 14:09:41 -0500 Received: from prv3-mh.provo.novell.com ([137.65.250.26]:45830 "EHLO prv3-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964999AbeAXTJk (ORCPT ); Wed, 24 Jan 2018 14:09:40 -0500 Received: from [192.168.1.40] (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (TLS encrypted); Wed, 24 Jan 2018 12:09:30 -0700 Message-ID: <1516820965.6927.10.camel@suse.com> Subject: Re: [dm-devel] [PATCH] dm mpath selector: more evenly distribute ties From: Martin Wilck To: Khazhismel Kumykov Cc: agk@redhat.com, snitzer@redhat.com, dm-devel@redhat.com, linux-kernel@vger.kernel.org Date: Wed, 24 Jan 2018 20:09:25 +0100 In-Reply-To: References: <20180119230737.133596-1-khazhy@google.com> <1516791437.6678.6.camel@suse.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.4 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-01-24 at 10:44 -0800, Khazhismel Kumykov wrote: > On Wed, Jan 24, 2018 at 2:57 AM, Martin Wilck > wrote: > > On Fri, 2018-01-19 at 15:07 -0800, Khazhismel Kumykov wrote: > > > Move the last used path to the end of the list (least preferred) > > > so > > > that > > > ties are more evenly distributed. > > > > > > For example, in case with three paths with one that is slower > > > than > > > others, the remaining two would be unevenly used if they tie. > > > This is > > > due to the rotation not being a truely fair distribution. > > > > > > Illustrated: paths a, b, c, 'c' has 1 outstanding IO, a and b are > > > 'tied' > > > Three possible rotations: > > > (a, b, c) -> best path 'a' > > > (b, c, a) -> best path 'b' > > > (c, a, b) -> best path 'a' > > > (a, b, c) -> best path 'a' > > > (b, c, a) -> best path 'b' > > > (c, a, b) -> best path 'a' > > > ... > > > > > > This happens only if a and b actually have the same weight (e.g. > > queue > > length for the queue-length selector). If 'a' really receives more > > IO, > > its queue grows, and the selector will start preferring 'b', so the > > effect should level out automatically with the current code as soon > > as > > you have real IO going on. But maybe I haven't grasped what you're > > referring to as "tied". > > Yes, for "tied" I'm referring to paths with the same weight. As queue > length grows it does tend to level out, but in the case where queue > length doesn't grow (in this example I'm imagining 2 concurrent > requests to the device) the bias does show and the selectors really > do > send 'a' 2x more requests than 'b' (when 'c' is much slower and 'a' > and 'b' are ~same speed). Have you actually observed this? I find the idea pretty academical that two paths would be walking "tied" this way. In practice, under IO load, I'd expect queue lengths (and service-times, for that matter) to fluctuate enough to prevent this effect to be measurable. But of course, I may be wrong. If you really did observe this, the next question would be: does hurt performance to an extent that can be noticed/measured? I reckon that if 'a' got saturated under the load, hurting performance, its queue length would grow quickly and 'b' would automatically get preferred. > > OTOH, if the "best" path has much lower queue length than the other > > paths for whatever reason, your pushing it to the tail will require > > a > > full list walk with every new call of the selector. I see tjat as a > > small disadvantage of your approach. > > I see, with best at the tail, we would not see as much benefit from > the check if a path has no IOs on it in queue-length. In service-time > no such short circuit exists, so I don't believe anything changes > there. Am I understanding this correctly? Forget that. I was confused. We're walking the entire list every time anyway, except for the . I find it strange to put the best candidate to the tail every time, but I can't prove that it really hurts. Martin -- Dr. Martin Wilck , Tel. +49 (0)911 74053 2107 SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg)