Kernel thread scheduling

Aruna Hewapathirane aruna.hewapathirane at gmail.com
Thu Apr 16 11:10:44 EDT 2015


>> I'm trying to find rb_node's structure and I can't find it with ctags or
>> in the http://lxr.linux.no website.

Please use this: Linux 2.6.11 and later <http://lxr.linux.no/linux>

At the top right there is a text box please type what your searching for,
in this rb_node. It will show you on the right the search results.

The Structure is defined here:  include/linux/rbtree.h, line 35
<http://lxr.linux.no/linux+*/include/linux/rbtree.h#L35>

and here it is in case you have difficulties:

struct rb_node <http://lxr.linux.no/linux+*/+code=rb_node> {  36
<http://lxr.linux.no/linux+*/include/linux/rbtree.h#L36>
unsigned long  __rb_parent_color
<http://lxr.linux.no/linux+*/+code=__rb_parent_color>;  37
<http://lxr.linux.no/linux+*/include/linux/rbtree.h#L37>        struct
rb_node <http://lxr.linux.no/linux+*/+code=rb_node> *rb_right
<http://lxr.linux.no/linux+*/+code=rb_right>;  38
<http://lxr.linux.no/linux+*/include/linux/rbtree.h#L38>        struct
rb_node <http://lxr.linux.no/linux+*/+code=rb_node> *rb_left
<http://lxr.linux.no/linux+*/+code=rb_left>;  39
<http://lxr.linux.no/linux+*/include/linux/rbtree.h#L39>}
__attribute__ <http://lxr.linux.no/linux+*/+code=__attribute__>((aligned
<http://lxr.linux.no/linux+*/+code=aligned>(sizeof(long))));  40
<http://lxr.linux.no/linux+*/include/linux/rbtree.h#L40>    /* The
alignment might seem pointless, but allegedly CRIS needs it */


Thank's - Aruna






