Re: [PATCH 2/4] futex,plist: remove debug lock assignment for plist_node

Previous thread: [PATCH 1/4 V2 ] futex,plist: pass the real head of the priority list to plist_del() by Lai Jiangshan on Tuesday, December 21, 2010 - 2:55 am. (7 messages)

Next thread: [PATCH 3/4] plist: shrink struct plist_head by Lai Jiangshan on Tuesday, December 21, 2010 - 2:55 am. (3 messages)
From: Lai Jiangshan
Date: Tuesday, December 21, 2010 - 2:55 am

original code use &plist_node->plist as the faked head of
the priority list for plist_del(), these debug locks in
the faked head are needed for CONFIG_DEBUG_PI_LIST.

But now we always pass the real head to plist_del(), the debug locks
in plist_node will not be used, so we remove these assignments.

Signed-off-by:  Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/kernel/futex.c b/kernel/futex.c
index 6c4f67a..725834e 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -1032,9 +1032,6 @@ void requeue_futex(struct futex_q *q, struct futex_hash_bucket *hb1,
 		plist_del(&q->list, &hb1->chain);
 		plist_add(&q->list, &hb2->chain);
 		q->lock_ptr = &hb2->lock;
-#ifdef CONFIG_DEBUG_PI_LIST
-		q->list.plist.spinlock = &hb2->lock;
-#endif
 	}
 	get_futex_key_refs(key2);
 	q->key = *key2;
@@ -1068,9 +1065,6 @@ void requeue_pi_wake_futex(struct futex_q *q, union futex_key *key,
 	q->rt_waiter = NULL;
 
 	q->lock_ptr = &hb->lock;
-#ifdef CONFIG_DEBUG_PI_LIST
-	q->list.plist.spinlock = &hb->lock;
-#endif
 
 	wake_up_state(q->task, TASK_NORMAL);
 }
@@ -1418,9 +1412,6 @@ static inline void queue_me(struct futex_q *q, struct futex_hash_bucket *hb)
 	prio = min(current->normal_prio, MAX_RT_PRIO);
 
 	plist_node_init(&q->list, prio);
-#ifdef CONFIG_DEBUG_PI_LIST
-	q->list.plist.spinlock = &hb->lock;
-#endif
 	plist_add(&q->list, &hb->chain);
 	q->task = current;
 	spin_unlock(&hb->lock);
--

From: Darren Hart
Date: Tuesday, December 21, 2010 - 12:14 pm

Any reason to keep this separate from  patch 1/4 ?

--


-- 
Darren Hart
Yocto Linux Kernel
--

From: Lai Jiangshan
Date: Tuesday, December 21, 2010 - 10:57 pm

Make the changes clearer and the patches are easier to read.
For me the purposes of patch 1/4 and 2/4 are different,
1/4 makes the code sensible. 2/4 removes unused code.
--

From: Darren Hart
Date: Tuesday, December 21, 2010 - 11:47 pm

Fair enough.

-- 
Darren Hart
Yocto Linux Kernel
--

From: Darren Hart
Date: Wednesday, December 22, 2010 - 9:24 am

-- 
Darren Hart
Yocto Linux Kernel
--

Previous thread: [PATCH 1/4 V2 ] futex,plist: pass the real head of the priority list to plist_del() by Lai Jiangshan on Tuesday, December 21, 2010 - 2:55 am. (7 messages)

Next thread: [PATCH 3/4] plist: shrink struct plist_head by Lai Jiangshan on Tuesday, December 21, 2010 - 2:55 am. (3 messages)