From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795991593; b=dxhlK9ZLmPQVksG6ZytK0Ln/Dq+m/P/ndOv1XeD5Po9ZA5pLqeZBRt/0OAjpfW7Zf0yj ACZeQIpar5ews0ZxgwDGeUYCxdDTfVM1OgD0Ek+kFbBr3bknNZDKaiTuqAmRuJoPwMjbO Lo9+B9wSSMCrfTt6/vzEgm9OPZIi4yL1oFvUHLHFOVT5P8TMj+g8QZ4ebY6dulayWaOr+ gny16ibgk0Eesb83D7oZbh3sViOOqVLZAwjzKKCjbr89qu26ZVaThf3vu5cGfuqRgHJyS 3+y+rBcnQVnE11QRaMjWAx1zan1mG95/QA7sWLcHxLQDsOPg8WAUAmRCMOAMeq+KGiA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795991593; h=Received:DKIM-Signature:Date:To:From:Subject:Message-Id; bh=GY9ym5O/N/lmeKbEEWiucVnE4PhQ7e21ZZbHaORf+qM=; b=KbZqC0kMr4nrdWN5gHudMtoWycKSdsYCQ3idXbLd3M1CevIoJFsmdGV76dWwRq4u27ef x5XvT1UcaPGGb1VQ24jiOGdZCuHvQLygsfeLl/n+LZbuuYurc099FjeDP4bpY0fTcmyIP 063E/Me3eVx8jLpOS53TzQFo4sEM+2zWVKMWDmW1q1e6dAmXWlbzeKvWnm4xvYUJkWa0P upsMCP9hvu7oovwRhCgjSX+MRmWJ1D3mM/4w+pkHnQ1v+R/4y1bh2FBLwCxxdXV/lNL4Q BKG+Fn6gjsxWLE+39NKez2H7ItGhdQQ26r88VSK0N/waU901jQXZxrfOT47iEo3ENKA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=Jq7fyjpN; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E9AE606A31C for ; Sun, 29 Nov 2026 22:33:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=Jq7fyjpN Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9B5B1F00899; Sun, 29 Nov 2026 22:33:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1795991592; bh=GY9ym5O/N/lmeKbEEWiucVnE4PhQ7e21ZZbHaORf+qM=; h=Date:To:From:Subject; b=Jq7fyjpNtAueu3KBq0wJac7F/d1A4sd29JHqdsJi3H4AzdyByUfq85YmvI1YaBN/v ZQtqfLzqeCCUiBsiSp7WQKJ7az2FVgvbuD7YtMKAmIOZoqPyezelBBKZ2C7NeVGTPn 5JS0POfHTD60lBmzV8oSum/Z7NsWyu6ZwtMK5r/A= Date: Sun, 29 Nov 2026 14:33:12 -0800 To: mm-commits@vger.kernel.org,mark.rutland@arm.com,akpm@linux-foundation.org From: Andrew Morton Subject: + lib-atomic64-separate-hashed-locks-by-smp-cache-line.patch added to mm-nonmm-unstable branch Message-Id: <20261129223312.B9B5B1F00899@smtp.kernel.org> X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The patch titled Subject: lib/atomic64: separate hashed locks by SMP cache line has been added to the -mm mm-nonmm-unstable branch. Its filename is lib-atomic64-separate-hashed-locks-by-smp-cache-line.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/lib-atomic64-separate-hashed-locks-by-smp-cache-line.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: Andrew Morton Subject: lib/atomic64: separate hashed locks by SMP cache line Date: Sun, 29 Nov 2026 14:15:31 -0800 On machines where SMP_CACHE_BYTES exceeds L1_CACHE_BYTES, two hashed atomic64 locks can occupy the same shared cache line. Concurrent atomic64 operations on unrelated values then cause avoidable cache-line transfers between CPUs. This affects performance, not the correctness of the locks. The array is aligned to SMP_CACHE_BYTES, but each union is only L1_CACHE_BYTES long. Align the element type to SMP_CACHE_BYTES and remove the redundant padding. On affected ARC configurations using generic atomic64 operations, this separates the locks. On !SMP, the type needs no cache-line padding, so the 16-element array also consumes less memory. Signed-off-by: Andrew Morton Cc: Mark Rutland lib/atomic64.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/lib/atomic64.c~lib-atomic64-separate-hashed-locks-by-smp-cache-line +++ a/lib/atomic64.c @@ -24,10 +24,9 @@ /* * Ensure each lock is in a separate cacheline. */ -static union { +static struct { arch_spinlock_t lock; - char pad[L1_CACHE_BYTES]; -} atomic64_lock[NR_LOCKS] __cacheline_aligned_in_smp = { +} ____cacheline_aligned_in_smp atomic64_lock[NR_LOCKS] __cacheline_aligned_in_smp = { [0 ... (NR_LOCKS - 1)] = { .lock = __ARCH_SPIN_LOCK_UNLOCKED, }, _ Patches currently in -mm which might be from akpm@linux-foundation.org are mm-vma-drop-mm-asynchronously-in-vma_start_read-fix.patch mm-vma-drop-mm-asynchronously-in-vma_start_read-fix-2.patch kselftest-mm-rename-read_pmd_pagesize-to-pmd_psize-fix.patch selftests-mm-check-madv_cold-and-madv_pageout-on-partly-advised-thps-fix.patch selftests-mm-add-uffdio_move-huge-zeropage-pmd-regression-test-fix.patch selftests-mm-allocate-nr_pages-based-on-pmd-size-for-uffd-pmd_move-tests-fix.patch selftests-mm-retain-move-pmd-coverage-and-verify-huge-pmds.patch lib-test_xarray-check-unused-spare-node-after-range-creation.patch mm-memory-failure-dont-unpoison-a-leaked-raw_hwp_unreliable-folio-fix.patch mm-hugetlb-delay-anon-folio-rmap-removal-until-after-the-tlb-flush-fix.patch mm-hugetlb-delay-anon-folio-rmap-removal-until-after-the-tlb-flush-fix-2.patch mm-vmstat_kunit-add-synthetic-benchmark-for-mm-stats-fix.patch mm-prevent-pre-content-bypass-through-mremap-and-remap_file_pages.patch afs-do-not-put-error-pointer-after-address-lookup-failure.patch selftests-mm-check-that-fsync-reports-hard-poisoned-dirty-page-cache.patch selftests-mm-memory-failure-truncate-poisoned-fuse-page-cache-before-teardown.patch selftests-mm-memory-failure-skip-poisoned-dirty-page-cache-on-nilfs2.patch selftest-mm-memory-failure-keep-page-cache-files-linked-until-cleanup.patch selftest-mm-memory-failure-keep-page-cache-files-linked-until-cleanup-fix.patch selftests-mm-memory-failure-skip-hard-dirty-page-cache-test-on-cephfs.patch selftests-mm-memory-failure-close-dirty-page-cache-files-before-unlinking-them.patch selftests-mm-memory-failure-extend-page-cache-test-files-with-pwrite.patch selftests-mm-memory-failure-write-the-whole-page-cache-test-file-for-omfs.patch selftests-mm-memory-failure-accept-eio-from-close-after-poisoning-dirty-data.patch alloc_tag-introduce-ioctls-to-toggle-allocation-tracepoints-fix-fix.patch alloc_tag-introduce-ioctls-to-toggle-allocation-tracepoints-fix.patch mm-vmscan-scope-freeze-writeback-skip-to-the-reclaim-target.patch mm-vmscan-scope-freeze-writeback-skip-to-the-reclaim-target-fix.patch mm-hmm-refuse-secretmem-vmas-in-hmm_range_fault-fix.patch ocfs2-unregister-the-jbd2-shrinker-before-journal-shutdown.patch ipc-msg-clamp-negative-msg_info-usage-counts.patch squashfs-fix-leaked-page-locks-when-page-actor-allocation-fails-fix.patch ocfs2-skip-network-flush-when-no-domain-handlers-are-registered.patch selftests-ptrace-check-that-ptrace_set_syscall_info-rejects-invalid-error-values-fix.patch kernfs-fix-a-race-on-the-count-of-mmapped-files.patch kernfs-path-lookup-scalability-improvements.patch kernfs-path-lookup-scalability-improvements-fix.patch kernfs-make-getattr-lockless.patch kernfs-make-getattr-lockless-fix.patch kernfs-open-and-close-plain-files-without-the-open-file-mutex.patch kernfs-keep-the-kernfs_open_node-for-a-while-after-the-last-close.patch kernfs-open-and-close-files-with-release-without-the-open-file-mutex.patch lib-atomic64-separate-hashed-locks-by-smp-cache-line.patch nvdimm-btt-separate-map-locks-by-smp-cache-line.patch drivers-media-v4l2-core-v4l2-vp9c-reduce-inlining.patch