* [PATCH] preempt/hardirq.h: Fix comment about PREEMPT_ACTIVE bit location
@ 2012-07-20 19:24 Srivatsa S. Bhat
2012-07-26 15:15 ` [tip:sched/urgent] sched: " tip-bot for Srivatsa S. Bhat
2012-07-31 3:49 ` [PATCH] preempt/hardirq.h: " Steven Rostedt
0 siblings, 2 replies; 7+ messages in thread
From: Srivatsa S. Bhat @ 2012-07-20 19:24 UTC (permalink / raw)
To: rostedt, tglx; +Cc: mingo, paulmck, josh, linux-kernel
PREEMPT_ACTIVE flag is bit 27, not 28. Fix the comment.
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
---
include/linux/hardirq.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index bb7f309..305f23c 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -22,7 +22,7 @@
*
* - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024)
* - bit 26 is the NMI_MASK
- * - bit 28 is the PREEMPT_ACTIVE flag
+ * - bit 27 is the PREEMPT_ACTIVE flag
*
* PREEMPT_MASK: 0x000000ff
* SOFTIRQ_MASK: 0x0000ff00
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [tip:sched/urgent] sched: Fix comment about PREEMPT_ACTIVE bit location
2012-07-20 19:24 [PATCH] preempt/hardirq.h: Fix comment about PREEMPT_ACTIVE bit location Srivatsa S. Bhat
@ 2012-07-26 15:15 ` tip-bot for Srivatsa S. Bhat
2012-07-31 3:49 ` [PATCH] preempt/hardirq.h: " Steven Rostedt
1 sibling, 0 replies; 7+ messages in thread
From: tip-bot for Srivatsa S. Bhat @ 2012-07-26 15:15 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, a.p.zijlstra, srivatsa.bhat, tglx
Commit-ID: a7e4786b937a3ae918a7520cfdba557a80915fa7
Gitweb: http://git.kernel.org/tip/a7e4786b937a3ae918a7520cfdba557a80915fa7
Author: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
AuthorDate: Sat, 21 Jul 2012 00:54:59 +0530
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 26 Jul 2012 13:54:58 +0200
sched: Fix comment about PREEMPT_ACTIVE bit location
PREEMPT_ACTIVE flag is bit 27, not 28. Fix the comment.
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: paulmck@linux.vnet.ibm.com
Cc: josh@joshtriplett.org
Cc: rostedt@goodmis.org
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20120720192459.6149.14821.stgit@srivatsabhat.in.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
include/linux/hardirq.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index bb7f309..305f23c 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -22,7 +22,7 @@
*
* - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024)
* - bit 26 is the NMI_MASK
- * - bit 28 is the PREEMPT_ACTIVE flag
+ * - bit 27 is the PREEMPT_ACTIVE flag
*
* PREEMPT_MASK: 0x000000ff
* SOFTIRQ_MASK: 0x0000ff00
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] preempt/hardirq.h: Fix comment about PREEMPT_ACTIVE bit location
2012-07-20 19:24 [PATCH] preempt/hardirq.h: Fix comment about PREEMPT_ACTIVE bit location Srivatsa S. Bhat
2012-07-26 15:15 ` [tip:sched/urgent] sched: " tip-bot for Srivatsa S. Bhat
@ 2012-07-31 3:49 ` Steven Rostedt
2012-08-14 8:26 ` Srivatsa S. Bhat
2012-08-14 8:28 ` [PATCH] preempt/hardirq.h: Clarify " Srivatsa S. Bhat
1 sibling, 2 replies; 7+ messages in thread
From: Steven Rostedt @ 2012-07-31 3:49 UTC (permalink / raw)
To: Srivatsa S. Bhat; +Cc: tglx, mingo, paulmck, josh, linux-kernel
On Sat, 2012-07-21 at 00:54 +0530, Srivatsa S. Bhat wrote:
> PREEMPT_ACTIVE flag is bit 27, not 28. Fix the comment.
>
> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
> ---
>
> include/linux/hardirq.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
> index bb7f309..305f23c 100644
> --- a/include/linux/hardirq.h
> +++ b/include/linux/hardirq.h
> @@ -22,7 +22,7 @@
> *
> * - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024)
> * - bit 26 is the NMI_MASK
> - * - bit 28 is the PREEMPT_ACTIVE flag
> + * - bit 27 is the PREEMPT_ACTIVE flag
Sorry but in arch/x86/include/asm/thread_info.h we have:
#define PREEMPT_ACTIVE 0x10000000
Which happens to be the 28th bit, not 27th. Although, if an arch did not
define PREEMPT_ACTIVE it would be 27th.
Perhaps the correct thing to do is to say:
By default the following bits are defined as:
[...]
Different architectures may modify these.
And then add your change.
-- Steve
> *
> * PREEMPT_MASK: 0x000000ff
> * SOFTIRQ_MASK: 0x0000ff00
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] preempt/hardirq.h: Fix comment about PREEMPT_ACTIVE bit location
2012-07-31 3:49 ` [PATCH] preempt/hardirq.h: " Steven Rostedt
@ 2012-08-14 8:26 ` Srivatsa S. Bhat
2012-08-14 8:28 ` [PATCH] preempt/hardirq.h: Clarify " Srivatsa S. Bhat
1 sibling, 0 replies; 7+ messages in thread
From: Srivatsa S. Bhat @ 2012-08-14 8:26 UTC (permalink / raw)
To: Steven Rostedt; +Cc: tglx, mingo, paulmck, josh, linux-kernel
On 07/31/2012 09:19 AM, Steven Rostedt wrote:
> On Sat, 2012-07-21 at 00:54 +0530, Srivatsa S. Bhat wrote:
>> PREEMPT_ACTIVE flag is bit 27, not 28. Fix the comment.
>>
>> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
>> ---
>>
>> include/linux/hardirq.h | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
>> index bb7f309..305f23c 100644
>> --- a/include/linux/hardirq.h
>> +++ b/include/linux/hardirq.h
>> @@ -22,7 +22,7 @@
>> *
>> * - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024)
>> * - bit 26 is the NMI_MASK
>> - * - bit 28 is the PREEMPT_ACTIVE flag
>> + * - bit 27 is the PREEMPT_ACTIVE flag
>
> Sorry but in arch/x86/include/asm/thread_info.h we have:
>
> #define PREEMPT_ACTIVE 0x10000000
>
> Which happens to be the 28th bit, not 27th. Although, if an arch did not
> define PREEMPT_ACTIVE it would be 27th.
>
> Perhaps the correct thing to do is to say:
>
> By default the following bits are defined as:
> [...]
> Different architectures may modify these.
>
> And then add your change.
>
Thanks a lot for your suggestions Steve! And sorry for the delay..
I'll post the updated patch (which applies on latest Linus master) as a reply
to this thread.
Regards,
Srivatsa S. Bhat
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] preempt/hardirq.h: Clarify PREEMPT_ACTIVE bit location
2012-07-31 3:49 ` [PATCH] preempt/hardirq.h: " Steven Rostedt
2012-08-14 8:26 ` Srivatsa S. Bhat
@ 2012-08-14 8:28 ` Srivatsa S. Bhat
2012-08-14 10:18 ` Thomas Gleixner
1 sibling, 1 reply; 7+ messages in thread
From: Srivatsa S. Bhat @ 2012-08-14 8:28 UTC (permalink / raw)
To: Steven Rostedt; +Cc: tglx, mingo, paulmck, josh, linux-kernel
By default, the PREEMPT_ACTIVE flag is bit 27, but different
architectures can override that. Update the comment to reflect
this fact.
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
---
include/linux/hardirq.h | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 305f23c..483aa60 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -20,10 +20,15 @@
* hardirq nesting. An arch may choose to give less than 10 bits.
* m68k expects it to be 8.
*
+ * By default, the bits are defined as shown below:
+ *
* - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024)
* - bit 26 is the NMI_MASK
* - bit 27 is the PREEMPT_ACTIVE flag
*
+ * However, different architectures may override them. (For example,
+ * x86 defines bit 28 as the PREEMPT_ACTIVE flag).
+ *
* PREEMPT_MASK: 0x000000ff
* SOFTIRQ_MASK: 0x0000ff00
* HARDIRQ_MASK: 0x03ff0000
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] preempt/hardirq.h: Clarify PREEMPT_ACTIVE bit location
2012-08-14 8:28 ` [PATCH] preempt/hardirq.h: Clarify " Srivatsa S. Bhat
@ 2012-08-14 10:18 ` Thomas Gleixner
2012-08-14 12:46 ` Steven Rostedt
0 siblings, 1 reply; 7+ messages in thread
From: Thomas Gleixner @ 2012-08-14 10:18 UTC (permalink / raw)
To: Srivatsa S. Bhat; +Cc: Steven Rostedt, mingo, paulmck, josh, linux-kernel
On Tue, 14 Aug 2012, Srivatsa S. Bhat wrote:
>
> By default, the PREEMPT_ACTIVE flag is bit 27, but different
> architectures can override that. Update the comment to reflect
> this fact.
Is there any sensible reason why architectures need to override that?
I can't find one.
If there is none, then we should just remove all the overrides from
the arch code instead. If there is a reason, then it should be
documented.
Thanks,
tglx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] preempt/hardirq.h: Clarify PREEMPT_ACTIVE bit location
2012-08-14 10:18 ` Thomas Gleixner
@ 2012-08-14 12:46 ` Steven Rostedt
0 siblings, 0 replies; 7+ messages in thread
From: Steven Rostedt @ 2012-08-14 12:46 UTC (permalink / raw)
To: Thomas Gleixner; +Cc: Srivatsa S. Bhat, mingo, paulmck, josh, linux-kernel
On Tue, 2012-08-14 at 12:18 +0200, Thomas Gleixner wrote:
> On Tue, 14 Aug 2012, Srivatsa S. Bhat wrote:
>
> >
> > By default, the PREEMPT_ACTIVE flag is bit 27, but different
> > architectures can override that. Update the comment to reflect
> > this fact.
>
> Is there any sensible reason why architectures need to override that?
> I can't find one.
>
> If there is none, then we should just remove all the overrides from
> the arch code instead. If there is a reason, then it should be
> documented.
IIRC, when I added the NMI bits to implement 'in_nmi()' I tried to make
this work across archs. But I found that bits in the preempt count have
been hard coded in assembly all over the place, and to clean it up
looked to be a nightmare.
It probably should be done, but I didn't have the time to do it then.
Perhaps we can revisit it.
In fact, looking at all the archs, I believe all archs override the
PREEMPT_ACTIVE bit, and not one of them uses the default (bit 27).
-- Steve
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-08-14 12:46 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-20 19:24 [PATCH] preempt/hardirq.h: Fix comment about PREEMPT_ACTIVE bit location Srivatsa S. Bhat
2012-07-26 15:15 ` [tip:sched/urgent] sched: " tip-bot for Srivatsa S. Bhat
2012-07-31 3:49 ` [PATCH] preempt/hardirq.h: " Steven Rostedt
2012-08-14 8:26 ` Srivatsa S. Bhat
2012-08-14 8:28 ` [PATCH] preempt/hardirq.h: Clarify " Srivatsa S. Bhat
2012-08-14 10:18 ` Thomas Gleixner
2012-08-14 12:46 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).