2005-11-09 17:57:57

by Liang Yang

[permalink] [raw]
Subject: Does Printk() block another CPU in dual cpu platforms?

Hello,

I just have a question about the usage of printk in multi-processor
platforms. If the program on two CPUs both try to call printk to output
something, will the program running on one CPUs get blocked (or just
spinning there) till the other is done with printk()?

Thanks,

Liang


2005-11-10 03:31:44

by Fawad Lateef

[permalink] [raw]
Subject: Re: Does Printk() block another CPU in dual cpu platforms?

On 11/9/05, John Smith <[email protected]> wrote:
>
> I just have a question about the usage of printk in multi-processor
> platforms. If the program on two CPUs both try to call printk to output
> something, will the program running on one CPUs get blocked (or just
> spinning there) till the other is done with printk()?
>

I think yes, but for a very less time as printk holds the spin_lock to
logbuf_lock which will make to wait the printk on other CPU, and then
printk just copies the content to log_buffer and then call
release_console_sem which actually send the data to console later !

--
Fawad Lateef