From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9903C433E0 for ; Mon, 1 Jun 2020 20:42:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C89B5206E2 for ; Mon, 1 Jun 2020 20:42:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591044141; bh=vSz5uAD4Y+IIn8wFu6sj3idqHoWDQ5kocYk59/SbZ+M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=yF9Ym0XijB+8YVgrBFhwX/+WyRyJAsNhMNvD95P8DNfzHhg2UYNZ4hQYWxZ2+yUc0 5WMmE0OZ+JRuJMPA+dt2I5g7NJWVhnGY1PptZE+teSxrXlMMHbO9bm0KfGLpcIZDcp 06M+5hXqUYN3H4shyXNIUj0xenGYszTTUQvRz7Cw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728506AbgFAUmS (ORCPT ); Mon, 1 Jun 2020 16:42:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726124AbgFAUmS (ORCPT ); Mon, 1 Jun 2020 16:42:18 -0400 Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCA9CC061A0E; Mon, 1 Jun 2020 13:42:17 -0700 (PDT) Received: by mail-qt1-x842.google.com with SMTP id z1so8906297qtn.2; Mon, 01 Jun 2020 13:42:17 -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; bh=nNZfm4KTFqe5hnlvYWDeBhcm8Ap+9mpyPFYJmsznAkM=; b=t8euN+bSgRmxO9c8Y/F883WBGe4+MHcPeJWqbsm/Ga9gEIjuGubgttCJNl+uoAu4f2 WA3zDSPL6rLppywjj2lYh+yOrJLiGEntBUcihOjGwVwoOB+VIdBpDFHsUZKyLfQ2mqYV RDtckfLXaIynwN3PFlN6VbNxg0/5w0I5jj3n0pEQotS8YPJ9NtJpK3PpqYr1y6OmuR72 DP+i/gUVvc8ImBV86uzJB2jknfWCq8ei32IFzdQbXhYFDor1nFtNyNC6g3NI2o2ixNLx YX5Ej8xkJ/zLmgnXpj7IkDsfKCsuw621xmaC5Ff+cxGIH9ky6fFxr9V1lwO1sDKFQMHm flMA== 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; bh=nNZfm4KTFqe5hnlvYWDeBhcm8Ap+9mpyPFYJmsznAkM=; b=JE6l962Prn65mv1+H2SADpseIXTG0FNZ0wG+UXE5UxXlN7TRWAm9vGI8eeOjdbua9p uabuyBABIM8rQWlcLn0x+OLccrp4QNHTfOdaUS/LQPSsxgZX7AY1ks1S/bFLO2odNMWl 1/fciK+qPIEtvYHh5dI52vd60QAsbzVJMIEw0LZtiunfkuWj6/2OF69fEmGHgNRIpNyZ eAxnEq+VBaCHXPyQGJ/Hc3/vI0h2WeGyyWXvKwGHoCR1cUXhAqYY172ABQn14vFMLXc8 fbvRBfy3iJeckrSCT0yJE8a44nD+KpbUAmKWSI8JuG8fKRUyhf/XfjHeVUZNjzorD3Rq TA7A== X-Gm-Message-State: AOAM532ntUELCTL72A5oMA2mgWFBb59c3yUfX/xywJOPXmOz02DWHVw5 HsXXs0glLGrhBvhPSQ6SfLWQlFAY X-Google-Smtp-Source: ABdhPJycDkD6/AfqKFyakBBoPe7y+t2QIAOFQeVj3fFguo76Qe7tXaBmURSRECa9qRKObF/ju+mqBA== X-Received: by 2002:ac8:f79:: with SMTP id l54mr24298287qtk.79.1591044136879; Mon, 01 Jun 2020 13:42:16 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:eb8b]) by smtp.gmail.com with ESMTPSA id d23sm434611qtn.38.2020.06.01.13.42.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jun 2020 13:42:16 -0700 (PDT) Date: Mon, 1 Jun 2020 16:42:14 -0400 From: Tejun Heo To: Boris Burkov Cc: Jens Axboe , cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 2/2 blk-cgroup/for-5.8] blk-cgroup: show global disk stats in root cgroup io.stat Message-ID: <20200601204214.GF31548@mtj.thefacebook.com> References: <20200601154351.GD31548@mtj.thefacebook.com> <20200601201205.1658417-1-boris@bur.io> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200601201205.1658417-1-boris@bur.io> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Mon, Jun 01, 2020 at 01:12:05PM -0700, Boris Burkov wrote: > In order to improve consistency and usability in cgroup stat accounting, > we would like to support the root cgroup's io.stat. > > Since the root cgroup has processes doing io even if the system has no > explicitly created cgroups, we need to be careful to avoid overhead in > that case. For that reason, the rstat algorithms don't handle the root > cgroup, so just turning the file on wouldn't give correct statistics. > > To get around this, we simulate flushing the iostat struct by filling it > out directly from global disk stats. The result is a root cgroup io.stat > file consistent with both /proc/diskstats and io.stat. > > Note that in order to collect the disk stats, we needed to iterate over > devices. To facilitate that, we had to change the linkage of a disk_type > to external so that it can be used from blk-cgroup.c to iterate over > disks. > > Signed-off-by: Boris Burkov > Suggested-by: Tejun Heo Acked-by: Tejun Heo Thanks. -- tejun