preempt/hardirq.h: Fix comment about PREEMPT_ACTIVE bit location
PATCH 1/1 preempt/hardirq.h: Fix comment about PREEMPT_ACTIVE bit location
PREEMPT_ACTIVE flag is bit 27, not 28. Fix the comment.
---
include/linux/hardirq.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/hardirq.h +1 -1
@@ -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
[tip:sched/urgent] sched: Fix comment about PREEMPT_ACTIVE bit location
Commit-ID: a7e4786b937a3ae918a7520cfdba557a80915fa7 Gitweb: http://git.kernel.org/tip/a7e4786b937a3ae918a7520cfdba557a80915fa7 Author: Srivatsa S. Bhat <[email protected]> AuthorDate: Sat, 21 Jul 2012 00:54:59 +0530 Committer: Ingo Molnar <[email protected]> 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.
--- include/linux/hardirq.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/hardirq.h +1 -1
@@ -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
Quoted 13 lines · Srivatsa S. Bhat
PREEMPT_ACTIVEflag is bit 27, not 28. Fix the comment.Signed-off-by Srivatsa S. Bhat <[email protected]>---
include/linux/hardirq.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)include/linux/hardirq.h +0
-0
include/linux/hardirq.h line 25
Quoted 5 lines
include/linux/hardirq.h +1
-1@@ -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
Quoted 3 lines
include/linux/hardirq.h +0
-0* * PREEMPT_MASK: 0x000000ff * SOFTIRQ_MASK: 0x0000ff00
Quoted 27 lines · Steven Rostedt
Quoted 13 lines · Srivatsa S. Bhat
PREEMPT_ACTIVEflag is bit 27, not 28. Fix the comment.Signed-off-by Srivatsa S. Bhat <[email protected]>---
include/linux/hardirq.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)include/linux/hardirq.h +0
-0include/linux/hardirq.h line 25
Quoted 5 lines
include/linux/hardirq.h +1
-1@@ -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.hwe have:#define
PREEMPT_ACTIVE0x10000000Which happens to be the 28th bit, not 27th. Although, if an arch did not define
PREEMPT_ACTIVEit would be 27th.
Quoted 8 lines
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
PATCH 1/1 preempt/hardirq.h: Clarify PREEMPT_ACTIVE bit location
In reply to Steven RostedtBy default, the PREEMPT_ACTIVE flag is bit 27, but different architectures can override that. Update the comment to reflect this fact.
---
include/linux/hardirq.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
include/linux/hardirq.h +5 -0
@@ -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
Re: [PATCH] preempt/hardirq.h: Clarify PREEMPT_ACTIVE bit location
Quoted 4 lines · Srivatsa S. Bhat
By default, the
PREEMPT_ACTIVEflag 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
Re: [PATCH] preempt/hardirq.h: Clarify PREEMPT_ACTIVE bit location
Quoted 7 lines · Thomas Gleixner
Quoted 4 lines · Srivatsa S. Bhat
By default, the
PREEMPT_ACTIVEflag is bit 27, but different architectures can override that. Update the comment to reflect this fact.
Quoted 6 lines
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