Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp475168imc; Sun, 10 Mar 2019 11:14:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqy9qrGUHuQSJgf9dutgURWuk/xkpDAv6xxe2AFIb3xcMs9V4B7K2bBiFoVGtphpg1/9Q1xP X-Received: by 2002:a63:c04a:: with SMTP id z10mr13065552pgi.115.1552241644155; Sun, 10 Mar 2019 11:14:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552241644; cv=none; d=google.com; s=arc-20160816; b=RCV7hnq4/jMkM6J/+RNYbjYdEeOeeJwPq9DVlww3O7424Eyw671Cz4sl3+Ss9RI0E9 chqujQ/6sXDFfX9MpNmhk2bZ8M6KFrGih3zBkgsPdgU8UCBZ6kztISY8of5qP8PIHAIO kv19BV+rK7EnC6B0OKg1I+J/6c2VbnbPW0HMBLdM6Axj822HREJCm3slH0DqsI/i1ocD YzBuqrMOjHbYHM+/hj30gw28sGqkCcBS2/Irty9IBbQa75kw/WYD76AxIWFsb8WSituz N/ovzs/My7EcBS70fdjAx6h/Wb89cOZoR7EXTSTe/LUFlUxAMfUnHr+izdRSLAbHXMkb YPag== 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:message-id:date:subject:cc:to:from :dkim-signature; bh=QUHw4uD/6PdjAyafvFS/vFaSGIdhMTKmdDdLyjrgLw8=; b=q76570r4ElwED0u4RsEfRPrgSva/PF61yP37qyfh8MFWhIAQoIYM8cnC6BLhZruQgP 07vIszdXRDJufi1q3oRPQ3xJZD338uZzJSOOgM3fIc28bWs3A9U0BeOk4107n4Zd/G5X 7TMuoazJbvzAuspg86iJfZ1O2rM6E0BPswLG4g3VE5Uu6rJeF2WEEYix6mmS4sw0DpIV +gfiOdYhHnOKLPI6L0DEvT8wIqua1vuXiY023HBaTJhusc40ProTOPk+zXCySNJq+x3h w0VlmlN4amODfXZoFNytMDTeNDpYy/sodl+kTH7TOr8NpcmHNc37AJB8h84p9lmkC5WE sI0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gtdmQx2Z; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a7si3188164pfn.167.2019.03.10.11.13.48; Sun, 10 Mar 2019 11:14:04 -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=@linaro.org header.s=google header.b=gtdmQx2Z; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726941AbfCJSMY (ORCPT + 99 others); Sun, 10 Mar 2019 14:12:24 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:37623 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726905AbfCJSMW (ORCPT ); Sun, 10 Mar 2019 14:12:22 -0400 Received: by mail-wr1-f68.google.com with SMTP id y15so833968wro.4 for ; Sun, 10 Mar 2019 11:12:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QUHw4uD/6PdjAyafvFS/vFaSGIdhMTKmdDdLyjrgLw8=; b=gtdmQx2Zk6ww/kOS2ogjkJUpLQtwK3crXM1AJgeofygnkUT9nw5qv9MWszMcLDTTSP StOKhxeSNxBCEBcshrFDwNaO6mALCJqcW761baZGdJKTvJWE7vU4n1QYsPY0+MwPDgUu 9JnnWzfKHLu4V0NpzpirdIO4vYfwx4dObLII9rGtWnJpw6cHBgdgDxx4pf363mXXQizX lxGG5cvUbIyDnayRqgBml8xHhJAU62O7YsDv2IoqeZcn/zDOzfsfX8PMXm524exgiwvN jZg+tcLcHZd7W+Mpxf+z8LoeZ4H1z9WHmNaJfY5ON16KIo6CoQP0fZ4KMafXsyCU5EVD VF/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QUHw4uD/6PdjAyafvFS/vFaSGIdhMTKmdDdLyjrgLw8=; b=gg4ChADhH7tTf1QiaqTCvnE2GtJTZ5zIx7pfnUyt2RmobMeBjGz6jMABeRt6t8YJro 8dYr+9POmD/34KK0q90xMH4/nQMSf3OLpfQQR6oLTeJZuduJ1/2D6iQVFsf1QRR0/zgE 3UgaMRdr5KLrhnaJq5I0hrE+8q427842ZwV8OIvnmfjEXqcuu0uguL/1GpvIQY8fzixR TIjajT32bMNuQxtJSRhwMWjx6TMBv/Oaxf2O+E78mTr7O9oQ6d4sQAoqhILwJm+sObW/ TqmVlcSjJhlIZS/U6fwa+nWiPeb6mxkkUhMNv0S1wo/cHM2DzipGn2iwAv8Bbn8K5XSl 3QIA== X-Gm-Message-State: APjAAAXmMhy2sqewPUvWtDrNGH6MzfkmDuIq7ywiQGBGqEtXwR84nSAU KOys1WymFOb/g+2H7XGA5y6C3w== X-Received: by 2002:adf:dd12:: with SMTP id a18mr16495341wrm.4.1552241540362; Sun, 10 Mar 2019 11:12:20 -0700 (PDT) Received: from localhost.localdomain (146-241-67-113.dyn.eolo.it. [146.241.67.113]) by smtp.gmail.com with ESMTPSA id d206sm24906368wmc.11.2019.03.10.11.12.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Mar 2019 11:12:19 -0700 (PDT) From: Paolo Valente To: Jens Axboe 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, fra.fra.800@gmail.com, alessio.masola@gmail.com, Paolo Valente Subject: [PATCH BUGFIX IMPROVEMENT V2 5/9] block, bfq: do not tag totally seeky queues as soft rt Date: Sun, 10 Mar 2019 19:11:33 +0100 Message-Id: <20190310181137.2604-6-paolo.valente@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190310181137.2604-1-paolo.valente@linaro.org> References: <20190310181137.2604-1-paolo.valente@linaro.org> 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 Sync random I/O is likely to be confused with soft real-time I/O, because it is characterized by limited throughput and apparently isochronous arrival pattern. To avoid false positives, this commits prevents bfq_queues containing only random (seeky) I/O from being tagged as soft real-time. Signed-off-by: Paolo Valente --- block/bfq-iosched.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index b96be3764b8a..d34b80e5c47d 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -242,6 +242,14 @@ static struct kmem_cache *bfq_pool; blk_rq_sectors(rq) < BFQQ_SECT_THR_NONROT)) #define BFQQ_CLOSE_THR (sector_t)(8 * 1024) #define BFQQ_SEEKY(bfqq) (hweight32(bfqq->seek_history) > 19) +/* + * Sync random I/O is likely to be confused with soft real-time I/O, + * because it is characterized by limited throughput and apparently + * isochronous arrival pattern. To avoid false positives, queues + * containing only random (seeky) I/O are prevented from being tagged + * as soft real-time. + */ +#define BFQQ_TOTALLY_SEEKY(bfqq) (bfqq->seek_history & -1) /* Min number of samples required to perform peak-rate update */ #define BFQ_RATE_MIN_SAMPLES 32 @@ -1622,6 +1630,7 @@ static void bfq_bfqq_handle_idle_busy_switch(struct bfq_data *bfqd, */ in_burst = bfq_bfqq_in_large_burst(bfqq); soft_rt = bfqd->bfq_wr_max_softrt_rate > 0 && + !BFQQ_TOTALLY_SEEKY(bfqq) && !in_burst && time_is_before_jiffies(bfqq->soft_rt_next_start) && bfqq->dispatched == 0; @@ -4816,6 +4825,11 @@ bfq_update_io_seektime(struct bfq_data *bfqd, struct bfq_queue *bfqq, { bfqq->seek_history <<= 1; bfqq->seek_history |= BFQ_RQ_SEEKY(bfqd, bfqq->last_request_pos, rq); + + if (bfqq->wr_coeff > 1 && + bfqq->wr_cur_max_time == bfqd->bfq_wr_rt_max_time && + BFQQ_TOTALLY_SEEKY(bfqq)) + bfq_bfqq_end_wr(bfqq); } static void bfq_update_has_short_ttime(struct bfq_data *bfqd, -- 2.20.1