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: 10071095 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 E3C7C60353 for ; Wed, 22 Nov 2017 21:17:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3BEB29D67 for ; Wed, 22 Nov 2017 21:17:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C869829DA0; Wed, 22 Nov 2017 21:17:00 +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 9B9D029D67 for ; Wed, 22 Nov 2017 21:16:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751674AbdKVVQ5 (ORCPT ); Wed, 22 Nov 2017 16:16:57 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:44507 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752026AbdKVVQZ (ORCPT ); Wed, 22 Nov 2017 16:16:25 -0500 Received: by mail-qt0-f194.google.com with SMTP id h42so25528415qtk.11 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=Fv0gBC5zenI5y0UHbpsG76/MmbDxOWJbKbPIZhSMKtNf3qrjtp5HX5ZdFGdyxF4Vll tvicAAYXAECB+dh3GN58eJ4JfdPP+diM0D21C6qSELLRRD4qsUQ5XhNhh6UXS5eTTIpU qdM0fZmT4Il/gjx9MLCXywA7SW6KKnqz0mFLA3JtuVLT77K8UrjvJyzA82r2CsgRB60Y 0jm6eBpQVyJrjbwQSP9KYQ6eQUlbNhhyyeCvOd97GwBU3yD6FugCQIQfJE0tgeuDUsAI oT9/jt9Bh9KQX2DWGfQZVYrJ4OMki1W+/cvU0t4Xu0iV9qZ6pqOr4bcOWVyybN7Bxb8i 1EiA== X-Gm-Message-State: AJaThX5hlpvTH3xPJy/ww7QYaZg02bjD4i33JzQODjhV7w6G4qcq0xRJ wAMsBzptdGrThICMhgScPCSHpA== 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-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 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: