All of lore.kernel.org
 help / color / mirror / Atom feed
* difference between io_schedule() and schedule()
@ 2011-08-06  7:01 Rajat Sharma
  2011-08-08 14:55 ` Jonathan Neuschäfer
  0 siblings, 1 reply; 5+ messages in thread
From: Rajat Sharma @ 2011-08-06  7:01 UTC (permalink / raw)
  To: kernelnewbies

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.

Thanks,
Rajat

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

* difference between io_schedule() and schedule()
  2011-08-06  7:01 difference between io_schedule() and schedule() Rajat Sharma
@ 2011-08-08 14:55 ` Jonathan Neuschäfer
  2011-08-09 13:30   ` Rajat Sharma
  0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Neuschäfer @ 2011-08-08 14:55 UTC (permalink / raw)
  To: kernelnewbies

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

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

* difference between io_schedule() and schedule()
  2011-08-08 14:55 ` Jonathan Neuschäfer
@ 2011-08-09 13:30   ` Rajat Sharma
  2011-08-10  7:37     ` Mulyadi Santosa
  0 siblings, 1 reply; 5+ messages in thread
From: Rajat Sharma @ 2011-08-09 13:30 UTC (permalink / raw)
  To: kernelnewbies

On Mon, Aug 8, 2011 at 8:25 PM, Jonathan Neusch?fer
<j.neuschaefer@gmx.net> wrote:
> 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
>

of course I looked at the source (obvious first step) before asking
question and further following tsk->in_iowait, it seems it is just
needed for accounting purpose.

                        if (tsk->in_iowait) {
                                se->statistics.iowait_sum += delta;
                                se->statistics.iowait_count++;
                                trace_sched_stat_iowait(tsk, delta);
                        }

Wanted to be sure of "is that it all about"? or I am missing something here?

-Rajat

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

* difference between io_schedule() and schedule()
  2011-08-09 13:30   ` Rajat Sharma
@ 2011-08-10  7:37     ` Mulyadi Santosa
  2011-08-10  8:55       ` Rajat Sharma
  0 siblings, 1 reply; 5+ messages in thread
From: Mulyadi Santosa @ 2011-08-10  7:37 UTC (permalink / raw)
  To: kernelnewbies

Hi Rajat...

On Tue, Aug 9, 2011 at 09:30, Rajat Sharma <fs.rajat@gmail.com> wrote:
> of course I looked at the source (obvious first step) before asking
> question and further following tsk->in_iowait, it seems it is just
> needed for accounting purpose.
>
> ? ? ? ? ? ? ? ? ? ? ? ?if (tsk->in_iowait) {
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?se->statistics.iowait_sum += delta;
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?se->statistics.iowait_count++;
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?trace_sched_stat_iowait(tsk, delta);
> ? ? ? ? ? ? ? ? ? ? ? ?}
>
> Wanted to be sure of "is that it all about"? or I am missing something here?

I got a feeling that the main show is:
       blk_flush_plug(current);
that name somehow indicates it is "forcing" read/write to happen,
either real soon or at the earliest moment possible...


-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

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

* difference between io_schedule() and schedule()
  2011-08-10  7:37     ` Mulyadi Santosa
@ 2011-08-10  8:55       ` Rajat Sharma
  0 siblings, 0 replies; 5+ messages in thread
From: Rajat Sharma @ 2011-08-10  8:55 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Aug 10, 2011 at 1:07 PM, Mulyadi Santosa
<mulyadi.santosa@gmail.com> wrote:
> Hi Rajat...
>
> On Tue, Aug 9, 2011 at 09:30, Rajat Sharma <fs.rajat@gmail.com> wrote:
>> of course I looked at the source (obvious first step) before asking
>> question and further following tsk->in_iowait, it seems it is just
>> needed for accounting purpose.
>>
>> ? ? ? ? ? ? ? ? ? ? ? ?if (tsk->in_iowait) {
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?se->statistics.iowait_sum += delta;
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?se->statistics.iowait_count++;
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?trace_sched_stat_iowait(tsk, delta);
>> ? ? ? ? ? ? ? ? ? ? ? ?}
>>
>> Wanted to be sure of "is that it all about"? or I am missing something here?
>
> I got a feeling that the main show is:
> ? ? ? blk_flush_plug(current);
> that name somehow indicates it is "forcing" read/write to happen,
> either real soon or at the earliest moment possible...
>
>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer and consultant
>
> blog: the-hydra.blogspot.com
> training: mulyaditraining.blogspot.com
>

Ah, just missed that, thats actually countable difference. Thanks for
the pointer :)

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

end of thread, other threads:[~2011-08-10  8:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-06  7:01 difference between io_schedule() and schedule() Rajat Sharma
2011-08-08 14:55 ` Jonathan Neuschäfer
2011-08-09 13:30   ` Rajat Sharma
2011-08-10  7:37     ` Mulyadi Santosa
2011-08-10  8:55       ` Rajat Sharma

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.