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: 10105857 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 BFC266025B for ; Mon, 11 Dec 2017 21:56:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE43E298E9 for ; Mon, 11 Dec 2017 21:56:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B32272991E; Mon, 11 Dec 2017 21:56:17 +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 4A505298E9 for ; Mon, 11 Dec 2017 21:56:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752358AbdLKV4O (ORCPT ); Mon, 11 Dec 2017 16:56:14 -0500 Received: from mail-qt0-f196.google.com ([209.85.216.196]:46146 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752355AbdLKVzy (ORCPT ); Mon, 11 Dec 2017 16:55:54 -0500 Received: by mail-qt0-f196.google.com with SMTP id r39so42481284qtr.13 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=OXHhLTM7Eski4HTkT+sJQ9r209AuvaS/7U/M1+/Amv59dkxEl56Vj6YyHXyFCYeH5g N/IHoGmt9amI99SSexanfJNZRpcpCH2yQrcJbY5D25xGc6yiSk+pNmBDvPHCN8KflCuL b9YtdtkPUoRSRvwh6oExTCafIr/Bd/I4BbgXsS3Ar8KoZwpm55OzVeelPrvuKwmofHUV G4bK5EnRYZZR0PgF77ssCc09cbljL8H9SwPYND6Sr4TKOiLoz0ERUeAivTWC305UPSQV WykCkH20T9YZXgGYP2fRKtn8/FOUKqp2q6MsIoviHA0gSw4zFdR9bb1JKPBCQ5qBZGgX BwGg== X-Gm-Message-State: AKGB3mIHhRYiaQwLtRCMur997au2mDSVUmuMkQuFfS9EwJEoU4hNVNsa 1xqQD5vrMR+2AeCkDjIzuV0vKqtlyUM= 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-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: