Re: [PATCH 25/26] kprobes: Convert to raw_spinlocks

Frederic Weisbecker
2010-01-12T03:54:51Z

On Mon, Jan 11, 2010 at 10:26:55PM +0100, John Kacur wrote:
> Convert locks which cannot be sleeping locks in preempt-rt to raw_spinlocks.
>
> See also dc23e836d8d25fe5aa4057d54dae2094fbc614f6
>
> Signed-off-by: John Kacur <jkacur@redhat.com>
> ---
> include/linux/kprobes.h | 2 +-
> kernel/kprobes.c | 34 +++++++++++++++++-----------------
> 2 files changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
> index 1b672f7..620df87 100644
> --- a/include/linux/kprobes.h
> +++ b/include/linux/kprobes.h
> @@ -170,7 +170,7 @@ struct kretprobe {
> int nmissed;
> size_t data_size;
> struct hlist_head free_instances;
> - spinlock_t lock;
> + raw_spinlock_t lock;
> };

Indeed, this lock seems to be taken when a probe triggers, which
can happen in about every places/context.

Please add a comment to explain this though.

(Adding Masami in Cc).