From patchwork Mon Mar 23 05:07:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 6069991 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B9578BF90F for ; Mon, 23 Mar 2015 05:12:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EE9D720107 for ; Mon, 23 Mar 2015 05:12:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0DE79200B4 for ; Mon, 23 Mar 2015 05:12:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932171AbbCWFMV (ORCPT ); Mon, 23 Mar 2015 01:12:21 -0400 Received: from mail-qc0-f176.google.com ([209.85.216.176]:32857 "EHLO mail-qc0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753279AbbCWFIJ (ORCPT ); Mon, 23 Mar 2015 01:08:09 -0400 Received: by qcbjx9 with SMTP id jx9so98130887qcb.0; Sun, 22 Mar 2015 22:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=V5THAzkpCS0X7JeiQVXksmst6dAKXxZBYlnatbwkTIk=; b=i/o6QAtnlAFK0PGsqCLubVQ+80HSyYTN1W4iK7GJEOmead48UNhgItMdSqRoKGag9X 5WS6b7KIu9EEUFeiGhv270GsCYPJCH810N/EWMZHFz5CyQwcQ6bhyKILy5AG3n3sDQLU 37v3nNdJSLRmlBIxnco1XiW/8zAfjMA6Wa5Tu89c5ljBit+T4QTwEdrpU4uFYuxTLIsU 3kTfhsk9hXG6C9fYQP2fBSIB3FRZJi9u9MGXwK6tK/0KacFBXFUMpPVVKmVZlpe7X4Kz NVsJKjrRM3Rd50Qkczawp49A8kADks4qQZOPFqMZcez9c1by/MuXDZWx5nlc+9Qwffsg iBVw== X-Received: by 10.55.31.97 with SMTP id f94mr138170228qkf.10.1427087289105; Sun, 22 Mar 2015 22:08:09 -0700 (PDT) Received: from htj.duckdns.org.lan (207-38-238-8.c3-0.wsd-ubr1.qens-wsd.ny.cable.rcn.com. [207.38.238.8]) by mx.google.com with ESMTPSA id f77sm8494303qka.9.2015.03.22.22.08.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Mar 2015 22:08:08 -0700 (PDT) From: Tejun Heo To: axboe@kernel.dk Cc: linux-kernel@vger.kernel.org, jack@suse.cz, hch@infradead.org, hannes@cmpxchg.org, linux-fsdevel@vger.kernel.org, vgoyal@redhat.com, lizefan@huawei.com, cgroups@vger.kernel.org, linux-mm@kvack.org, mhocko@suse.cz, clm@fb.com, fengguang.wu@intel.com, david@fromorbit.com, gthelen@google.com, Tejun Heo Subject: [PATCH 09/18] writeback: add dirty_throttle_control->wb_completions Date: Mon, 23 Mar 2015 01:07:38 -0400 Message-Id: <1427087267-16592-10-git-send-email-tj@kernel.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1427087267-16592-1-git-send-email-tj@kernel.org> References: <1427087267-16592-1-git-send-email-tj@kernel.org> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP wb->completions measures the wb's proportional write bandwidth in global_wb_domain and thus naturally tied to the wb_domain. This patch adds dirty_throttle_control->wb_completions which is initialized to wb->completions by GDTC_INIT() and updates __wb_dirty_limits() to use it instead of dereferencing wb->completions directly. This will allow dirty_throttle_control to represent different wb_domains and the matching wb completions. This patch doesn't introduce any behavioral changes. Signed-off-by: Tejun Heo Cc: Jens Axboe Cc: Jan Kara Cc: Wu Fengguang Cc: Greg Thelen --- mm/page-writeback.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/page-writeback.c b/mm/page-writeback.c index ac2d7b1..1f216cf 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -127,6 +127,7 @@ struct wb_domain global_wb_domain; /* consolidated parameters for balance_dirty_pages() and its subroutines */ struct dirty_throttle_control { struct bdi_writeback *wb; + struct fprop_local_percpu *wb_completions; unsigned long dirty; /* file_dirty + write + nfs */ unsigned long thresh; /* dirty threshold */ @@ -139,7 +140,8 @@ struct dirty_throttle_control { unsigned long pos_ratio; }; -#define GDTC_INIT(__wb) .wb = (__wb) +#define GDTC_INIT(__wb) .wb = (__wb), \ + .wb_completions = &(__wb)->completions /* * Length of period for aging writeout fractions of bdis. This is an @@ -590,7 +592,7 @@ static unsigned long __wb_dirty_limit(struct dirty_throttle_control *dtc) /* * Calculate this BDI's share of the dirty ratio. */ - fprop_fraction_percpu(&dom->completions, &dtc->wb->completions, + fprop_fraction_percpu(&dom->completions, dtc->wb_completions, &numerator, &denominator); wb_dirty = (dirty * (100 - bdi_min_ratio)) / 100;