From patchwork Mon Dec 11 21:55:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10105859 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 024006025B for ; Mon, 11 Dec 2017 21:56:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0043D29919 for ; Mon, 11 Dec 2017 21:56:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E93872991F; Mon, 11 Dec 2017 21:56:22 +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 A47D029919 for ; Mon, 11 Dec 2017 21:56:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752447AbdLKV4U (ORCPT ); Mon, 11 Dec 2017 16:56:20 -0500 Received: from mail-qt0-f193.google.com ([209.85.216.193]:36873 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752585AbdLKVzz (ORCPT ); Mon, 11 Dec 2017 16:55:55 -0500 Received: by mail-qt0-f193.google.com with SMTP id f2so42529429qtj.4 for ; Mon, 11 Dec 2017 13:55:54 -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=jloqE+Mp9Mz50ZMlnM8rvr/v/1hnPQnvNvp9j7bqC4UCuz2ZDDRVWufNDzUcPfp1gC 3mJLNgdplmLsySS5AJ+zDYikuu4Ksaw6U8tNqm4CqoftsancL6688jHH03KZYAbjDjuP syIBvtQTg7wNvF0fJt+crE28tGwsLTQLVh5l58uqfksI8XU3SaQgY8q+HCNSuArIaEgm Liu6tJ85BFefTPEzSDjCwNescKZs1qVOe6aTNFLgpX591VKLp/uWCgmoZ3CPGIKEn8E0 q0GwGBDBtd4+7NzFGgmJU/n+pcsGIvEn8P4p7ylnmcLb4kQXhXu+XkutqwhPkDxu4jAE 9Zsg== 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=THGaEoUwATNoKBvmktPDEbDWbTmvXKR0DH1DKko4a6TYdUkRzRs5qJ641eLc814Y4F eRzRGcUmMkl8g2HbWV7ZNbEi0FWUialKpwqpgOpYh/8s1FM+8FHspAtVUibc+ovj/F1c PSo428XRCknovQs2Y7uaTXrffQfeytMD68loR5C9m4lX0PfF3fcS+sSkn0imeiw/2I5u HzyW7l2lvvFvorOqtgl8Eu9aiCG70ELfkq4DMv3j0LaKb/Ggxqr5ci3iH/Jre4Drrjp3 izbnIIqgMDrZxNVY0XmTQQ1mK/zOzCteW/x7/bxUgf7PmK1xvdpX1j8bJxc+RCmOFJPi 7ctg== X-Gm-Message-State: AKGB3mL3T2rBJCJpV8FmVZWO9P7dAc8v2gCtJboWdE8SHsRP2vN4LWcj tSw+Vgh5djKOozx8MGdHw5SA4g== X-Google-Smtp-Source: ACJfBotIPOl29AF9SwFrAdojcjp4XMznsOGWg3G/cdxt//7HA3o+ElesLy5SRKz9UZUpRLSoXt5EQg== X-Received: by 10.55.165.129 with SMTP id o123mr2628592qke.8.1513029354274; Mon, 11 Dec 2017 13:55:54 -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 t28sm4784683qtb.83.2017.12.11.13.55.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Dec 2017 13:55:53 -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 10/10] btrfs: add NR_METADATA_BYTES accounting Date: Mon, 11 Dec 2017 16:55:35 -0500 Message-Id: <1513029335-5112-11-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-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: