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: 10105875 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 1B46D6025B for ; Mon, 11 Dec 2017 21:57:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 186F2298E9 for ; Mon, 11 Dec 2017 21:57:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C53E2991E; Mon, 11 Dec 2017 21:57:19 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable 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 7A450298E9 for ; Mon, 11 Dec 2017 21:57:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752403AbdLKV5P (ORCPT ); Mon, 11 Dec 2017 16:57:15 -0500 Received: from mail-qt0-f193.google.com ([209.85.216.193]:42760 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751566AbdLKVzp (ORCPT ); Mon, 11 Dec 2017 16:55:45 -0500 Received: by mail-qt0-f193.google.com with SMTP id g9so42510275qth.9 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=BEA5ssDaNxK/ZuXSrXNxxPKpSTb1wyNYp+7PoN2CKxN10Ntt+ufpm5LLIw1gf9wGBe bRL3V381Dv5NDgcocd3f0/VwWuPQC3q2ncHxoSyec4G9PMSxKYNPoN1sDQXBgLVnv+Ez /iwq6K4r4Xgnuy6ygc6RWN4fv5VUG35teEfFLI5+O7EbePDn2dpIOQPzg7qYTAabNeD3 wnrKXBVKyt/mKEP6h5sqVQqBo7gLWYm9VWtoZzwIFHuegNxAYbzXSO87Qo7ybMRDncvK 7qSbEAnD/HXxHnEA3ONw1k65nmA/yjIFz5pIl5X9vG+L2+XaHkJ+7oU4wA/wtBX4FwGF 3bxg== X-Gm-Message-State: AKGB3mLgPhyC9Tcy4NMlrIwqPLtCk1GQUWU5tRZ39jlAQgGjBQaUKp95 Fi1CTiAauqs3S6iLbrjMskh2gQ== 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-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@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); }