All of lore.kernel.org
 help / color / mirror / Atom feed
* [obsolete] mm-remove-an-avoidable-load-of-page-refcount-in-page_ref_add_unless.patch removed from -mm tree
@ 2025-01-09  4:53 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-01-09  4:53 UTC (permalink / raw)
  To: mm-commits, yuzhao, willy, david, mjguzik, akpm

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2083 bytes --]


The quilt patch titled
     Subject: mm: remove an avoidable load of page refcount in page_ref_add_unless
has been removed from the -mm tree.  Its filename was
     mm-remove-an-avoidable-load-of-page-refcount-in-page_ref_add_unless.patch

This patch was dropped because it is obsolete

------------------------------------------------------
From: Mateusz Guzik <mjguzik@gmail.com>
Subject: mm: remove an avoidable load of page refcount in page_ref_add_unless
Date: Sat, 7 Dec 2024 09:29:31 +0100

Explicitly pre-checking the count adds nothing as atomic_add_unless starts
with doing the same thing.  iow no functional changes.

disasm of stock filemap_get_read_batch from perf top while running
readseek2_processes -t 24:

  0.04 │ cb:   mov    0x34(%rbx),%eax           # first load
 73.11 │       test   %eax,%eax
       │     ↓ je     1bd
  0.09 │       mov    0x34(%rbx),%eax           # second load
  1.01 │ d9:   test   %eax,%eax
       │     ↓ je     1bd
  0.06 │       lea    0x1(%rax),%edx
  0.00 │       lea    0x34(%rbx),%r14
  0.00 │       lock   cmpxchg %edx,0x34(%rbx)
 14.06 │     ↑ jne    d9

Link: https://lkml.kernel.org/r/20241207082931.1707465-1-mjguzik@gmail.com
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Yu Zhao <yuzhao@google.com>
Cc: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/page_ref.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/include/linux/page_ref.h~mm-remove-an-avoidable-load-of-page-refcount-in-page_ref_add_unless
+++ a/include/linux/page_ref.h
@@ -234,7 +234,7 @@ static inline bool page_ref_add_unless(s
 
 	rcu_read_lock();
 	/* avoid writing to the vmemmap area being remapped */
-	if (!page_is_fake_head(page) && page_ref_count(page) != u)
+	if (!page_is_fake_head(page))
 		ret = atomic_add_unless(&page->_refcount, nr, u);
 	rcu_read_unlock();
 
_

Patches currently in -mm which might be from mjguzik@gmail.com are

get_task_exe_file-check-pf_kthread-locklessly.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-01-09  4:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-09  4:53 [obsolete] mm-remove-an-avoidable-load-of-page-refcount-in-page_ref_add_unless.patch removed from -mm tree Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.