All of lore.kernel.org
 help / color / mirror / Atom feed
From: j.neuschaefer@gmx.net (Jonathan Neuschäfer)
To: kernelnewbies@lists.kernelnewbies.org
Subject: difference between io_schedule() and schedule()
Date: Mon, 8 Aug 2011 16:55:35 +0200	[thread overview]
Message-ID: <20110808145535.GA2434@debian.debian> (raw)
In-Reply-To: <CAAYFAvqu4Eqi5tdv4-dskMgFqhH5VNGJn9wyxZ9VLDFA_p4efQ@mail.gmail.com>

On Sat, Aug 06, 2011 at 12:31:21PM +0530, Rajat Sharma wrote:
> Hi All,
> 
> What is the difference between io_schedule() and schedule(), is
> io_schedule() more restrictive to shedule only I/O bound processes or
> it just favours I/O bound processes. Any documentation link would be
> great help.

Have you even looked at the source code?

>From kernel/sched.c +5721:
/*
 * This task is about to go to sleep on IO. Increment rq->nr_iowait so
 * that process accounting knows that this is a task in IO wait state.
 */
void __sched io_schedule(void)
{
	struct rq *rq = raw_rq();

	delayacct_blkio_start();
	atomic_inc(&rq->nr_iowait);
	blk_flush_plug(current);
	current->in_iowait = 1;
	schedule();
	current->in_iowait = 0;
	atomic_dec(&rq->nr_iowait);
	delayacct_blkio_end();
}
EXPORT_SYMBOL(io_schedule);

HTH,
	Jonathan Neusch?fer

  reply	other threads:[~2011-08-08 14:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-06  7:01 difference between io_schedule() and schedule() Rajat Sharma
2011-08-08 14:55 ` Jonathan Neuschäfer [this message]
2011-08-09 13:30   ` Rajat Sharma
2011-08-10  7:37     ` Mulyadi Santosa
2011-08-10  8:55       ` Rajat Sharma

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=20110808145535.GA2434@debian.debian \
    --to=j.neuschaefer@gmx.net \
    --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.