From patchwork Mon Dec 11 21:55:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10105851 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0700A6025B for ; Mon, 11 Dec 2017 21:56:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05312298E9 for ; Mon, 11 Dec 2017 21:56:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE6DB2991E; Mon, 11 Dec 2017 21:56:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 794EA298E9 for ; Mon, 11 Dec 2017 21:56:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752610AbdLKVz4 (ORCPT ); Mon, 11 Dec 2017 16:55:56 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:34350 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752277AbdLKVzq (ORCPT ); Mon, 11 Dec 2017 16:55:46 -0500 Received: by mail-qt0-f194.google.com with SMTP id 33so42582939qtv.1 for ; Mon, 11 Dec 2017 13:55:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jhIMlIki1cKIyXUSBHDtd1aJR2IE1Gfo0up1NKtv878=; b=orCw0b0vUMxxXzZy8nwuV39owbNpiFvRjcf/ZzgcdnLvqJSCefbTR/0CYcnM0SBZ+M 15td27WjpNGQ88o65PSP3CZ58g9MDwTDNn+WTXSihPhbXfqHtZXiRvV9lisiZXCTfcRY nBpnHJb51eiBnSJgB6EkpiEEWSBJ4I/digYDMetW7OibQyx4LViIOF8onxtRPkYD8+AC uwc4C+IH7HVP/feKKy+N+EzAqt/q67FTFhvzrZdNYeDSTakEfWf8CcGy8MxE5dYWFzWO YxQpR7DpDZJsQyIIMLAcL35uXGEmJ/7VHuVw4abSAYMEhnZwtTmBKZ4kr6LuznGxL7VX oJgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jhIMlIki1cKIyXUSBHDtd1aJR2IE1Gfo0up1NKtv878=; b=AFNMTJp08A3ZlUZt6ii5C/IMDcITs/dBUTexE4L8KnmstbrClC1mAPcbsKu461KcdW fnWUqgHFrF+UBuBY/Cjd6ExFHeXqDQBM1boxrXgvKD1QrT7URrd2l7nCPUaFqWGgT/dL aqxwz0SLsoCtVBa3+Q3cbAx/QhHUyZXIbaKYNdstp9LDx034u26D/Zd7n1GLULBG5hRU 5/P0+38IU61hxyhShZYllBZy4zPahOsT7LkRAOQfDMjgI5K47LhOJGJF7nyPXB9a1t2N iVxIfvKOFXjmlF8Ldv0NOjUHahPjAMPBzMA7JrGyz0eTbI8OSBudq5UqOCsVbCcCxrxj dsOg== X-Gm-Message-State: AKGB3mJzc/jJF7DxbAO5PEWy47FLNSUE9N9daDMpRmgXWLW4oikkcOLa Z59tKy6HlLq81BN2BEGh22mREA== X-Google-Smtp-Source: ACJfBot5/Gx0Gr16LTTEQbcb0S7H4fe63gr+Zdu6cTikq+JJZ37JNygTRbenP/OrCRMXhistV5hGVg== X-Received: by 10.55.188.6 with SMTP id m6mr2724946qkf.75.1513029344696; Mon, 11 Dec 2017 13:55:44 -0800 (PST) Received: from localhost (cpe-2606-A000-4381-1201-225-22FF-FEB3-E51A.dyn6.twc.com. [2606:a000:4381:1201:225:22ff:feb3:e51a]) by smtp.gmail.com with ESMTPSA id 202sm4805273qke.37.2017.12.11.13.55.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Dec 2017 13:55:43 -0800 (PST) From: Josef Bacik To: hannes@cmpxchg.org, linux-mm@kvack.org, akpm@linux-foundation.org, jack@suse.cz, linux-fsdevel@vger.kernel.org, kernel-team@fb.com, linux-btrfs@vger.kernel.org Cc: Josef Bacik Subject: [PATCH v3 04/10] writeback: convert the flexible prop stuff to bytes Date: Mon, 11 Dec 2017 16:55:29 -0500 Message-Id: <1513029335-5112-5-git-send-email-josef@toxicpanda.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1513029335-5112-1-git-send-email-josef@toxicpanda.com> References: <1513029335-5112-1-git-send-email-josef@toxicpanda.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Josef Bacik The flexible proportions were all page based, but now that we are doing metadata writeout that can be smaller or larger than page size we need to account for this in bytes instead of number of pages. Signed-off-by: Josef Bacik Reviewed-by: Jan Kara --- lib/flex_proportions.c | 2 +- mm/page-writeback.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/flex_proportions.c b/lib/flex_proportions.c index 31003989d34a..fd95791a2c93 100644 --- a/lib/flex_proportions.c +++ b/lib/flex_proportions.c @@ -166,7 +166,7 @@ void fprop_fraction_single(struct fprop_global *p, /* * ---- PERCPU ---- */ -#define PROP_BATCH (8*(1+ilog2(nr_cpu_ids))) +#define PROP_BATCH (8*PAGE_SIZE*(1+ilog2(nr_cpu_ids))) int fprop_local_init_percpu(struct fprop_local_percpu *pl, gfp_t gfp) { diff --git a/mm/page-writeback.c b/mm/page-writeback.c index e4563645749a..2a1994194cc1 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -574,11 +574,11 @@ static unsigned long wp_next_time(unsigned long cur_time) return cur_time; } -static void wb_domain_writeout_inc(struct wb_domain *dom, +static void wb_domain_writeout_add(struct wb_domain *dom, struct fprop_local_percpu *completions, - unsigned int max_prop_frac) + long bytes, unsigned int max_prop_frac) { - __fprop_inc_percpu_max(&dom->completions, completions, + __fprop_add_percpu_max(&dom->completions, completions, bytes, max_prop_frac); /* First event after period switching was turned off? */ if (unlikely(!dom->period_time)) { @@ -602,12 +602,12 @@ static inline void __wb_writeout_add(struct bdi_writeback *wb, long bytes) struct wb_domain *cgdom; __add_wb_stat(wb, WB_WRITTEN_BYTES, bytes); - wb_domain_writeout_inc(&global_wb_domain, &wb->completions, + wb_domain_writeout_add(&global_wb_domain, &wb->completions, bytes, wb->bdi->max_prop_frac); cgdom = mem_cgroup_wb_domain(wb); if (cgdom) - wb_domain_writeout_inc(cgdom, wb_memcg_completions(wb), + wb_domain_writeout_add(cgdom, wb_memcg_completions(wb), bytes, wb->bdi->max_prop_frac); }