]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm: correct misleading comment on mmap_lock field in mm_struct
authorAdrian Huang (Lenovo) <adrianhuang0701@gmail.com>
Wed, 6 Aug 2025 14:59:06 +0000 (22:59 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 12 Sep 2025 00:24:39 +0000 (17:24 -0700)
The comment previously described the offset of mmap_lock as 0x120 (hex),
which is misleading.  The correct offset is 56 bytes (decimal) from the
last cache line boundary.  Using '0x120' could confuse readers trying to
understand why the count and owner fields reside in separate cachelines.

This change also removes an unnecessary space for improved formatting.

Link: https://lkml.kernel.org/r/20250806145906.24647-1-adrianhuang0701@gmail.com
Signed-off-by: Adrian Huang (Lenovo) <adrianhuang0701@gmail.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/mm_types.h

index 08bc2442db93484123f0402607cfc6f6e2abcf0b..3ed763e7ec6f543d380d3b9043f9ec316b61e3fa 100644 (file)
@@ -1026,10 +1026,10 @@ struct mm_struct {
                                             * counters
                                             */
                /*
-                * With some kernel config, the current mmap_lock's offset
-                * inside 'mm_struct' is at 0x120, which is very optimal, as
+                * Typically the current mmap_lock's offset is 56 bytes from
+                * the last cacheline boundary, which is very optimal, as
                 * its two hot fields 'count' and 'owner' sit in 2 different
-                * cachelines,  and when mmap_lock is highly contended, both
+                * cachelines, and when mmap_lock is highly contended, both
                 * of the 2 fields will be accessed frequently, current layout
                 * will help to reduce cache bouncing.
                 *