Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1958466ima; Thu, 25 Oct 2018 07:34:42 -0700 (PDT) X-Google-Smtp-Source: AJdET5cY1vk02FBY9eLR6/lAsJZnzRYa8T+X473J/wPm6PjQx+WG/xxI5MPmEsROw+BMTdbVI43C X-Received: by 2002:a63:6045:: with SMTP id u66mr1736670pgb.204.1540478082847; Thu, 25 Oct 2018 07:34:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540478082; cv=none; d=google.com; s=arc-20160816; b=KJJvWX0psg/Stx3leVdnPsznsdhO/WE965HgPdwvPQ5igCiexk8VUVxdI6TyDAo7b5 2dJLB/zi5yuyTy3UykoBHHJYpNZICAVs01wFs7fyDVi4KPtufD9fzZ6PNFrrXCECIHxy 4cNhVvzmn5CgkXIxgouN/qPbmJJ7UmU6OI4W1EJetod1UG/ZYsk5DaOowkwpJikGzVYX iLDHU2DmcoCvea4UFlt8HJ0/FBj3GN92pkBOm9ytn3WiTZlmjSdQhyHpfuEV7Dg2vYza pJgmZMB1oqcrIKF0PF9Cyk6pTmtD5CuQ0AXtnfvK1yDQKB7HftAJl4WCF9FHs5rX+AHl 1Nlg== 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=+HzlY1k4slAIhe1YKshJZJ6SZqvHLbxR+aogQPbwhJM=; b=wn2dIR3eaJ8qv68we80XMwxgemoQaeOoa5Fq6VR4T/cFCn0LIKARcdlpPJ4LUGgBqP GTStVIWB14h8HOXsSg9VQy0dU3U3HIAD0gd0zipU3ncVodANTF3EIxqwp+WTfLwSViFR oNRXv6fAFcJ9wsnwikSAG+S87J/uIHvvIhDD6y9hyb9itowNA2kOQSwnwND87/9TUI7l LahojVcHrYmS98GnRLVA8iRXorv3c6aeoVeAJsYyJq5Rr+EK2+oB+oYSh7jYiJrgJfBc T/vJdYJ/i0hISKdtPfnnxApliz022IlcNX/bDJpSO4wiMq3b/VOVzLS61aHpYf2IZhnR 1pQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=fCD7I1df; 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 l26-v6si8207510pgb.251.2018.10.25.07.34.07; Thu, 25 Oct 2018 07:34:42 -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=fCD7I1df; 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 S1730196AbeJYWvd (ORCPT + 99 others); Thu, 25 Oct 2018 18:51:33 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:45543 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729219AbeJYWvb (ORCPT ); Thu, 25 Oct 2018 18:51:31 -0400 Received: by mail-io1-f68.google.com with SMTP id p83-v6so5562621iod.12 for ; Thu, 25 Oct 2018 07:18:33 -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=+HzlY1k4slAIhe1YKshJZJ6SZqvHLbxR+aogQPbwhJM=; b=fCD7I1df6jJKIjxIJc2i9wbIv7COG4NQ3iMbzapAwo4fHX2JsDOGUdDZWRkasopUfO RqISQelVkTy8HWTs/BheN9nYIwr3Blmn0zWy93DTxKtYli434BaLa2KMsmTL7TGB3boV Cfa6jUf5lSILKxi3Oh+7YoOpbZr+hLrrWHBHMKl6pt8KQFVYSBHKCYDFJ9pTUbavEwn7 7G26/4Orom7bd9rr1UnoK95jpNqjVU6tUClt2eWXBKazk5IhkAZxtJmT2Y6ypyHeZDh5 VOuu5td5Tw/mITqDTjySqYFzcpoECzIVBl0McQYHyHnGKfBYeMhz0WgCA7DME731f5Cn Qn4A== 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=+HzlY1k4slAIhe1YKshJZJ6SZqvHLbxR+aogQPbwhJM=; b=afvG0AbFb0Wu60NTEjFk+zJukEs46tudxioJGRTmtwiR+nZUVvQZ5bRUBxDOeMdl2f A5XFsdyWe+dxNGI+CUxUyoeQpX3K8D9R25ONrghg16RQXnBPB5TOhSkMBrAbybeicVyQ nEdTntLnewjMdYNtqQiqK9rU9nz8dAPPV94qgk2xDtWLWGFAyEHre8rG/6LUUzYHJTsc PRs5IaA/hzEfMyq/5xfNUYgA7Xcx9DwJzwXgqHj4ENj6qtwbuXi0DxPPmJ3RKZAmH4ip ftsB0G/Tp+ezklemLPTsRqqJytoE0c3vQQvwuPf1xhAjY0OE2VWz3KdckCjSRT5w7iR3 ziRQ== X-Gm-Message-State: AGRZ1gKBqtFEkfQEAl0U0kFRxSQMrN153mAwhGz6mNx3tTj608M5np1w GtWAfxbcR+NzQw9TdxSm9FvsMA== X-Received: by 2002:a6b:cc05:: with SMTP id c5-v6mr1070976iog.171.1540477112778; Thu, 25 Oct 2018 07:18:32 -0700 (PDT) Received: from [192.168.1.56] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id k5-v6sm623181ita.14.2018.10.25.07.18.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Oct 2018 07:18:31 -0700 (PDT) Subject: Re: [PATCH BUGFIX] block, bfq: fix 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: <20181024171325.7154-1-paolo.valente@linaro.org> From: Jens Axboe Message-ID: <7023bec4-f0dc-2238-25ca-4b76edfeb0f1@kernel.dk> Date: Thu, 25 Oct 2018 08:18:29 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181024171325.7154-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/24/18 11:13 AM, Paolo Valente wrote: > From: Federico Motta > > Since commit 2d29c9f89fcd ("block, bfq: improve asymmetric scenarios > detection"), a scenario is defined asymmetric when one of the > following conditions holds: > - active bfq_queues have different weights > - one or more group of entities (bfq_queue or other groups of entities) > are active > bfq grants fairness and low latency also in such asymmetric scenarios, > by plugging the dispatching of I/O if the bfq_queue in service happens > to be temporarily idle. This plugging may lower throughput, so it is > important to do it only when strictly needed. > > By mystake, in commit '2d29c9f89fcd' ("block, bfq: improve asymmetric > scenarios detection") the num_active_groups counter was firstly > incremented and subsequently decremented at any entity (group or > bfq_queue) weight change. > > This is useless, because only transitions from active to inactive and > vice versa matter for that counter. Unfortunately this is also > incorrect in the following case: the entity at issue is a bfq_queue > and it is under weight raising. In fact in this case there is a > spurious increment of the num_active_groups counter. > > This spurious increment may cause scenarios to be wrongly detected as > asymmetric, thus causing useless plugging and loss of throughput. > > This commit fixes this issue by simply removing the above useless and > wrong increments and decrements. Applied for 4.20, thanks. -- Jens Axboe