From: poleyschen@gmail.com (Pol Eyschen)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Reading Code
Date: Fri, 08 Aug 2014 21:40:36 +0200 [thread overview]
Message-ID: <53E527B4.80306@gmail.com> (raw)
In-Reply-To: <CAPDOMVhSafwgKEwKFOz-kPUD8D9ZFD=p=d8ALxngwz2K_EVTzw@mail.gmail.com>
Well, seems like you have to also learn to google, since I found the
answer to all your questions within seconds.
Pol
On 08.8.14 21:16, Nick Krause wrote:
> 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
>
next prev parent reply other threads:[~2014-08-08 19:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-08 19:16 Reading Code Nick Krause
2014-08-08 19:40 ` Pol Eyschen [this message]
2014-08-08 19:44 ` Pol Eyschen
[not found] ` <BLU436-SMTP189E5D1CC7D38188CDCB74BD3EE0@phx.gbl>
2014-08-08 19:45 ` Nick Krause
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53E527B4.80306@gmail.com \
--to=poleyschen@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.