All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] rwsem_down_write_slowpath check if oob() before skipping schedule()
@ 2023-05-30 19:04 Dave Rolenc
  2023-05-31  6:22 ` Philippe Gerum
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Rolenc @ 2023-05-30 19:04 UTC (permalink / raw)
  To: xenomai@lists.linux.dev; +Cc: Dave Rolenc, Russell Johnson

This fixes a timing-dependent bug that would cause a tight loop without
schedule() when running in-band. The rwsem would get released enough to
allow this tight loop without schedule() to execute when the handoff
bit got set, but it would never allow the previous on-CPU owner to
finish releasing the rwsem. Checking to see if we are running oob before
skipping the schedule() seems to fix the problem. This problem was nasty
when the global kernfs_rwsem was the target semaphore since many tasks
ended up in D state waiting on the kernfs_rwsem. 

We would typically see this problem when repeatedly starting/stopping an
EVL-enabled application, which would create and tear-down a lot of EVL
elements. Eventually, the timing worked out to where we'd get a stuck
CPU message and a bunch of tasks in D-state waiting on the kernfs_rwsem.
The cuplrit task was stuck in a forever loop in
rwsem_down_write_slowpath() with the handoff bit set and skipping the
schedule() call. 

This patch is based on 5.15.98.

This is also my first patch submission to this group, so if you need me
to follow some specific procedure or checklist for patch submission,
please let me know and I'll comply.

Dave Rolenc (1):
  rwsem_down_write_slowpath check if oob() before skipping schedule()

 kernel/locking/rwsem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.39.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-05-31 21:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-30 19:04 [PATCH 0/1] rwsem_down_write_slowpath check if oob() before skipping schedule() Dave Rolenc
2023-05-31  6:22 ` Philippe Gerum
2023-05-31 15:27   ` Dave Rolenc
2023-05-31 16:55     ` Philippe Gerum
2023-05-31 21:48       ` [External] - " Dave Rolenc

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.