Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1252896imu; Thu, 13 Dec 2018 11:53:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/Ws2jaU9ldyn8OCFYpizZoK+mSqOPiY5wqsVxgVUJikh2tcdS9IiEeaTJM50VOUSCGbiGDu X-Received: by 2002:a17:902:4503:: with SMTP id m3mr133063pld.23.1544730810722; Thu, 13 Dec 2018 11:53:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544730810; cv=none; d=google.com; s=arc-20160816; b=0I9bgL7r3fkddbF8N2rMjjxUYEYehT7TyfzYwecAICGaunwgbkkHzkLu7r4qUlTQQ6 5bhLVj5dOZLS5xqiI/27I+0xOXWKnDubqTxCKhit+WgVR/oiICzjFplksRgZOaheKiHR hEjT/rVMidpGBkqzsLqF4T+u4caOYjVcLhre83JQLOjafW0FXPPjIlr9E7Oigl0i93u9 78RFmuTR2Iis8v5phkh9hgyLCP2oactAzY5R5ykn+/k2gXbPCX+TobNpXADqOu5LYRmt zGiLooRx7gycgufxCp2zVFHdfe9gmoolAgqD2AvRBdwhh1ui/AjCKFH7i2zOeLCwOQcw mh7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wG32gjmYR+a6LxqRxyUJWOp8mEIFyeCoi+kK4CZX3lI=; b=d5A22x/Gg/qD/qXcZ6T86TroMV3zaTVN4/DR/o1MnsLl4v0t1JZVHx1TCNs7TJE+vz uXT8BTXdpZ1vUkQoKRx3zClvJDZ9mE5+SLSQFBCei6llfeGlcY/2aI0qWw3uhe+sKtYF R8wRBHrKK1wDzZ6LM4TrG4NCIJr/bveUnFTrUwB5823RQ6eG1nE0xi6JbIkWhYdpb+kh kAu1srkyuuP9iPtRIQZKhUanr7KDdLPbRt6DKW5SpBLB50Ketd4tNBst1QlDIkJYRgs5 GiuPLCKz+iWXpYyjcB6vVMJofHH75PNjtfyKY3c6PQ4ST5oYNFsU3u/6136z2rVzrLyy 6/dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=xeC6aVZv; 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 k62si2232338pfc.208.2018.12.13.11.53.14; Thu, 13 Dec 2018 11:53:30 -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=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=xeC6aVZv; 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 S1728252AbeLMTwN (ORCPT + 99 others); Thu, 13 Dec 2018 14:52:13 -0500 Received: from mail-yw1-f65.google.com ([209.85.161.65]:41060 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727707AbeLMTwN (ORCPT ); Thu, 13 Dec 2018 14:52:13 -0500 Received: by mail-yw1-f65.google.com with SMTP id f65so1317355ywc.8 for ; Thu, 13 Dec 2018 11:52:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wG32gjmYR+a6LxqRxyUJWOp8mEIFyeCoi+kK4CZX3lI=; b=xeC6aVZvumVToIPgil8TGwOsN4gaAa9Y9qVaKadLoI7wlG/JBeTj4R6fOpqIB8ji0k EY1K40aDMqGQCHizT3YSF+RcWA6oMxCgFdni9RbgF6KuExXuFprkRkc/jbj9SFi/L8yw rYvqn1HHNRtftSIW4FzJYWr4vbi2Fje+yiljImbMfSfxhV/2qVWjsNdLQvb7uwCri4wB zacNQ9OTyB6rJIqIi1Z9/db7bDLRVFac+fWF8qv2NRtcC4Fy9LV/bJNNVKBx0mLVsQEL dKyMRA7jp6xjssBSCCLUwNPBQSXI2iBefF3jv3gQ+atP45R/7RLu92Olt56ar2CfY/Hi mxWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=wG32gjmYR+a6LxqRxyUJWOp8mEIFyeCoi+kK4CZX3lI=; b=JoQwPHy5E9Wq0joAAKC198GrPvX90FM3Q9TELQg26KgGwTBs2ULMO4aa1H7yqTTvmZ Sqe1iOekPXWo1oK9OeC07aSJjRxESfQoSVN+eth4HM8dAdHjgQs4B8FOopq2xRjm4aU8 NAkk7nZeMFCSbkyknmLzq8RB8WUOW1fT5B5Rjt1+njCHAxFCU1zXsjjyllSjyHeFhMsH q4M1qloMAbXlQe0VJ8l0p8pZ+SORsQYufzjGmqG7VxdcvpC3ytsTg38q0NeBzGFsswNh PH5Tj8OuOX8V36q6E1efgTC5xkgtVbQbzuTVwIHaciCeKCb3gEU0XiolSx1YJAXwZ04R hymg== X-Gm-Message-State: AA+aEWbGIndxMDrC+ADVZ46M4tiv+3n/gneiM7WlIyBdC3LGwui3Zncc Zs5731pYeVN8jpWGQ3ALnmjqEg== X-Received: by 2002:a81:b657:: with SMTP id h23mr152034ywk.378.1544730731463; Thu, 13 Dec 2018 11:52:11 -0800 (PST) Received: from localhost ([107.15.81.208]) by smtp.gmail.com with ESMTPSA id l9sm934943ywc.81.2018.12.13.11.52.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Dec 2018 11:52:10 -0800 (PST) Date: Thu, 13 Dec 2018 14:52:09 -0500 From: Josef Bacik To: Jens Axboe Cc: Dennis Zhou , Tejun Heo , Josef Bacik , kernel-team@fb.com, linux-block@vger.kernel.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] block: fix iolat timestamp and restore accounting semantics Message-ID: <20181213195208.qgvfeb5ilbf3ttsf@MacBook-Pro-91.local> References: <20181211230114.65967-1-dennis@kernel.org> <59500829-10f5-fa83-b2db-fcfa4a1cd11d@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <59500829-10f5-fa83-b2db-fcfa4a1cd11d@kernel.dk> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, Josef