>
> Ruben
>
> On Thu, Apr 09, 2015 at 10:52:03PM -0400, nick wrote:
> >
> >
> > On 2015-04-09 10:12 PM, Ruben Safir wrote:
> > > On 04/09/2015 10:00 PM, nick wrote:
> > >>
> > >>
> > >> On 2015-04-09 09:51 PM, Ruben Safir wrote:
> > >>>
> > >>> It is passover so I've read over much of this text, but I have to say
> > >>> that in general, I'm way ahead of this book.  Although I have limited
> > >>> knowledge of Kernel technology in the specific, the C code, data
> > >>> structs, and programming concepts are spoon feed in this text and its
> > >>> wasting too much time with words that are more easily explained with
> > >>> coding examples and UML charts.  I don't need a chapter explaining
> how
> > >>> to use ps and the basis of Unix architecture.  This text is targeted
> to
> > >>> a different audience, and FWIW, I'm not certain it does a good job of
> > >>> that either.  The guys who write these texts fall in love with their
> own
> > >>> voices.  I know, I've suffered this disease myself when I've written
> > >>> tech articles and books.
> > >>>
> > >>> I can''t recommend this book to anyone.  Anyone who doesn't
> understand
> > >>> the basics of I/O processer blocks is not going to understand
> > >>>
> > >>> static void update_curr(struct cfs_rq *cfs_rq)
> > >>>
> > >>>
> > >>> and OTOH void update_curr(struct cfs_rq *cfs_rq) is not explained
> well
> > >>> enough for coders unfamiliar with the kernel data structs of which
> BTW
> > >>> struct cfs_rq is not one defined in the text.
> > >>>
> > >>> :(
> > >>>
> > >>> I'm looking for something more like this, but flushed out more as a
> textbook
> > >>>
> > >>>
> http://www.ibm.com/developerworks/library/l-completely-fair-scheduler/index.html
> ,
> > >>> and some mentoring, I hope.
> > >>>
> > >>>
> > >>> Ruben
> > >>>
> >
> > >> Ruben,
> > >> The book is for an intro to the kernel not a complete walk through of
> each subsystem.
> > >> If that is the case,why not read the subsystem code and docs in the
> kernel. I am a
> > >> novice myself in terms of patch and coding experience but will be
> glad to explain the
> > >> code as I have read lots of it.
> > >
> > >
> > > Thank you nick.  Yes, I downloaded the entire source from Kernel.org
> and
> > > it is sitting on both my laptop and in virtual machines where I have
> > > already compiled some stuff and not broken my VMs yets :)
> > >
> > > I'm looking over  /home/ruben/linux-3.19.3/Documentation/scheduler
> > > [ruben at stat13 scheduler]$ ls
> > >
> > > 00-INDEX   sched-deadline.txt     sched-rt-group.txt
> > > media=legal -o sides=two-sided-long-edg  sched-design-CFS.txt
> > > sched-stats.txt sched-arch.txt sched-domains.txt
> > > sched-bwc.txt   sched-nice-design.txt
> > >
> > >
> > > I also see in the code there is significant documentation.
> > >
> > > Right now I am trying to figure out what is the relationship between
> > > struct sched_entity and
> > > struct cfs_rq and
> > > struct rq_of
> > >
> > > why do we have both??
> > >
> > The way that these structures  are related is sched_enity is the entity
> for the task's scheduling
> > information or the task_struct of the a excuting process to be exact.
> Furthermore  cfs_rq is the
> > runquenue on which the task is running or selected to run on by
> schedule,the main scheduling function
> > of the kernel. Finally here is the function definition for rq_of to
> answer your question,
> > static inline struct rq *rq_of(struct cfs_rq *cfs_rq)
> > {
> >       return cfs_rq->rq;
> > }
> > Before asking questions again like this please look into either using
> lxr or ctags
> > to navigate the kernel tree for answers as can be faster then waiting
> for me or
> > someone else to respond.
> > Thanks,
> > Nick
> > > there is a cast in update_curr
> > > u64 now = rq_of(cfs_rq)->clock;
> > >
> > > or is rq_of a function that returns a pointer is a struct that I
> missed?
> > >
> > >
> > >
> > >
> > >
> > >> Nick
> > >>> On 03/22/2015 08:35 PM, nick wrote:
> > >>>>
> > >>>>
> > >>>> On 2015-03-22 08:05 PM, Ruben Safir wrote:
> > >>>>> On 03/22/2015 07:30 PM, nick wrote:
> > >>>>>> I would recommend reading Chapters 3 and  4 of Linux Kernel
> Development by Robert Love
> > >>>>>> as when I was learning the scheduler and process management
> > >>>>>
> > >>>>>
> > >>>>> how much has the scheduler changed since then.  It was completely
> > >>>>> overhauled when the CFS was created
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>> The 3rd edition of this book was written after CFS was in the
> kernel so the chapters
> > >>>> are pretty up to date.
> > >>>> Nick
> > >>>>> _______________________________________________
> > >>>>> Kernelnewbies mailing list
> > >>>>> Kernelnewbies at kernelnewbies.org
> > >>>>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> > >>>>>
> > >>>>
> > >>>> _______________________________________________
> > >>>> Kernelnewbies mailing list
> > >>>> Kernelnewbies at kernelnewbies.org
> > >>>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> > >>>>
> > >>>> .
> > >>>>
> > >>>
> > >>>
> > >>> _______________________________________________
> > >>> Kernelnewbies mailing list
> > >>> Kernelnewbies at kernelnewbies.org
> > >>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> > >>>
> > >>
> > >>
> > >
> >
> > _______________________________________________
> > Kernelnewbies mailing list
> > Kernelnewbies at kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
> --
> So many immigrant groups have swept through our town
> that Brooklyn, like Atlantis, reaches mythological
> proportions in the mind of the world - RI Safir 1998
> http://www.mrbrklyn.com
>
> DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
> http://www.nylxs.com - Leadership Development in Free Software
> http://www2.mrbrklyn.com/resources - Unpublished Archive
> http://www.coinhangout.com - coins!
> http://www.brooklyn-living.com
>
> Being so tracked is for FARM ANIMALS and and extermination camps,
> but incompatible with living as a free human being. -RI Safir 2013
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150416/da5e692b/attachment-0001.html 


More information about the Kernelnewbies mailing list