From patchwork Wed Nov 22 21:16:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10071093 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 1DAD660353 for ; Wed, 22 Nov 2017 21:16:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1031629D67 for ; Wed, 22 Nov 2017 21:16:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04ED429DA0; Wed, 22 Nov 2017 21:16:56 +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 85C8C29D67 for ; Wed, 22 Nov 2017 21:16:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752115AbdKVVQu (ORCPT ); Wed, 22 Nov 2017 16:16:50 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:42713 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752096AbdKVVQZ (ORCPT ); Wed, 22 Nov 2017 16:16:25 -0500 Received: by mail-qt0-f194.google.com with SMTP id j12so3862979qtc.9 for ; Wed, 22 Nov 2017 13:16:25 -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=Cac/S2jxF0+URJq1u/5+srlQMq1gCqEnKRH1j322vXI=; b=1YEj1BNhO6WIHkWI8b7sUaX1rdxZkb/ER5ClA5Lty/rrTv12zBxIJbPdXgdMMmuloF T4i+PwlYsB/F8UGGlkcG5jQmRiZ8ozet/e0IoVdO+hEdGwkXF2JrTu63qF6fOJ/fnE1M uyXlDHbA5OSaRlaneTPWAE6s7H7iWMjbTRttA1BAyek5yJDh3M4d4w8lZ3md7WhD6O36 /FclOp3wAG/KZWcU/YJBepqgMrLyQ8lFVYqgx/fMTz82gBo6X7UrkmLN3KIP8bgWtuNk IOKecI1boyqYGX8Stl/tCelkOkrXgOlvWpdxGfm2KFaewogp/O4CeK/StNCqlDXZzKBz rsgg== 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=Cac/S2jxF0+URJq1u/5+srlQMq1gCqEnKRH1j322vXI=; b=Qj+uCzN7UmtOZuti6uwkrGjMPsDFahNZfJHg6gKTbHPkUCHgUpyMKvGaRq1TvqFOVY XuvyvJ6PVzIht9dZnEhbtfgZsSE5xGiM3ktu0CTtRlxth/heVXWVOxxwlcbuaxutJuhz LZb7jpfqEpf0bWJidlkqLoGNJllyiqfA3fQFSHQIcfDaOkA+dLjrX6qSs3gVAvHmoxHj zCEkRS3Ged/EOhrS+uXghWU588htJN7FuHWoHUeyBn3w+B9olrOBlHmOwTs9nRIEzHnD Y80oMSsu1jTFuVXhfhOKfgLP7WRa5MkvXo5Eqa8B23Y+9xv5H/VRTSmaI6YRZggpyRZH rOOQ== X-Gm-Message-State: AJaThX7TUewnnWC+drf5YVAgkSVB8jfGUwTtjBH+zRgnW6scz8ijVp3x OROG/V72kh42iwDXKlQmD8M11Q== X-Google-Smtp-Source: AGs4zMZbMkrinrx8312HEksMqzO5lpNDMZkWnfSRTVKkB0e+q0YydRwxoHoQfXnrBZ7Gsk4DtVjEow== X-Received: by 10.200.56.75 with SMTP id r11mr34596643qtb.65.1511385385027; Wed, 22 Nov 2017 13:16:25 -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 c72sm11553149qka.31.2017.11.22.13.16.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Nov 2017 13:16:24 -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 11/11] btrfs: add NR_METADATA_BYTES accounting Date: Wed, 22 Nov 2017 16:16:06 -0500 Message-Id: <1511385366-20329-12-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 Now that we have these counters, account for the private pages we allocate in NR_METADATA_BYTES. Signed-off-by: Josef Bacik --- fs/btrfs/extent_io.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index e11372455fb0..7536352f424d 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -4802,6 +4802,8 @@ static void btrfs_release_extent_buffer_page(struct extent_buffer *eb) ClearPagePrivate(page); set_page_private(page, 0); + mod_node_page_state(page_pgdat(page), NR_METADATA_BYTES, + -(long)PAGE_SIZE); /* Once for the page private. */ put_page(page); @@ -5081,6 +5083,8 @@ struct extent_buffer *alloc_extent_buffer(struct btrfs_fs_info *fs_info, goto free_eb; } attach_extent_buffer_page(eb, p); + mod_node_page_state(page_pgdat(p), NR_METADATA_BYTES, + PAGE_SIZE); eb->pages[i] = p; } again: