kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Reading Code
@ 2014-08-08 19:16 Nick Krause
  2014-08-08 19:40 ` Pol Eyschen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nick Krause @ 2014-08-08 19:16 UTC (permalink / raw)
  To: kernelnewbies

For the last few days , I have been reading the code for do_fork and
other parts of the scheduler code.
As most of the developers feel this is in my best interest. I do
however have a few questions about the
code for the function, schedule.
1. In task struct we have this one defined if needed
1481 #ifdef CONFIG_BLOCK
1482 /* stack plugging */
1483 struct blk_plug *plug;
1484 #endif
I am curious is this used for block IO or something else as we are
checking for it in schedule() with this line,
sched_submit_work(tsk); which in turn points to sched_submit_work and
in turn checks for blk_plug
2814 static inline void sched_submit_work(struct task_struct *tsk)
2815 {
2816 if (!tsk->state || tsk_is_pi_blocked(tsk))
2817 return;
2818 /*
2819 * If we are going to sleep and we have plugged IO queued,
2820 * make sure to submit it to avoid deadlocks.
2821 */
2822 if (blk_needs_flush_plug(tsk))
2823 blk_schedule_flush_plug(tsk);
2824 }
Since schedule returns this and after searching using lxr, can't find
much on this, what is this type actually defined as when compiled?
368 #define __sched __attribute__((__section__(".sched.text")))
3. context_switch(rq, prev, next); /* unlocks the rq */
I am getting confused by this function after tracing it, if  someone
wants to explain it to me that would be great.

In addition I am not not trying to turn this into a self help just for
me, but my questions about git I goggled for 2 hours and didn't

find any answers, sorry about that guys. In addition I hope theses
questions are valid.
Cheers Nick

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-08-08 19:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-08 19:16 Reading Code Nick Krause
2014-08-08 19:40 ` Pol Eyschen
2014-08-08 19:44 ` Pol Eyschen
     [not found] ` <BLU436-SMTP189E5D1CC7D38188CDCB74BD3EE0@phx.gbl>
2014-08-08 19:45   ` Nick Krause

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).