Skip to contentSkip to conversation

rt_mutex: convert the code to use new plists

PATCH In review Oleg Nesterov 1 participant 1 message May 9, 2005

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 3/4 rt_mutex: convert the code to use new plists

This patch changes the code, mainly in kernel/rt.c, to use new plists.

This patch incomplete (rt.c can't be compiled), because I suspect the bugs in rt.c, which are "fixed" in the next patch.

include/linux/sched.h renamed from include/linux/sched.h~2_PORT +1 -1
@@ -840,7 +840,7 @@ struct task_struct {
 
 	/* realtime bits */
 	struct list_head delayed_put;
-	struct plist pi_waiters;
+	struct pl_head pi_waiters;
 
 	/* RT deadlock detection and priority inheritance handling */
 	struct rt_mutex_waiter *blocked_on;
include/linux/rt_lock.h renamed from include/linux/rt_lock.h~2_PORT +5 -5
@@ -67,7 +67,7 @@ typedef struct {
  */
 struct rt_mutex {
 	raw_spinlock_t		wait_lock;
-	struct plist		wait_list;
+	struct pl_head		wait_list;
 	struct task_struct	*owner;
 	int			owner_prio;
 # ifdef CONFIG_RT_DEADLOCK_DETECT
@@ -85,8 +85,8 @@ struct rt_mutex {
  */
 struct rt_mutex_waiter {
 	struct rt_mutex *lock;
-	struct plist	 list;
-	struct plist	 pi_list;
+	struct pl_node	 list;
+	struct pl_node	 pi_list;
 	struct task_struct *task;
 
 	unsigned long eip;	// for debugging
@@ -95,12 +95,12 @@ struct rt_mutex_waiter {
 #ifdef CONFIG_RT_DEADLOCK_DETECT
 # define __RT_MUTEX_INITIALIZER(lockname) \
 	{ .wait_lock = RAW_SPIN_LOCK_UNLOCKED, \
-	.wait_list = PLIST_INIT((lockname).wait_list, MAX_PRIO),  \
+	.wait_list = PL_HEAD_INIT((lockname).wait_list),  \
 	.name = #lockname, .file = __FILE__, .line = __LINE__ }
 #else
 # define __RT_MUTEX_INITIALIZER(lockname) \
 	{ .wait_lock = RAW_SPIN_LOCK_UNLOCKED, \
-	PLIST_INIT((lockname).wait_list, MAX_PRIO) }
+	PL_HEAD_INIT((lockname).wait_list) }
 #endif
 /*
  * RW-semaphores are an RT mutex plus a reader-depth count.
include/linux/init_task.h renamed from include/linux/init_task.h~2_PORT +1 -2
@@ -110,8 +110,7 @@ extern struct group_info init_groups;
 	.proc_lock	= SPIN_LOCK_UNLOCKED,				\
 	.switch_lock	= RAW_SPIN_LOCK_UNLOCKED,			\
 	.delayed_put	= LIST_HEAD_INIT(tsk.delayed_put),		\
-	.pi_waiters.dp_node = LIST_HEAD_INIT(tsk.pi_waiters.dp_node),	\
-	.pi_waiters.sp_node = LIST_HEAD_INIT(tsk.pi_waiters.sp_node),	\
+	.pi_waiters	= PL_HEAD_INIT(tsk.pi_waiters),			\
 	.journal_info	= NULL,						\
 	.cpu_timers	= INIT_CPU_TIMERS(tsk.cpu_timers),		\
 }
kernel/fork.c renamed from kernel/fork.c~2_PORT +1 -1
@@ -990,7 +990,7 @@ static task_t *copy_process(unsigned lon
  	}
 #endif
 	INIT_LIST_HEAD(&p->delayed_put);
-	plist_init(&p->pi_waiters, 0);
+	pl_head_init(&p->pi_waiters);
 	p->blocked_on = NULL; /* not blocked yet */
 
 	p->tgid = p->pid;
kernel/rt.c renamed from kernel/rt.c~2_PORT +27 -37

190 lines not on this page · raw message