summaryrefslogtreecommitdiff
path: root/include/uapi/linux/watch_queue.h
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2026-01-30 21:28:08 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2026-01-31 03:24:39 +0000
commit07de55cbf5762cb4a7e9e0db7aba5c10c8cfe079 (patch)
tree423f23b83359ddbd7878b660a0735643c8301f11 /include/uapi/linux/watch_queue.h
parentd860974a7e38d35e9e2c4dc8a9f4223b38b6ad99 (diff)
f2fs: fix lock priority inversion issue
If userspace thread has held f2fs rw semaphore, due to its low priority, it could be runnable or preempted state for long time, during the time, it will block high priority thread which is trying to grab the same rw semaphore, e.g. cp_rwsem, io_rwsem... To fix such issue, let's detect thread's priority when it tries to grab f2fs_rwsem lock, if the priority is lower than a priority threshold, let's uplift the priority before it enters into critical region of lock, and restore the priority after it leaves from critical region. Meanwhile, introducing two new sysfs nodes: - /sys/fs/f2fs/<disk>/adjust_lock_priority, it is used to control whether the functionality is enable or not. ========== ================== Flag_Value Flag_Description ========== ================== 0x00000000 Disabled (default) 0x00000001 cp_rwsem 0x00000002 node_change 0x00000004 node_write 0x00000008 gc_lock 0x00000010 cp_global 0x00000020 io_rwsem ========== ================== - /sys/fs/f2fs/<disk>/lock_duration_priority, it is used to control priority threshold. Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'include/uapi/linux/watch_queue.h')
0 files changed, 0 insertions, 0 deletions