All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,yuzhao@google.com,willy@infradead.org,david@redhat.com,mjguzik@gmail.com,akpm@linux-foundation.org
Subject: [obsolete] mm-remove-an-avoidable-load-of-page-refcount-in-page_ref_add_unless.patch removed from -mm tree
Date: Wed, 08 Jan 2025 20:53:20 -0800	[thread overview]
Message-ID: <20250109045321.5CFF6C4CED2@smtp.kernel.org> (raw)

[-- 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


                 reply	other threads:[~2025-01-09  4:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20250109045321.5CFF6C4CED2@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=mjguzik@gmail.com \
    --cc=mm-commits@vger.kernel.org \
    --cc=willy@infradead.org \
    --cc=yuzhao@google.com \
    /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 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.