Re: [patch 08/19] mutex subsystem, core

From: Kai Geek
Date: Tue Jan 03 2006 - 10:57:19 EST


Hello,
can we run the semaphores from the console if we do it with mutex instead of interrupt context? in this case will the mutex codes be interrupted?
base a image run pid kernel/printk.c?
Best Regards,

----- Original Message -----
From: "Linus Torvalds" <torvalds@xxxxxxxx>
To: "Ingo Molnar" <mingo@xxxxxxx>
Subject: Re: [patch 08/19] mutex subsystem, core
Date: Tue, 3 Jan 2006 07:38:41 -0800 (PST)

>
>
>
> On Tue, 3 Jan 2006, Ingo Molnar wrote:
> > > > Is this an interrupt deadlock, or do you not allow interrupt
> > contexts > to even trylock a mutex?
> >
> > correct, no irq contexts are allowed. This is also checked for if
> > CONFIG_DEBUG_MUTEXES is enabled.
>
> Note that semaphores are definitely used from interrupt context, and as
> such you can't replace them with mutexes if you do this.
>
> The prime example is the console semaphore. See kernel/printk.c, look for
> "down_trylock()", and realize that they are all about interrupts.
>
> Linus
> -

+-+-+-+ BEGIN PGP SIGNATURE +-+-+-+
Version: GnuPG v1.4.2 (GNU/Linux)
.-. .-. _
: : : : :_;
.-' : .--. : `-. .-. .--. ,-.,-.
' .; :' '_.'' .; :: :' .; ; : ,. :
`.__.'`.__.'`.__.':_;`.__,_;:_;:_;

Kai "Ozgur" Geek
Network Engineer
PGP ID: B1B63B6E
+-+-+-+ END PGP SIGNATURE +-+-+-+

--
_______________________________________________
Check out the latest SMS services @ http://www.linuxmail.org
This allows you to send and receive SMS through your mailbox.

Powered by Outblaze
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/