Re: [PATCH 1/4] posix-timers: move global timer id management tosignal_struct v2

From: Thomas Gleixner
Date: Fri Sep 02 2011 - 05:19:32 EST


On Mon, 29 Aug 2011, Andi Kleen wrote:

Hint: Ccing maintainers of affected code might help to get code
reviewed and eventually merged.

> diff --git a/include/linux/init_task.h b/include/linux/init_task.h
> index d14e058..564248d 100644
> --- a/include/linux/init_task.h
> +++ b/include/linux/init_task.h
> @@ -10,6 +10,7 @@
> #include <linux/pid_namespace.h>
> #include <linux/user_namespace.h>
> #include <linux/securebits.h>
> +#include <linux/idr.h>

New line please.

> #include <net/net_namespace.h>
>
> #ifdef CONFIG_SMP
> @@ -37,6 +38,7 @@ extern struct fs_struct init_fs;
> .list = LIST_HEAD_INIT(sig.shared_pending.list), \
> .signal = {{0}}}, \
> .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \
> + .idr_lock = __SPIN_LOCK_UNLOCKED(idr_lock), \

sig.idr_lock

Also is there a requirement, that this is a spinlock? AFAICT it's all
process context and slowpath, so we can make it a mutex.

> .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \
> .rlim = INIT_RLIMITS, \
> .cputimer = { \
> @@ -46,6 +48,7 @@ extern struct fs_struct init_fs;
> }, \
> .cred_guard_mutex = \
> __MUTEX_INITIALIZER(sig.cred_guard_mutex), \
> + .posix_timers_id = IDR_INIT(posix_timer_id), \

sig.posix_timer_id

> INIT_THREADGROUP_FORK_LOCK(sig) \
> }

> @@ -541,6 +539,7 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
> int error, new_timer_id;
> sigevent_t event;
> int it_id_set = IT_ID_NOT_SET;
> + struct signal_struct *s = current->signal;

*sig please, cryptic variable names are a PITA.

Thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/