* [merged mm-stable] x86-mm-pat-inline-memtype_match-into-memtype_erase.patch removed from -mm tree
@ 2025-05-21 16:57 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-05-21 16:57 UTC (permalink / raw)
To: mm-commits, vbabka, tursulin, tglx, rostedt, rodrigo.vivi, peterz,
peterx, mingo, mhiramat, mathieu.desnoyers, luto, lorenzo.stoakes,
Liam.Howlett, joonas.lahtinen, jannh, jani.nikula, hpa, bp,
airlied, david, akpm
The quilt patch titled
Subject: x86/mm/pat: inline memtype_match() into memtype_erase()
has been removed from the -mm tree. Its filename was
x86-mm-pat-inline-memtype_match-into-memtype_erase.patch
This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: David Hildenbrand <david@redhat.com>
Subject: x86/mm/pat: inline memtype_match() into memtype_erase()
Date: Mon, 12 May 2025 14:34:22 +0200
Let's just have it in a single function. The resulting function is
certainly small enough and readable.
Link: https://lkml.kernel.org/r/20250512123424.637989-10-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Betkov <bp@alien8.de>
Cc: Dave Airlie <airlied@gmail.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Jann Horn <jannh@google.com>
Cc: Jonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleinxer <tglx@linutronix.de>
Cc: Tvrtko Ursulin <tursulin@ursulin.net>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
arch/x86/mm/pat/memtype_interval.c | 31 +++++++--------------------
1 file changed, 9 insertions(+), 22 deletions(-)
--- a/arch/x86/mm/pat/memtype_interval.c~x86-mm-pat-inline-memtype_match-into-memtype_erase
+++ a/arch/x86/mm/pat/memtype_interval.c
@@ -49,21 +49,6 @@ INTERVAL_TREE_DEFINE(struct memtype, rb,
static struct rb_root_cached memtype_rbroot = RB_ROOT_CACHED;
-static struct memtype *memtype_match(u64 start, u64 end)
-{
- struct memtype *entry_match;
-
- entry_match = interval_iter_first(&memtype_rbroot, start, end-1);
-
- while (entry_match != NULL && entry_match->start < end) {
- if (entry_match->start == start && entry_match->end == end)
- return entry_match;
- entry_match = interval_iter_next(entry_match, start, end-1);
- }
-
- return NULL; /* Returns NULL if there is no match */
-}
-
static int memtype_check_conflict(u64 start, u64 end,
enum page_cache_mode reqtype,
enum page_cache_mode *newtype)
@@ -119,14 +104,16 @@ int memtype_check_insert(struct memtype
struct memtype *memtype_erase(u64 start, u64 end)
{
- struct memtype *entry_old;
-
- entry_old = memtype_match(start, end);
- if (!entry_old)
- return ERR_PTR(-EINVAL);
+ struct memtype *entry = interval_iter_first(&memtype_rbroot, start, end - 1);
- interval_remove(entry_old, &memtype_rbroot);
- return entry_old;
+ while (entry && entry->start < end) {
+ if (entry->start == start && entry->end == end) {
+ interval_remove(entry, &memtype_rbroot);
+ return entry;
+ }
+ entry = interval_iter_next(entry, start, end - 1);
+ }
+ return ERR_PTR(-EINVAL);
}
struct memtype *memtype_lookup(u64 addr)
_
Patches currently in -mm which might be from david@redhat.com are
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-05-21 16:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-21 16:57 [merged mm-stable] x86-mm-pat-inline-memtype_match-into-memtype_erase.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.