Commit ff7f5ad7 authored by qiwu.chen's avatar qiwu.chen Committed by Andrew Morton

mm: kfence: fix elapsed time for allocated/freed track

Fix elapsed time for the allocated/freed track introduced by commit
62e73fd8.

Link: https://lkml.kernel.org/r/20240924085004.75401-1-qiwu.chen@transsion.com
Fixes: 62e73fd8 ("mm: kfence: print the elapsed time for allocated/freed track")
Signed-off-by: default avatarqiwu.chen <qiwu.chen@transsion.com>
Reviewed-by: default avatarMarco Elver <elver@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 7bf1823e
...@@ -109,7 +109,7 @@ static void kfence_print_stack(struct seq_file *seq, const struct kfence_metadat ...@@ -109,7 +109,7 @@ static void kfence_print_stack(struct seq_file *seq, const struct kfence_metadat
const struct kfence_track *track = show_alloc ? &meta->alloc_track : &meta->free_track; const struct kfence_track *track = show_alloc ? &meta->alloc_track : &meta->free_track;
u64 ts_sec = track->ts_nsec; u64 ts_sec = track->ts_nsec;
unsigned long rem_nsec = do_div(ts_sec, NSEC_PER_SEC); unsigned long rem_nsec = do_div(ts_sec, NSEC_PER_SEC);
u64 interval_nsec = local_clock() - meta->alloc_track.ts_nsec; u64 interval_nsec = local_clock() - track->ts_nsec;
unsigned long rem_interval_nsec = do_div(interval_nsec, NSEC_PER_SEC); unsigned long rem_interval_nsec = do_div(interval_nsec, NSEC_PER_SEC);
/* Timestamp matches printk timestamp format. */ /* Timestamp matches printk timestamp format. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment