Commit 52dea0a1 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Frederic Weisbecker
Browse files

posix-timers: Convert timer list to hlist



No requirement for a real list. Spare a few bytes.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarFrederic Weisbecker <frederic@kernel.org>
Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
parent aca1dc0c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -2456,13 +2456,13 @@ static void *timers_start(struct seq_file *m, loff_t *pos)
	if (!tp->sighand)
		return ERR_PTR(-ESRCH);

	return seq_list_start(&tp->task->signal->posix_timers, *pos);
	return seq_hlist_start(&tp->task->signal->posix_timers, *pos);
}

static void *timers_next(struct seq_file *m, void *v, loff_t *pos)
{
	struct timers_private *tp = m->private;
	return seq_list_next(v, &tp->task->signal->posix_timers, pos);
	return seq_hlist_next(v, &tp->task->signal->posix_timers, pos);
}

static void timers_stop(struct seq_file *m, void *v)
@@ -2491,7 +2491,7 @@ static int show_timer(struct seq_file *m, void *v)
		[SIGEV_THREAD] = "thread",
	};

	timer = list_entry((struct list_head *)v, struct k_itimer, list);
	timer = hlist_entry((struct hlist_node *)v, struct k_itimer, list);
	notify = timer->it_sigev_notify;

	seq_printf(m, "ID: %d\n", timer->it_id);
+1 −1
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ static inline void posix_cputimers_init_work(void) { }
 * @rcu:		RCU head for freeing the timer.
 */
struct k_itimer {
	struct list_head	list;
	struct hlist_node	list;
	struct hlist_node	t_hash;
	spinlock_t		it_lock;
	const struct k_clock	*kclock;
+1 −1
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@ struct signal_struct {

	/* POSIX.1b Interval Timers */
	unsigned int		next_posix_timer_id;
	struct list_head	posix_timers;
	struct hlist_head	posix_timers;

	/* ITIMER_REAL timer for the process */
	struct hrtimer real_timer;
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ static struct signal_struct init_signals = {
	.cred_guard_mutex = __MUTEX_INITIALIZER(init_signals.cred_guard_mutex),
	.exec_update_lock = __RWSEM_INITIALIZER(init_signals.exec_update_lock),
#ifdef CONFIG_POSIX_TIMERS
	.posix_timers = LIST_HEAD_INIT(init_signals.posix_timers),
	.posix_timers	= HLIST_HEAD_INIT,
	.cputimer	= {
		.cputime_atomic	= INIT_CPUTIME_ATOMIC,
	},
+1 −1
Original line number Diff line number Diff line
@@ -1861,7 +1861,7 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
	prev_cputime_init(&sig->prev_cputime);

#ifdef CONFIG_POSIX_TIMERS
	INIT_LIST_HEAD(&sig->posix_timers);
	INIT_HLIST_HEAD(&sig->posix_timers);
	hrtimer_init(&sig->real_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
	sig->real_timer.function = it_real_fn;
#endif
Loading