On 1/31/2026 10:50 AM, Barry Song wrote:
On Sat, Jan 31, 2026 at 10:27 AM Chao Yu <[email protected]> wrote:
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.
Hi Chao,
Is this even possible if can_nice() returns false, for example due to
missing CAP_SYS_NICE?
Hi Barry,
I think so, the priority will be temporarily uplifted and restored in lock
duration.
Proxy execution [1] is currently under development to address general
priority inversion; hopefully, it will resolve this issue.
Thanks for providing the material.
Yes, there should be generic solution in cpu scheduler and lock primitive
to resolve priority inversion issue. Then it will be benefit for all lock
users.
Not sure, it will be a little bit hard for rw semaphore, it needs to track
and check all reader threads' context in priority inversion scenario.
Thanks,
[1]
https://lpc.events/event/18/contributions/1887/attachments/1402/3074/LPC_%20Proxy%20Exec%20deep%20dive%20outline.pdf
Thanks
Barry
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel