From: Frank Ch. Eigler Date: Mon, 28 Jun 2010 00:53:37 +0000 (-0400) Subject: PR11759: more DEFINE_*LOCK -> DEFINE_RAW_*lock for CONFIG_PREEMPT_RT X-Git-Tag: release-1.3~155 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=eaa985518ac15debf8c072c8b160f99e3b7072d1;p=systemtap.git PR11759: more DEFINE_*LOCK -> DEFINE_RAW_*lock for CONFIG_PREEMPT_RT --- diff --git a/runtime/addr-map.c b/runtime/addr-map.c index abb723f38..528641c9f 100644 --- a/runtime/addr-map.c +++ b/runtime/addr-map.c @@ -28,8 +28,11 @@ struct addr_map struct addr_map_entry entries[0]; }; +#ifdef CONFIG_PREEMPT_RT +static DEFINE_RAW_SPINLOCK(addr_map_lock); +#else static DEFINE_SPINLOCK(addr_map_lock); - +#endif static struct addr_map* blackmap; /* Find address of entry where we can insert a new one. */ diff --git a/runtime/alloc.c b/runtime/alloc.c index b2578e06e..2e22bada1 100644 --- a/runtime/alloc.c +++ b/runtime/alloc.c @@ -35,7 +35,11 @@ static int _stp_allocated_net_memory = 0; static int _stp_allocated_memory = 0; #ifdef DEBUG_MEM +#ifdef CONFIG_PREEMPT_RT +static DEFINE_RAW_SPINLOCK(_stp_mem_lock); +#else static DEFINE_SPINLOCK(_stp_mem_lock); +#endif #define MEM_MAGIC 0xc11cf77f #define MEM_FENCE_SIZE 32 diff --git a/runtime/print_flush.c b/runtime/print_flush.c index 52017426e..c7fedf236 100644 --- a/runtime/print_flush.c +++ b/runtime/print_flush.c @@ -16,7 +16,11 @@ * @note Preemption must be disabled to use this. */ +#ifdef CONFIG_PREEMPT_RT +static DEFINE_RAW_SPINLOCK(_stp_print_lock); +#else static DEFINE_SPINLOCK(_stp_print_lock); +#endif void EXPORT_FN(stp_print_flush)(_stp_pbuf *pb) { diff --git a/runtime/probe_lock.h b/runtime/probe_lock.h index 52d1850e9..e25821393 100644 --- a/runtime/probe_lock.h +++ b/runtime/probe_lock.h @@ -22,7 +22,7 @@ struct stp_probe_lock { atomic_t *skipped; #endif #ifdef CONFIG_PREEMPT_RT - raw_rwlock_t *lock + raw_rwlock_t *lock; #else rwlock_t *lock; #endif diff --git a/runtime/task_finder_map.c b/runtime/task_finder_map.c index b770dd0ed..76371ea0e 100644 --- a/runtime/task_finder_map.c +++ b/runtime/task_finder_map.c @@ -13,7 +13,11 @@ // contents in interrupt context (which should only ever call // stap_find_map_map_info for getting stored info). So we might // want to look into that if this seems a bottleneck. +#ifdef CONFIG_PREEMPT_RT +static DEFINE_RAW_RWLOCK(__stp_tf_map_lock); +#else static DEFINE_RWLOCK(__stp_tf_map_lock); +#endif #define __STP_TF_HASH_BITS 4 #define __STP_TF_TABLE_SIZE (1 << __STP_TF_HASH_BITS) diff --git a/runtime/task_finder_vma.c b/runtime/task_finder_vma.c index 8874f110a..3d24078f6 100644 --- a/runtime/task_finder_vma.c +++ b/runtime/task_finder_vma.c @@ -12,7 +12,11 @@ // contents in interrupt context (which should only ever call // stap_find_vma_map_info for getting stored vma info). So we might // want to look into that if this seems a bottleneck. +#ifdef CONFIG_PREEMPT_RT +static DEFINE_RAW_RWLOCK(__stp_tf_vma_lock); +#else static DEFINE_RWLOCK(__stp_tf_vma_lock); +#endif #define __STP_TF_HASH_BITS 4 #define __STP_TF_TABLE_SIZE (1 << __STP_TF_HASH_BITS) diff --git a/runtime/transport/control.c b/runtime/transport/control.c index 8712a8adb..447e5ca88 100644 --- a/runtime/transport/control.c +++ b/runtime/transport/control.c @@ -16,7 +16,11 @@ static _stp_mempool_t *_stp_pool_q; static struct list_head _stp_ctl_ready_q; +#ifdef CONFIG_PREEMPT_RT +static DEFINE_RAW_SPINLOCK(_stp_ctl_ready_lock); +#else static DEFINE_SPINLOCK(_stp_ctl_ready_lock); +#endif static void _stp_cleanup_and_exit(int send_exit); diff --git a/runtime/uprobes/uprobes.c b/runtime/uprobes/uprobes.c index 0e48efa56..403de189d 100644 --- a/runtime/uprobes/uprobes.c +++ b/runtime/uprobes/uprobes.c @@ -87,7 +87,11 @@ static DEFINE_MUTEX(uproc_mutex); /* Table of uprobe_tasks, hashed by task_struct pointer. */ static struct hlist_head utask_table[UPROBE_TABLE_SIZE]; +#ifdef CONFIG_PREEMPT_RT +static DEFINE_RAW_SPINLOCK(utask_table_lock); +#else static DEFINE_SPINLOCK(utask_table_lock); +#endif #define lock_uproc_table() mutex_lock(&uproc_mutex) #define unlock_uproc_table() mutex_unlock(&uproc_mutex) diff --git a/runtime/uprobes2/uprobes.c b/runtime/uprobes2/uprobes.c index 7f6651159..c70ef3eda 100644 --- a/runtime/uprobes2/uprobes.c +++ b/runtime/uprobes2/uprobes.c @@ -87,7 +87,11 @@ static DEFINE_MUTEX(uproc_mutex); /* Table of uprobe_tasks, hashed by task_struct pointer. */ static struct hlist_head utask_table[UPROBE_TABLE_SIZE]; +#ifdef CONFIG_PREEMPT_RT +static DEFINE_RAW_SPINLOCK(utask_table_lock); +#else static DEFINE_SPINLOCK(utask_table_lock); +#endif #define lock_uproc_table() mutex_lock(&uproc_mutex) #define unlock_uproc_table() mutex_unlock(&uproc_mutex)