From mboxrd@z Thu Jan 1 00:00:00 1970 From: j.neuschaefer@gmx.net (Jonathan =?utf-8?Q?Neusch=C3=A4fer?=) Date: Mon, 8 Aug 2011 16:55:35 +0200 Subject: difference between io_schedule() and schedule() In-Reply-To: References: Message-ID: <20110808145535.GA2434@debian.debian> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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