diff options
author | John Hubbard <jhubbard@nvidia.com> | 2024-02-28 04:41:51 +0100 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-03-05 02:01:27 +0100 |
commit | 6c1b748ebf27befffec83b77ca1960bf70ed6ac9 (patch) | |
tree | f7f95f3c4d79bb6e47a2c89d41a59a553ce6d51d /mm/zsmalloc.c | |
parent | mm: add alloc_contig_migrate_range allocation statistics (diff) | |
download | linux-6c1b748ebf27befffec83b77ca1960bf70ed6ac9.tar.xz linux-6c1b748ebf27befffec83b77ca1960bf70ed6ac9.zip |
mm/memory.c: do_numa_page(): remove a redundant page table read
do_numa_page() is reading from the same page table entry, twice, while
holding the page table lock: once while checking that the pte hasn't
changed, and again in order to modify the pte.
Instead, just read the pte once, and save it in the same old_pte variable
that already exists. This has no effect on behavior, other than to
provide a tiny potential improvement to performance, by avoiding the
redundant memory read (which the compiler cannot elide, due to
READ_ONCE()).
Also improve the associated comments nearby.
Link: https://lkml.kernel.org/r/20240228034151.459370-1-jhubbard@nvidia.com
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/zsmalloc.c')
0 files changed, 0 insertions, 0 deletions