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: 10071103 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 EB30660353 for ; Wed, 22 Nov 2017 21:17:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD41529D67 for ; Wed, 22 Nov 2017 21:17:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1FD729DA0; Wed, 22 Nov 2017 21:17:12 +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 5EF8C29D67 for ; Wed, 22 Nov 2017 21:17:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751722AbdKVVRI (ORCPT ); Wed, 22 Nov 2017 16:17:08 -0500 Received: from mail-qt0-f196.google.com ([209.85.216.196]:37769 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751803AbdKVVQR (ORCPT ); Wed, 22 Nov 2017 16:16:17 -0500 Received: by mail-qt0-f196.google.com with SMTP id d15so25564901qte.4 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=N2c/Oy58dJ1lFE369M3Iqy1Fbwh3dvxn5yJRXeSdESFWXorFDHax34P1Ds1g0MWXLx IY2Wc5D+mGo6w+aE0eY3mwl9Ja2ehKeA7ss7p8Q/oAWQQzLh5gtNi/moG+E88z4mzNpE 5nOtUq50vB+ZAX+ALrKmyDxR8uLCZGh+4aXzOKRxgtBSIcbEocTXirIWaWls9TfsD/lK fy83IrWdnzSSPkDVTABcwSUfKuSxoq9KEEx/JNe7ofZu/XgTR8qzf0ZTiIul8663hoQz 4MXwgRqbQ1DCynbGm6JM7dIbrUjL+ynjgFRtesEyFB7+4qAJ6rxtim1CCxsTwQMvbxN0 5iZg== X-Gm-Message-State: AJaThX6Ci2mhoiA/aKiO2KWJvgCWAPxdfT3lKtK1+LSEzndb4/RfvB9H xBsaklbvRaUfSUD2oh9ERPVswg== 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-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 --- 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); }