Re: some doubt in struct task data member..

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

 



On Thu, 2006-11-02 at 09:52 +0530, suman adak wrote:
> i have seen this struct task in schd.h file 
> struct task_struct {
>          volatile long state;    /* -1 unrunnable, 0 runnable, >0
> stopped */
>          struct thread_info *thread_info;
>          atomic_t usage; 
>          unsigned long flags;
> ........
> ........
> }
> 
> can anybody pointout me , why state variable is declared as long. I
> wrote one simple module programming to print state value for each
> task.
> I have seen the it is returning 0 or 1 only. Is it not wastage of
> kernel memory declaring as long type as we can do with short int? 
> Or i am missing something else..

Maybe for cache aligning purposes..

> 
> Thanks
> Suman
> 
> 
> 


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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