lkml.org 
[lkml]   [2018]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm/kasan: make quarantine_lock a raw_spinlock_t
On Fri, Oct 12, 2018 at 04:56:55PM -0700, Andrew Morton wrote:
> There are several reasons for using raw_*, so an explanatory comment at
> each site is called for.
>
> However it would be smarter to stop "using raw_* for several reasons".
> Instead, create a differently named variant for each such reason. ie, do
>
> /*
> * Nice comment goes here. It explains all the possible reasons why -rt
> * might use a raw_spin_lock when a spin_lock could otherwise be used.
> */
> #define raw_spin_lock_for_rt raw_spinlock
>
> Then use raw_spin_lock_for_rt() at all such sites.

The whole raw_spinlock_t is for RT, no other reason. It is the one true
spinlock.

From this, it naturally follows that:

- nesting order: raw_spinlock_t < spinlock_t < mutex_t
- raw_spinlock_t sections must be bounded

The patch under discussion is the result of the nesting order rule; and
is allowed to violate the second rule, by virtue of it being debug code.

There are no other reasons; and I'm somewhat confused by what you
propose.

\
 
 \ /
  Last update: 2018-10-13 15:52    [W:0.129 / U:2.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site