Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2279385imm; Thu, 2 Aug 2018 09:00:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfennSkoIR27lj4YB7w/CHZqmRZB2AcIWQKdfrY0qVYIYoL9ASiZwJm8Je9r5cY9+5nTivj X-Received: by 2002:a17:902:a58b:: with SMTP id az11-v6mr72981plb.36.1533225632331; Thu, 02 Aug 2018 09:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533225632; cv=none; d=google.com; s=arc-20160816; b=eY5vOjLslIdQ8Jmi0a8r2C8fWnA+Z3Jx9xO0UjOhOVcU/Nd1yDBl9bYQJvW2L6+2d0 1vIs3elJPG9Rk4bAG3hdc45mLPVdYF3Fmc60zSGWjhCDjCD0V91wt+owOlHTpKnb49b3 GyZoUJyzcToFE4V1Piy15IOLCmX78UGP7bnvXlxdGH2YStFT1UXDp1xunz6hkkb57XRn uV+DcFhogbukW8wp8rk8ErgBTOA5NzHuS8ow7EwLuptobX+OdsnZwBG27oyUOBWM1ANs o+Z6M/bCvFxUrBYSBJSAv0ESWE3YmRpIaw8YblTL0Aq0fFWd3/dXOs2tW/vZYae/OwXG HWCQ== 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:arc-authentication-results; bh=M3klYL2uA16Rv+kKtnJ/HBA6++FkoRU9kQl21iYfCSs=; b=bsSrJvL62RXtAXZ9daPQMM2JU8N8WQZ7I2saCko5fbrYP62N3nn+eudqSy1Sb93waD SnnkRtd7g8wsB3hcdk6DFYVN/VrvN0VBOVDa5yH0l8/7bxVvnMxzvIw6PxU/dZCmq5Tn rp+eDFHXPSG2wFf5tXC56zesv5KLFvjaG06BFWvV/VMGXGofDGcnQR3Mpe4WBYAMjLZJ tWXmiVy+KXa/bOlewAIXWYncYdTO4gPHt/k5M1kBjjppdoC4IJT2aJLMm/spysIkwPxK iN6Wi43+xSkHDV3a8rYibg94gDlZ3olzRj6A7gN5UKPjounuJ2v1ersKUo4pjkwEWA23 kUJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=CVvR3mFO; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d7-v6si1669715pll.162.2018.08.02.09.00.16; Thu, 02 Aug 2018 09:00:32 -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=fail header.i=@gmail.com header.s=20161025 header.b=CVvR3mFO; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388023AbeHBRvI (ORCPT + 99 others); Thu, 2 Aug 2018 13:51:08 -0400 Received: from mail-yb0-f193.google.com ([209.85.213.193]:44303 "EHLO mail-yb0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387645AbeHBRvH (ORCPT ); Thu, 2 Aug 2018 13:51:07 -0400 Received: by mail-yb0-f193.google.com with SMTP id l16-v6so1245172ybk.11; Thu, 02 Aug 2018 08:59:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=M3klYL2uA16Rv+kKtnJ/HBA6++FkoRU9kQl21iYfCSs=; b=CVvR3mFO0wOCKbKWq6Af8u2IrlQSMCkVvymGPyFNadJ7XT6EfXgmGrTSO2rEHGKBTt vipRCJS+ReokgEev3gIhPXKWwss8ue+pyEz9hLW+GvXnNA2FI165OuE+cWs6A8W2HsdA t8gCpIBTnkz1DY4l28OICu0sbzUBp30GgdoBIAgTgNwcdPm3jP5xoWIjooPNVoRXYlag 7eKjzlZ1yGM/ZF+k5X/rCjrPMdDTY+wjkp1gh30Jsn1DBvyhB0q2EpDbucU0w2Ht/Yjc PhpKGrQEoDLR44kxM1UjHTGfXJLZYyqcxyFBFPJePWVEP5L0zIy5+Q+zE1J4dGWTQrsB t5Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=M3klYL2uA16Rv+kKtnJ/HBA6++FkoRU9kQl21iYfCSs=; b=bAiXb4NGkEvT0IC/EICCSttbKxf0vt0lG45PMXVhVKQ29Dko3FzwX34h6QKCSaDrLu 7e8MjMLY8iFvwqWjqpE0EM+6BRzZy9Jkx8Mf6kJI2eSP+paGHPED159uPdpXUp9dz5LN XQFqjKYDe8lCHNiPUYNYH75YpnZo89AzGY+VNWqE1fgQX8gCySOGGBArZMv7yC7o3TDx bu6xa7/XwvBqPaQvS2f95Dkmhnuc2JzUkimZk+tQ0Nbol1BOmU+npR6Qz2aXKIGvXFOd o8ED2vGa3zKl9bGlJfLwHAb6A8NnmA1Hbz1axeUsAz/CZ4cwAP5H6HRx8cfxrvUSShv0 Motg== X-Gm-Message-State: AOUpUlE5s0JGXuvhJakB3FHCkfSJEH4XRFNuIgoZc15LXqNb7MLzbOlv K7sqmHL28mtEgSwAViFlLP4= X-Received: by 2002:a81:8947:: with SMTP id z68-v6mr39234ywf.310.1533225560213; Thu, 02 Aug 2018 08:59:20 -0700 (PDT) Received: from localhost ([2620:10d:c091:200::3:c239]) by smtp.gmail.com with ESMTPSA id m19-v6sm977638ywd.90.2018.08.02.08.59.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Aug 2018 08:59:19 -0700 (PDT) Date: Thu, 2 Aug 2018 08:59:17 -0700 From: Tejun Heo To: Dennis Zhou Cc: Jens Axboe , Josef Bacik , Johannes Weiner , kernel-team@fb.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] block: make iolatency avg_lat exponentially decay Message-ID: <20180802155917.GT1206094@devbig004.ftw2.facebook.com> References: <20180802061541.49173-1-dennisszhou@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180802061541.49173-1-dennisszhou@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Dennis. On Wed, Aug 01, 2018 at 11:15:41PM -0700, Dennis Zhou wrote: > From: "Dennis Zhou (Facebook)" > > Currently, avg_lat is calculated by accumulating the mean of every > window in a long running cumulative average. As time goes on, the metric > becomes less and less useful due to the accumulated history. > > This patch reuses the same calculation done in load averages to make the > avg_lat metric more lively. Unlike load averages, the avg only advances > when a window elapses (due to an io). Idle periods extend the most > recent window. Bucketing is used to limit the history of avg_lat by > binding it to the window size. So, the window range for 1/exp (decay > rate) is [1 min, 2.5 min) when windows elapse immediately. > > The current sample window size is exposed in the debug info to enable > calculation of the window range. > > Signed-off-by: Dennis Zhou > Acked-by: Tejun Heo > Acked-by: Johannes Weiner > Acked-by: Josef Bacik Heh, sorry about not thinking this up from the beginning but I think it'd be great to move this to blkcg core so that the stat is always available regardless of blk-iolatency. It's a really important metric and can be used for both monitoring and policy implementation. Thanks! -- tejun