linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	linux-nvdimm@lists.01.org
Subject: [PATCH 2/4] mm: Stop accounting shadow entries
Date: Tue,  4 Aug 2020 17:17:53 +0100	[thread overview]
Message-ID: <20200804161755.10100-3-willy@infradead.org> (raw)
In-Reply-To: <20200804161755.10100-1-willy@infradead.org>

We no longer need to keep track of how many shadow entries are
present in a mapping.  This saves a few writes to the inode and
memory barriers.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/filemap.c    | 12 ------------
 mm/truncate.c   |  1 -
 mm/workingset.c |  1 -
 3 files changed, 14 deletions(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index 76383d558b7c..7c3f97bd6dcd 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -139,17 +139,6 @@ static void page_cache_delete(struct address_space *mapping,
 
 	page->mapping = NULL;
 	/* Leave page->index set: truncation lookup relies upon it */
-
-	if (shadow) {
-		mapping->nrexceptional += nr;
-		/*
-		 * Make sure the nrexceptional update is committed before
-		 * the nrpages update so that final truncate racing
-		 * with reclaim does not see both counters 0 at the
-		 * same time and miss a shadow entry.
-		 */
-		smp_wmb();
-	}
 	mapping->nrpages -= nr;
 }
 
@@ -860,7 +849,6 @@ static int __add_to_page_cache_locked(struct page *page,
 			goto unlock;
 
 		if (xa_is_value(old)) {
-			mapping->nrexceptional--;
 			if (shadowp)
 				*shadowp = old;
 		}
diff --git a/mm/truncate.c b/mm/truncate.c
index 7c4c8ac140be..a59184793607 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -40,7 +40,6 @@ static inline void __clear_shadow_entry(struct address_space *mapping,
 	if (xas_load(&xas) != entry)
 		return;
 	xas_store(&xas, NULL);
-	mapping->nrexceptional--;
 }
 
 static void clear_shadow_entry(struct address_space *mapping, pgoff_t index,
diff --git a/mm/workingset.c b/mm/workingset.c
index fdeabea54e77..0649bfb1ca33 100644
--- a/mm/workingset.c
+++ b/mm/workingset.c
@@ -547,7 +547,6 @@ static enum lru_status shadow_lru_isolate(struct list_head *item,
 		goto out_invalid;
 	if (WARN_ON_ONCE(node->count != node->nr_values))
 		goto out_invalid;
-	mapping->nrexceptional -= node->nr_values;
 	xas.xa_node = xa_parent_locked(&mapping->i_pages, node);
 	xas.xa_offset = node->offset;
 	xas.xa_shift = node->shift + XA_CHUNK_SHIFT;
-- 
2.27.0



  parent reply	other threads:[~2020-08-04 16:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-04 16:17 [PATCH 0/4] Remove nrexceptional tracking Matthew Wilcox (Oracle)
2020-08-04 16:17 ` [PATCH 1/4] mm: Introduce and use page_cache_empty Matthew Wilcox (Oracle)
2020-08-06 23:24   ` Kirill A. Shutemov
2020-08-16  1:48     ` Matthew Wilcox
2020-08-04 16:17 ` Matthew Wilcox (Oracle) [this message]
2020-08-04 16:17 ` [PATCH 3/4] dax: Account DAX entries as nrpages Matthew Wilcox (Oracle)
2020-08-04 16:17 ` [PATCH 4/4] mm: Remove nrexceptional from inode Matthew Wilcox (Oracle)
2020-08-06 19:44 ` [PATCH 0/4] Remove nrexceptional tracking Verma, Vishal L
2020-08-06 20:16   ` Verma, Vishal L
2020-10-08 19:33     ` Matthew Wilcox
2020-10-09 23:04       ` Verma, Vishal L

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200804161755.10100-3-willy@infradead.org \
    --to=willy@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nvdimm@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).