From patchwork Wed Nov 22 21:16:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10071075 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 EA33D601D5 for ; Wed, 22 Nov 2017 21:16:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCAB829D67 for ; Wed, 22 Nov 2017 21:16:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D136729DA0; Wed, 22 Nov 2017 21:16:23 +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=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 8257F29D67 for ; Wed, 22 Nov 2017 21:16:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752179AbdKVVQT (ORCPT ); Wed, 22 Nov 2017 16:16:19 -0500 Received: from mail-qt0-f193.google.com ([209.85.216.193]:41683 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751771AbdKVVQR (ORCPT ); Wed, 22 Nov 2017 16:16:17 -0500 Received: by mail-qt0-f193.google.com with SMTP id i40so14341095qti.8 for ; Wed, 22 Nov 2017 13:16:16 -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=zAbzJ5KI8YUfyCIACrqBRwY5miHnQge4459dNxDPciY=; b=ic+m/X7ZzDYV6cfG76j2G71GYmqxXeh3HjqzZ6/BhHXv8KopSECDP7pnaKn1R6Tf8N yzh1Np5CaxrDviirhqEoAkNulOxkDyNcLrTSQN1sBDZYBzlU1hiGpvmDfIFx2Vz7klJv WFrCwUy24GNZChDTg9LFzPvl1KGtjiBlTCIOYvQyuOixyaTHire8tFY2hGpTyGH4fcj5 BbVCvJMwQX2Y7kNxUQZ446CAcxY/EuStJrMK1YkmN7nNKFyQ4vcfG4SThSUliUSCavWU EO7ZsLikWscSn2ZNvylIOh8L/URaOszYD8IM/UcJ702AQ+Qz6BqBnSWgUqVv+QZnhG27 AXXw== 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=zAbzJ5KI8YUfyCIACrqBRwY5miHnQge4459dNxDPciY=; b=atqeid6GGEhK4b3CSa5TCL8wTCiqAYuANnYJUwF/FYgMUASscmx9KMcVROtrraPkev 9OznOc4F23DsleCrj5MA6ymDcLF4jisYXOE8W4SNLifF9MMZlTr0XBGwU4b3hgpzDMmi WGhW96b9ghw0DGA750+cN20QDB/0FdtvvRfOZqJEKcFMmjIaqqtPxKiPTnIc38FPq28t WP8z8EMZVgSEMvy5CYdDlyxXlcoMShfEynwOMHtmONKhHtaQnx6th9GurZk0TKftZH1G KIftiGFez9m1YYAwHBy4b7EYKTFchoSRvH32BUWcefkW2rudad+eOhYFfJ8GZxn/lx6V ugFg== X-Gm-Message-State: AJaThX4BMgmKEES1kpinTEuDmKDJPATOFOuyQ1BZ0bcAxaRMhbWerNu1 jomU0fzCIAIADaMFKwRpxnpC9Q== X-Google-Smtp-Source: AGs4zMbrRWyZYigirQ1jHUpXvD4aDLY8YpNXDf8VXFcTmPTi4iONdKFdw2Hgm3g4hCFRRLl/CVixlQ== X-Received: by 10.200.24.58 with SMTP id q55mr36001474qtj.184.1511385376241; Wed, 22 Nov 2017 13:16:16 -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 q37sm11618037qtj.66.2017.11.22.13.16.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Nov 2017 13:16:15 -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 v2 05/11] writeback: convert the flexible prop stuff to bytes Date: Wed, 22 Nov 2017 16:16:00 -0500 Message-Id: <1511385366-20329-6-git-send-email-josef@toxicpanda.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1511385366-20329-1-git-send-email-josef@toxicpanda.com> References: <1511385366-20329-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 --- mm/page-writeback.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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); }