Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2284962imm; Sat, 13 Oct 2018 14:41:15 -0700 (PDT) X-Google-Smtp-Source: ACcGV63EAN+1SvfVnx6SegwOHnLIMrYqSSrkMpVLMvI9T99nfonsvT8TClwrzAQo0V5Lwg/Tkndo X-Received: by 2002:a17:902:7613:: with SMTP id k19-v6mr11080088pll.98.1539466875686; Sat, 13 Oct 2018 14:41:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539466875; cv=none; d=google.com; s=arc-20160816; b=nOZQrdj+/8v2lucDm6Tmlok/yh5ml1b6u6H790Bp6zqyc/76ql5Z1Xkk6Dfj66fnEd rjVLGoxfSFDxtHeeZMORMnzbz76zIZtlvF1t8Mj/CByGCEwIxEJarPLsaO8CokfRjpel jFXttbP7z4mOb3xWCerx0+oH3opPRjl6fjb7aWej8eWutf2QmWsayapGJxhWkFl+wRcc O1buCZSCNZtxEKmx4K1X1W8EXYyDjBvaFrTC7eGxjeQrnlJKFomQ5FvOVyFbk5s4TgeU dRzuA4+4F5f+E5b221bHqYa2Hj0KNpuinbB/t8qdPmh4QJQoHJmonMVyhLnuuksU3znX C9/A== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=PYDq7hgBhHOnvbNQWmSrh+MOVU+QnkRRnv/J/5jcuGM=; b=KGlDD9FrTqk6E5dR8tlibd4rWFiusmIWbC3rw7xVUfTruM9QEh3SdEkR5rVGBsjYjb 3j+UPZY4xavzIYkoXdThcXcl4BjxjitMbZbwIWZoSU44a12RdKk+eKrL9za+exPwAUie OCisxkN3tSXfb7Xop9fw+BSqtFWBUIicjZFswykl8i2rfht/yeNZsMWcLqjv/k3YNXdj stX/B6iw11xk1uHlMFdT6ZOcVq+PdWPQxvglNWyj5fYgJ5ls+5Db5LnBYx9bMeFpE1CV 8uhN00k+VVuoeDPCU1Z1IglsOGE+jmXEhRRJpzUw+B3wHB2Ow4e3u4FmhiSvT8w/nf0I KFEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=pblUvn0t; 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 y89-v6si5536320pfa.47.2018.10.13.14.40.59; Sat, 13 Oct 2018 14:41:15 -0700 (PDT) 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; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=pblUvn0t; 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 S1726104AbeJNFTL (ORCPT + 99 others); Sun, 14 Oct 2018 01:19:11 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:40879 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbeJNFTL (ORCPT ); Sun, 14 Oct 2018 01:19:11 -0400 Received: by mail-pl1-f196.google.com with SMTP id 1-v6so7488446plv.7 for ; Sat, 13 Oct 2018 14:40:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=PYDq7hgBhHOnvbNQWmSrh+MOVU+QnkRRnv/J/5jcuGM=; b=pblUvn0t5wNz1NmyuQk2r0sU+i4HXJqsl3x9qdzlhqkcvXSKzg/xKs3vX/p9QvMFIM FhHpjKNzUYZt1qYp9vVPH3nM0DnNX/sGH1TI3jXzPJWKQPCCPUYHoNuUh4pz3pBW+ml7 3bhazUgq6BTgpA//zwmT8HkYMmLuTK8nTEwuPI/d1lpLSdnQ8e0lYsPNhzsvomVC2+/1 KS4OPiuwy9n37eVkr8EpIix4t1cbBCngEkoRTcBplHw6wQ+LaKSigaYJmsYQU97rZrdu gWcklkRXxxSVmg9rdcvpVkSY4GX56T1QMrrjqWFFxTH3yV2Q94/SwZ6lQ1m9r0ZjDfKG PSbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=PYDq7hgBhHOnvbNQWmSrh+MOVU+QnkRRnv/J/5jcuGM=; b=Xa3ybooxsPGw1S/JyexQHCduYIrGH2+VNYqt9xK6X0FMx9Ug8i7atHGcr19sm9vcJ9 4IcJJ4Z2RokKmV2YGQ4EEW6ketLV2rvbsPWtcSY0sfQheR5uMPhrrSlHgvoQTMtFDwXr vbaT/OkoQlexLYxEMbrHQWLR95IMMofcK/3FCZqcD7Npn3asbH5rXNhV5tkrCwEa6IA8 o5wunP9v8UxW3GXmVex60oI7feStGmFPpiDT9+RIAXPpbkuNa/PK4yA4BcWiN5zr5c8n XwrQz6colSzvFQhx/YyGhJoHeBgdzIpogkxgY/J5UDIm/Ge2/VRPSYBGlehuFlyceQed i15A== X-Gm-Message-State: ABuFfohmYBnSW7QndWHV/FBs/ZitCgcsc/klQ6ZZMdw85RLaT3tXWK5Z Zdhz4zsLpcyxfG3q3qw88RUHgQ== X-Received: by 2002:a17:902:aa8f:: with SMTP id d15-v6mr11097511plr.242.1539466834660; Sat, 13 Oct 2018 14:40:34 -0700 (PDT) Received: from [192.168.1.121] (66.29.188.166.static.utbb.net. [66.29.188.166]) by smtp.gmail.com with ESMTPSA id s80-v6sm8742930pfa.114.2018.10.13.14.40.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Oct 2018 14:40:33 -0700 (PDT) Subject: Re: [PATCH] block, bfq: improve asymmetric scenarios detection To: Paolo Valente Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, ulf.hansson@linaro.org, linus.walleij@linaro.org, broonie@kernel.org, bfq-iosched@googlegroups.com, oleksandr@natalenko.name, Federico Motta References: <20181012095557.13744-1-paolo.valente@linaro.org> From: Jens Axboe Message-ID: <5aea7d49-440c-e090-d12c-74db346fb93e@kernel.dk> Date: Sat, 13 Oct 2018 15:40:31 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20181012095557.13744-1-paolo.valente@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/12/18 3:55 AM, Paolo Valente wrote: > From: Federico Motta > > bfq defines as asymmetric a scenario where an active entity, say E > (representing either a single bfq_queue or a group of other entities), > has a higher weight than some other entities. If the entity E does sync > I/O in such a scenario, then bfq plugs the dispatch of the I/O of the > other entities in the following situation: E is in service but > temporarily has no pending I/O request. In fact, without this plugging, > all the times that E stops being temporarily idle, it may find the > internal queues of the storage device already filled with an > out-of-control number of extra requests, from other entities. So E may > have to wait for the service of these extra requests, before finally > having its own requests served. This may easily break service > guarantees, with E getting less than its fair share of the device > throughput. Usually, the end result is that E gets the same fraction of > the throughput as the other entities, instead of getting more, according > to its higher weight. > > Yet there are two other more subtle cases where E, even if its weight is > actually equal to or even lower than the weight of any other active > entities, may get less than its fair share of the throughput in case the > above I/O plugging is not performed: > 1. other entities issue larger requests than E; > 2. other entities contain more active child entities than E (or in > general tend to have more backlog than E). > > In the first case, other entities may get more service than E because > they get larger requests, than those of E, served during the temporary > idle periods of E. In the second case, other entities get more service > because, by having many child entities, they have many requests ready > for dispatching while E is temporarily idle. > > This commit addresses this issue by extending the definition of > asymmetric scenario: a scenario is asymmetric when > - active entities representing bfq_queues have differentiated weights, > as in the original definition > or (inclusive) > - one or more entities representing groups of entities are active. > > This broader definition makes sure that I/O plugging will be performed > in all the above cases, provided that there is at least one active > group. Of course, this definition is very coarse, so it will trigger > I/O plugging also in cases where it is not needed, such as, e.g., > multiple active entities with just one child each, and all with the same > I/O-request size. The reason for this coarse definition is just that a > finer-grained definition would be rather heavy to compute. > > On the opposite end, even this new definition does not trigger I/O > plugging in all cases where there is no active group, and all bfq_queues > have the same weight. So, in these cases some unfairness may occur if > there are asymmetries in I/O-request sizes. We made this choice because > I/O plugging may lower throughput, and probably a user that has not > created any group cares more about throughput than about perfect > fairness. At any rate, as for possible applications that may care about > service guarantees, bfq already guarantees a high responsiveness and a > low latency to soft real-time applications automatically. Thanks, applied. -- Jens Axboe