Hi Stephen,
Thank you for your reply!
Changing the lock sequence may be difficult here since the function
- j1939_sk_errqueue
has may call sites. However, this function attempts to hold the
- j1939_socks_lock
whose hierchy is pretty high in the given code logic. On the other hand,
this function only reads from the
- j1939_socks_list
which the above lock protects against. Therefore, it seems appropriate to
lock the above list inside the function for read access only.
The RCU approach makes sense here, but I probably need to use RCU in
conjunction with other spinlocks and rwlocks in the codebase. Would that
be okay? If not, should I be looking into replacing all the locks with
RCU? I'm actually a mentee for the bug fixing mentorship this summer.
So please bear with me if some of these questions seem a bit naive :D
Thank you so much for your time!
Best regards,
Ziqi