* [parisc-linux] init_idle and local_irq_save
@ 2004-03-29 16:03 Grant Grundler
2004-03-29 16:17 ` James Bottomley
2004-03-29 16:31 ` Matthew Wilcox
0 siblings, 2 replies; 3+ messages in thread
From: Grant Grundler @ 2004-03-29 16:03 UTC (permalink / raw)
To: parisc-linux
Hi all,
I'm trying to get 2.6 SMP working on a UP box and was walking
through the init sequence. I have two questions related to init_idle()
in kernel/sched.c:
o local_irq_save()/local_irq_restore are called without an
obvious local_irq_disable() call in between. Is this really
needed for some other reason or is the local_irq_disable() missing?
o double_rq_lock() acquires the locks with lowest address first.
double_rq_unlock() does not release those in the inverse order.
Is that a problem?
I'm just nervous since I didn't see the local_irq_disable()
in init_idle() which would guarantee both unlock's happen atomically.
thanks,
grant
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [parisc-linux] init_idle and local_irq_save
2004-03-29 16:03 [parisc-linux] init_idle and local_irq_save Grant Grundler
@ 2004-03-29 16:17 ` James Bottomley
2004-03-29 16:31 ` Matthew Wilcox
1 sibling, 0 replies; 3+ messages in thread
From: James Bottomley @ 2004-03-29 16:17 UTC (permalink / raw)
To: Grant Grundler; +Cc: PARISC list
On Mon, 2004-03-29 at 11:03, Grant Grundler wrote:
> o local_irq_save()/local_irq_restore are called without an
> obvious local_irq_disable() call in between. Is this really
> needed for some other reason or is the local_irq_disable() missing?
local_irq_save() does do an irq disable. You're thinking of
local_save_flags() which only saves the flags but doesn't disable
interrupts.
> o double_rq_lock() acquires the locks with lowest address first.
> double_rq_unlock() does not release those in the inverse order.
> Is that a problem?
> I'm just nervous since I didn't see the local_irq_disable()
> in init_idle() which would guarantee both unlock's happen atomically.
No. The deadlock potential comes only from lock acquisition order, not
lock release order: nothing can block a lock release from proceeding.
James
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [parisc-linux] init_idle and local_irq_save
2004-03-29 16:03 [parisc-linux] init_idle and local_irq_save Grant Grundler
2004-03-29 16:17 ` James Bottomley
@ 2004-03-29 16:31 ` Matthew Wilcox
1 sibling, 0 replies; 3+ messages in thread
From: Matthew Wilcox @ 2004-03-29 16:31 UTC (permalink / raw)
To: Grant Grundler; +Cc: parisc-linux
On Mon, Mar 29, 2004 at 09:03:57AM -0700, Grant Grundler wrote:
> o double_rq_lock() acquires the locks with lowest address first.
> double_rq_unlock() does not release those in the inverse order.
> Is that a problem?
No. You have two possibilities (locks A, B; acquire and release):
1. Aa Ba Ar Br
2. Aa Ba Br Ar
It doesn't matter how you combine them; either you are waiting for A or
you have A and are waiting for B. You never have B and are waiting for A.
Case 2 is the more common idiom since B is then entirely nested within A,
but lock A ranks lock B in both cases, so you're safe.
--
"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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-03-29 16:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-29 16:03 [parisc-linux] init_idle and local_irq_save Grant Grundler
2004-03-29 16:17 ` James Bottomley
2004-03-29 16:31 ` Matthew Wilcox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox