2008-08-05 02:52:27     idle thread

Document created by Aaronwu Employee on Aug 7, 2013
Version 1Show Document
  • View in full screen mode

2008-08-05 02:52:27     idle thread

Linux Newbie (INDIA)

Message: 59899   

 

Hi,

 

Is there any documentation on Idle thread for uClinux.

 

In vdk, idle thread runs at low priority and when other threds are pending, idle thread will be running and if any interrupt happens, stack memory is taken from idle thread.

 

What will happen in case of uclinux if all other threads are pending?

QuoteReplyEditDelete

 

 

2008-08-05 03:06:04     Re: idle thread

Mike Frysinger (UNITED STATES)

Message: 59900   

 

there is no documentation on the idle thread

 

all kernel threads have their own stack

QuoteReplyEditDelete

 

 

2008-08-05 03:44:15     Re: idle thread

Linux Newbie (INDIA)

Message: 59902   

 

Hi,

 

it means, do we need to take care of stack size of kernel threads. If multiple interrupts are happening(if nesting of interrups are enabled), then stack size has to be grown. or is there any particular section that kernel allocates for stack?

QuoteReplyEditDelete

 

 

2008-08-05 04:19:26     Re: idle thread

Mike Frysinger (UNITED STATES)

Message: 59905   

 

you cannot control the kernel stack.  it is set to 8k.  if you overflow that, then you need to rethink how your system is designed.

 

QuoteReplyEditDelete

 

 

2008-08-05 05:01:19     Re: idle thread

Linux Newbie (INDIA)

Message: 59907   

 

If stack grows beyond 8k, will kernel throw error? Or do we need to set any flag for it to happen?

QuoteReplyEditDelete

 

 

2008-08-05 05:11:33     Re: idle thread

Mike Frysinger (UNITED STATES)

Message: 59910   

 

your system will get randomly corrupted

QuoteReplyEditDelete

 

 

2008-08-05 05:57:51     Re: idle thread

Linux Newbie (INDIA)

Message: 59929   

 

Hi ,

 

How to find stack overflow in Kernel?

QuoteReplyEditDelete

 

 

2008-08-05 11:15:13     Re: idle thread

Mike Frysinger (UNITED STATES)

Message: 59943   

 

currently you cannot.  maybe in the future we'll add detection.

QuoteReplyEditDelete

 

 

2008-08-06 08:15:41     Re: idle thread

Linux Newbie (INDIA)

Message: 60034   

 

Hi,

 

Need further clarification.

 

When our application thread(user space) is being executed and if interrupt comes, which stack is used i.e. thread stack or kernel stack while servicing the interrupt.

 

Based on above discussion my understanding is whenever this context switching among application threads, its(threads) stack is used, but if interrupt (or Kernel thread context switch) occurs Kernel stack is used.

 

Please let me know if my understanding is correct or not. If not please clarify me.

 

Thanks in Advance

QuoteReplyEditDelete

 

 

2008-08-06 12:43:05     Re: idle thread

Robin Getz (UNITED STATES)

Message: 60048   

 

Interrupts use the current supervisor (kernel) stack.

 

Have a look at arch/blackfin/mach-common/interrupt.S:__common_int_entry:() - where it does not adjust the stack pointer - it just starts pushing data.

 

-Robin

QuoteReplyEditDelete

 

 

2008-08-06 13:33:03     Re: idle thread

Mike Frysinger (UNITED STATES)

Message: 60052   

 

userspace stacks do not matter whatsoever to kernel space.  a broken userspace stack will not break kernelspace at all.

QuoteReplyEditDelete

 

 

2008-08-07 06:20:38     Re: idle thread

Linux Newbie (INDIA)

Message: 60095   

 

Thanks for your clarification

Attachments

    Outcomes