Re: kernel crash after adding ethernet driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/2/07, Rajat Jain <rajat.noida.india@xxxxxxxxx> wrote:
Hi Pradeep,

> > > Can you please recheck if you are not holding any spinlocks.Also check
> > > if you are not doing a memory allocation with spinlock held or in
> > > interrupt context.May be you are doing something like printk which may
> > > sleep IMO.Rechcek any methods you are calling which may sleep.
> >
> > printk will not sleep. Thus it is safe to call printk from any where
> > except from very few restricted locations like some scheduler etc.
>
> Can you please help me out in understanding why?
> Printk involves allocating buffer for the message to be printed,
> right?Which can sleep, isnt it?
> What am i missing here?

No, printk does not allocate any buffer. printk has a compile time
circular buffer (log_buf) whose size is determined by compile time
constant. So what prink does is mere dump the message in this circular
buffer.
Oh... got it.but this raises a silly doubt for me.
this means you cannot just keep on priniting a lot of data using a
single printk right? May be log_buf has a buffer size limit because it
is a compile time constant.
What am i missing here?

Thanks
~psr


Thanks,

Rajat



--
play the game

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux