All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/4] futex,plist: remove debug lock assignment for plist_node
@ 2010-12-21  9:55 Lai Jiangshan
  2010-12-21 19:14 ` Darren Hart
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lai Jiangshan @ 2010-12-21  9:55 UTC (permalink / raw)
  To: Peter Zijlstra, John Kacur, James Bottomley, Ingo Molnar,
	Rafael J. Wysocki, Thomas Gleixner, Darren Hart, Namhyung Kim,
	linux-kernel, Steven Rostedt

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);

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/4] futex,plist: remove debug lock assignment for plist_node
  2010-12-21  9:55 [PATCH 2/4] futex,plist: remove debug lock assignment for plist_node Lai Jiangshan
@ 2010-12-21 19:14 ` Darren Hart
  2010-12-22  5:57   ` Lai Jiangshan
  2010-12-22 16:24 ` Darren Hart
  2011-03-12 10:58 ` [tip:core/futexes] futex,plist: Remove debug lock assignment from plist_node tip-bot for Lai Jiangshan
  2 siblings, 1 reply; 6+ messages in thread
From: Darren Hart @ 2010-12-21 19:14 UTC (permalink / raw)
  To: Lai Jiangshan
  Cc: Peter Zijlstra, John Kacur, James Bottomley, Ingo Molnar,
	Rafael J. Wysocki, Thomas Gleixner, Namhyung Kim, linux-kernel,
	Steven Rostedt

On 12/21/2010 01:55 AM, Lai Jiangshan wrote:
> 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.

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

--
Darren

>
> 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);


-- 
Darren Hart
Yocto Linux Kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/4] futex,plist: remove debug lock assignment for plist_node
  2010-12-21 19:14 ` Darren Hart
@ 2010-12-22  5:57   ` Lai Jiangshan
  2010-12-22  6:47     ` Darren Hart
  0 siblings, 1 reply; 6+ messages in thread
From: Lai Jiangshan @ 2010-12-22  5:57 UTC (permalink / raw)
  To: Darren Hart
  Cc: Peter Zijlstra, John Kacur, James Bottomley, Ingo Molnar,
	Rafael J. Wysocki, Thomas Gleixner, Namhyung Kim, linux-kernel,
	Steven Rostedt

On 12/22/2010 03:14 AM, Darren Hart wrote:
> On 12/21/2010 01:55 AM, Lai Jiangshan wrote:
>> 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.
> 
> Any reason to keep this separate from  patch 1/4 ?
> 

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/4] futex,plist: remove debug lock assignment for plist_node
  2010-12-22  5:57   ` Lai Jiangshan
@ 2010-12-22  6:47     ` Darren Hart
  0 siblings, 0 replies; 6+ messages in thread
From: Darren Hart @ 2010-12-22  6:47 UTC (permalink / raw)
  To: Lai Jiangshan
  Cc: Peter Zijlstra, John Kacur, James Bottomley, Ingo Molnar,
	Rafael J. Wysocki, Thomas Gleixner, Namhyung Kim, linux-kernel,
	Steven Rostedt

On 12/21/2010 09:57 PM, Lai Jiangshan wrote:
> On 12/22/2010 03:14 AM, Darren Hart wrote:
>> On 12/21/2010 01:55 AM, Lai Jiangshan wrote:
>>> 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.
>>
>> Any reason to keep this separate from  patch 1/4 ?
>>
>
> 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.

Fair enough.

-- 
Darren Hart
Yocto Linux Kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/4] futex,plist: remove debug lock assignment for plist_node
  2010-12-21  9:55 [PATCH 2/4] futex,plist: remove debug lock assignment for plist_node Lai Jiangshan
  2010-12-21 19:14 ` Darren Hart
@ 2010-12-22 16:24 ` Darren Hart
  2011-03-12 10:58 ` [tip:core/futexes] futex,plist: Remove debug lock assignment from plist_node tip-bot for Lai Jiangshan
  2 siblings, 0 replies; 6+ messages in thread
From: Darren Hart @ 2010-12-22 16:24 UTC (permalink / raw)
  To: Lai Jiangshan
  Cc: Peter Zijlstra, John Kacur, James Bottomley, Ingo Molnar,
	Rafael J. Wysocki, Thomas Gleixner, Namhyung Kim, linux-kernel,
	Steven Rostedt

On 12/21/2010 01:55 AM, Lai Jiangshan wrote:
> 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>

Acked-by: Darren Hart <dvhart@linux.intel.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);


-- 
Darren Hart
Yocto Linux Kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [tip:core/futexes] futex,plist: Remove debug lock assignment from plist_node
  2010-12-21  9:55 [PATCH 2/4] futex,plist: remove debug lock assignment for plist_node Lai Jiangshan
  2010-12-21 19:14 ` Darren Hart
  2010-12-22 16:24 ` Darren Hart
@ 2011-03-12 10:58 ` tip-bot for Lai Jiangshan
  2 siblings, 0 replies; 6+ messages in thread
From: tip-bot for Lai Jiangshan @ 2011-03-12 10:58 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, rostedt, dvhart, tglx, laijs

Commit-ID:  017f2b239dabb2740b91df162e004371b861f371
Gitweb:     http://git.kernel.org/tip/017f2b239dabb2740b91df162e004371b861f371
Author:     Lai Jiangshan <laijs@cn.fujitsu.com>
AuthorDate: Tue, 21 Dec 2010 17:55:10 +0800
Committer:  Steven Rostedt <rostedt@goodmis.org>
CommitDate: Fri, 11 Mar 2011 15:09:53 -0500

futex,plist: Remove debug lock assignment from plist_node

The original code uses &plist_node->plist as the fake head of
the priority list for plist_del(), these debug locks in
the fake 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.

Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by:  Lai Jiangshan <laijs@cn.fujitsu.com>
LKML-Reference: <4D10797E.7040803@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/futex.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index 6feeea4..9fe9131 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -1089,9 +1089,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;
@@ -1124,9 +1121,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);
 }
@@ -1474,9 +1468,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);

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-03-12 10:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-21  9:55 [PATCH 2/4] futex,plist: remove debug lock assignment for plist_node Lai Jiangshan
2010-12-21 19:14 ` Darren Hart
2010-12-22  5:57   ` Lai Jiangshan
2010-12-22  6:47     ` Darren Hart
2010-12-22 16:24 ` Darren Hart
2011-03-12 10:58 ` [tip:core/futexes] futex,plist: Remove debug lock assignment from plist_node tip-bot for Lai Jiangshan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.