mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [nacked] kfence-replace-local_clock-with-ktime_get_boot_fast_ns.patch removed from -mm tree
@ 2023-11-22 21:10 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2023-11-22 21:10 UTC (permalink / raw)
  To: mm-commits, glider, elver, dvyukov, juntong.deng, akpm


The quilt patch titled
     Subject: kfence: replace local_clock() with ktime_get_boot_fast_ns()
has been removed from the -mm tree.  Its filename was
     kfence-replace-local_clock-with-ktime_get_boot_fast_ns.patch

This patch was dropped because it was nacked

------------------------------------------------------
From: Juntong Deng <juntong.deng@outlook.com>
Subject: kfence: replace local_clock() with ktime_get_boot_fast_ns()
Date: Wed, 22 Nov 2023 20:00:26 +0000

The time obtained by local_clock() is the local CPU time, which may
drift between CPUs and is not suitable for comparison across CPUs.

It is possible for allocation and free to occur on different CPUs,
and using local_clock() to record timestamps may cause confusion.

ktime_get_boot_fast_ns() is based on clock sources and can be used
reliably and accurately for comparison across CPUs.

Link: https://lkml.kernel.org/r/VI1P193MB0752A2F21C050D701945B62799BAA@VI1P193MB0752.EURP193.PROD.OUTLOOK.COM
Signed-off-by: Juntong Deng <juntong.deng@outlook.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Marco Elver <elver@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/kfence/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/kfence/core.c~kfence-replace-local_clock-with-ktime_get_boot_fast_ns
+++ a/mm/kfence/core.c
@@ -295,7 +295,7 @@ metadata_update_state(struct kfence_meta
 	track->num_stack_entries = num_stack_entries;
 	track->pid = task_pid_nr(current);
 	track->cpu = raw_smp_processor_id();
-	track->ts_nsec = local_clock(); /* Same source as printk timestamps. */
+	track->ts_nsec = ktime_get_boot_fast_ns();
 
 	/*
 	 * Pairs with READ_ONCE() in
_

Patches currently in -mm which might be from juntong.deng@outlook.com are

kasan-improve-free-meta-storage-in-generic-kasan.patch


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

only message in thread, other threads:[~2023-11-22 21:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-22 21:10 [nacked] kfence-replace-local_clock-with-ktime_get_boot_fast_ns.patch removed from -mm tree Andrew Morton

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).