lkml.org 
[lkml]   [2021]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[RFC] The purpose of raw_spin_lock_bh()
I just noticed that we have raw_spin_lock_bh() and it has a few users.
My guess is that the API should be removed and the existing user(s)
should be moved to spin_lock_bh() / spinlock_t instead.
On !RT it works as expected and there is no difference compared to
spinlock_t.
On RT it is kind of broken: It uses a raw_spinlock_t, disables BH but
does not disable preemption. So it will spin on the lock but the owner
could be scheduled out.

I could (of course) make raw_spin_lock_bh() do the right thing on RT
but from a quick look in sock_map_update_common() there is at least
raw_spin_lock_bh(&stab->lock);
-> sock_map_add_link()
-> spin_lock_bh(&psock->link_lock);

which would then trigger a might_sleep().

Sebastian

\
 
 \ /
  Last update: 2021-01-08 18:59    [W:0.044 / U:0.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site