Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1258911imu; Thu, 13 Dec 2018 12:00:19 -0800 (PST) X-Google-Smtp-Source: AFSGD/ULX4+amY2iPmV4KsJvSnUU9TZytRk+55qvl8WNk/iWCFGlFtyY4DhphGWTvaE6Hx4Ytc79 X-Received: by 2002:a63:9501:: with SMTP id p1mr133556pgd.149.1544731219757; Thu, 13 Dec 2018 12:00:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544731219; cv=none; d=google.com; s=arc-20160816; b=hsty2HqRaf596bpdwyJyWf0VjlYuPHR6trL9oZDDzXkKm8pTYKBPyNpkVplHnWPwM+ pAOJux/2hwPys+i9iea0Nx79IMnfu8tAYWE0w9kZsqj21Y2/fBN0eWISIIhqyI6IoXwX IJZW5kSx6X4EMlMVvsBIkITrLElytA8dZOVrR5ormhrOyQw3tZmNtXLXQL9+a772vqiG WGz0wVd8agaA6I9K1cdPOLPsoD0ySZsYS1uLPIR6uouNUG9735hJZle5V+FCYTNLb7FM ecIavdESSwC1hWsJ51gBu5eWQROWriLCc9hDscKd5L5+lMfwLEygibAwzgEzhZLYl3gZ xkUg== 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=9HwpeAASKDoLDycZu15Kfrt0tmVJZsz205csfagvOvA=; b=WOMMOAUSQC8Ak2WZ3hpEj48GoN3XtdRJc+vi1fYHaRD9rH7DhWRcMarTWvoQ9gLiVN 8hH2NESstWSg0pzfrXMtV2/0S8WcJmSP4sYjlJmrqEnT1KuP1XZ1rlVNSbNO/TtGQlJb 2XbvKWBvghWebgpRK4wvvKgdMdilv8KU5TLuxTsp2e9h4VpWP0V2TF1aCjAyws9idQgb ItO0m6eP0zPG+ctY8FzlHsmIqngddnMd1bp5cX7eImvtypt9EOzq9k7aYahf7Az4a/Nq UXxftirSMfei8WI+Pl6UgIA/TttK//T3UQU9ZlY8Ajut529w9dURp7TRjNYHRs0uaMIl 20TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=geZHGCDb; 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 i2si2243986pgl.153.2018.12.13.12.00.05; Thu, 13 Dec 2018 12:00:19 -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; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=geZHGCDb; 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 S1728844AbeLMT7H (ORCPT + 99 others); Thu, 13 Dec 2018 14:59:07 -0500 Received: from mail-it1-f194.google.com ([209.85.166.194]:55368 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728227AbeLMT7H (ORCPT ); Thu, 13 Dec 2018 14:59:07 -0500 Received: by mail-it1-f194.google.com with SMTP id o19so5520388itg.5 for ; Thu, 13 Dec 2018 11:59:07 -0800 (PST) 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=9HwpeAASKDoLDycZu15Kfrt0tmVJZsz205csfagvOvA=; b=geZHGCDbgfLinIkbNb/845U5nz2zHshC+5XD62FCn9wqH7jasLCgvWT1ef6Mr9ZhYo scMP/6d/l6T2uz19pF395AmlNc8EJYmdflBe9okVZGBHXmjVdPAbb22Yf3I1zoAOSe82 U2Q5HxQV7oOVPEFI95aHF3osdFdYL4deyB06ljjNyiWqY+jITFGo+gDKliW4RXeLytBs H+28YeHddtTW7s6xsWTBhTJtUhItRK2LHl0/bGzJ6yGDNisoJbzUfJsaqMMENW8DJ92e fAAsO3X57jFXcgXFkp0cQMBSZ/XTFvVyIaaDc0UNm8hizr6JyjplEfCxmR46tXBXK6Kg zWmw== 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=9HwpeAASKDoLDycZu15Kfrt0tmVJZsz205csfagvOvA=; b=djbmjE9fAPae/QMrxGeznHZ2xBYnDXvF2kfyUiN86VxFLy4RNQo5m9MHO+HU5CGaBS cRdAnM8v75I0OUVwtbCWluK31zvaKnRcvzpeJmbYEBPYxCYH9TYFeeoOl/zdAfodlABi gDOTB8cUcq5lIsktb9nSZnlDED5Pp7rY9ty5zPKIomWM3GzR3CQgd0mC1H2CGPqkX05E fAt6IHOLBCFvxkvjmnHZq6W5WZPtMjwozbNbUMigvbcYs1SgJZC7ncKkKEe0gHKuYxUC fIrOM4jIUO0IqFVCq58u7Df42avbcyl0ouaZDPtZDWCoAE6dgmqySvdNuRVcOu2qhsuV CA5w== X-Gm-Message-State: AA+aEWYL9NeA3/SMXytLTr+HvIQrfHe0jM5z+83dukdn4Ttcdna8oYak sgYTuqyUO3KccC5PaQXpWhWmLHvR0PqUkg== X-Received: by 2002:a24:3007:: with SMTP id q7mr648649itq.57.1544731146059; Thu, 13 Dec 2018 11:59:06 -0800 (PST) Received: from [192.168.1.56] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id 85sm192509iou.8.2018.12.13.11.59.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Dec 2018 11:59:04 -0800 (PST) Subject: Re: [PATCH v2] block: fix iolat timestamp and restore accounting semantics To: Josef Bacik Cc: Dennis Zhou , Tejun Heo , kernel-team@fb.com, linux-block@vger.kernel.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org References: <20181211230114.65967-1-dennis@kernel.org> <59500829-10f5-fa83-b2db-fcfa4a1cd11d@kernel.dk> <20181213195208.qgvfeb5ilbf3ttsf@MacBook-Pro-91.local> From: Jens Axboe Message-ID: Date: Thu, 13 Dec 2018 12:59:03 -0700 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: <20181213195208.qgvfeb5ilbf3ttsf@MacBook-Pro-91.local> 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 12/13/18 12:52 PM, Josef Bacik wrote: > On Thu, Dec 13, 2018 at 12:48:11PM -0700, Jens Axboe wrote: >> On 12/11/18 4:01 PM, Dennis Zhou wrote: >>> The blk-iolatency controller measures the time from >>> rq_qos_throttle() to rq_qos_done_bio() and attributes this time to >>> the first bio that needs to create the request. This means if a bio >>> is plug-mergeable or bio-mergeable, it gets to bypass the >>> blk-iolatency controller. >>> >>> The recent series, to tag all bios w/ blkgs in [1] changed the >>> timing incorrectly as well. First, the iolatency controller was >>> tagging bios and using that information if it should process it in >>> rq_qos_done_bio(). However, now that all bios are tagged, this >>> caused the atomic_t for the struct rq_wait inflight count to >>> underflow resulting in a stall. Second, now the timing was using the >>> duration a bio from generic_make_request() rather than the timing >>> mentioned above. >>> >>> This patch fixes these issues by reusing the BLK_QUEUE_ENTERED flag >>> to determine if a bio has entered the request layer and is >>> responsible for starting a request. Stacked drivers don't recurse >>> through blk_mq_make_request(), so the overhead of using time between >>> generic_make_request() and the blk_mq_get_request() should be >>> minimal. blk-iolatency now checks if this flag is set to determine >>> if it should process the bio in rq_qos_done_bio(). >> >> I'm having a hard time convincing myself that this is correct... >> Maybe we should just add a new flag for this specific use case? Or >> feel free to convince me otherwise. >> > > I mean it'll work for now, but then when somebody else wants to do > something similar *cough*io.weight*cough* it'll need a new flag. I > kind of hate adding a new flag for every controller, but then again > it's not like there's thousands of these things. I'm having a hard > time coming up with a solution other than a per-tracker flag. As for > this specific version, I still think it needs to be in iolatency > itself, trying to make it generic just means it'll get fucked up again > later down the line. Thanks, We definitely don't have that many flags, and I'd hate to add a per-whatever flag for this. But do we need that? We really just need single flag for this, my main worry was overloading ENTERED. Especially since we're adding different clearing and setting for it. If we had a specific one, if it's set, we would need to disallow merging for it, I guess. And there's already BIO_THROTTLED... -- Jens Axboe