Skip to contentSkip to conversation

Default preempt_count setting

DISCUSSION Matthew Wilcox 1 participant 2 messages Feb 3, 2005 – Feb 7, 2005

lore
Share & tools
lore
#0 lore raw

I noticed that almost every architecture has some variant of:

#define INIT_THREAD_INFO(tsk) \
[...]

        .preempt_count  = 1,                    \

except for parisc, ia64 and arm26. parisc and arm26 don't have functional PREEMPT, so I suspect can simply be changed. How about ia64 though? I see PREEMPT is available as an option ... should preempt_count be initialised to 1 on ia64?

Signature · 6 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
#1 lore raw
Quoted 7 lines · Peter Chubb
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Matthew" = Matthew Wilcox <[email protected]> writes:

Matthew> #define INIT_THREAD_INFO(tsk) \ [...] .preempt_count = 1, \

It doesn't matter: new processes have preempt_count set to one in sched_fork() (they don't inherit the value) which then drops to zero
when they're first run. So init_task's preempt count will be set to one
when the task is created.

But init_task isn't created by copy_process(), it's statically initialised in arch/ia64/kernel/init_task.c. Based on that, I'd say we do need it to change ...

Signature · 6 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain