This repository has been archived by the owner on May 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: fix panic at m0_locality_chores_run() on NUMA nodes (#833)
lib: fix panic at m0_locality_chores_run() on NUMA nodes On NUMA nodes, with numad service enabled, CPU affinity of locality threads can be changed (especially, for compute- intensive applications which use a lot of CPU and/or memory). As a result, this leads to the following panic: Motr panic: (locality == m0_locality_here()) at m0_locality_chores_run() lib/locality.c:310 (errno: 0) (last failed: none) [git: sage-base-1.0-389-g09ff618] #0 0x00002b25fbcb6387 in raise () from /usr/lib64/libc.so.6 #1 0x00002b25fbcb7a78 in abort () from /usr/lib64/libc.so.6 #2 0x00002b25fc5e7acd in m0_arch_panic (c=c@entry=0x2b25fca74400 <__pctx.15545>, ap=ap@entry=0x2b26032c7a18) at lib/user_space/uassert.c:131 #3 0x00002b25fc5d7e44 in m0_panic (ctx=ctx@entry=0x2b25fca74400 <__pctx.15545>) at lib/assert.c:52 #4 0x00002b25fc5dbf6a in m0_locality_chores_run (locality=locality@entry=0x106f778) at lib/locality.c:310 #5 0x00002b25fc5abcaa in loc_handler_thread (th=0xf5d160) at fop/fom.c:926 #6 0x00002b25fc5de2ee in m0_thread_trampoline (arg=arg@entry=0xf5d168) at lib/thread.c:117 #7 0x00002b25fc5e882d in uthread_trampoline (arg=0xf5d168) at lib/user_space/uthread.c:98 #8 0x00002b25fba6bea5 in start_thread () from /usr/lib64/libpthread.so.0 #9 0x00002b25fbd7e96d in clone () from /usr/lib64/libc.so.6 The reason is that we link our localities to the CPUs in the very beginning, when the application is just started and Motr is initialised. And we use the CPU id to figure out the current locality at m0_locality_here(). Of course, when the affinity is changed later and the thread is moved to another CPU, this gives the wrong locality result. Solution: stash the initial CPU id in TLS and use it at m0_locality_here(). Kudos to Nikita Danilov for the idea. Reviewed-by: Nikita Danilov <nikita.danilov@seagate.com> Reviewed-by: Huang Hua <hua.huang@seagate.com> Signed-off-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
- Loading branch information
Showing
5 changed files
with
55 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters