Skip to contentSkip to conversation

Information about move_tasks return

DISCUSSION Cícero 3 participants 3 messages Nov 22, 2004 – Nov 23, 2004

lore
Share & tools
lore

Cícero

author
#0 lore raw

hi

I am looking for the result of the function move_task in

kernel/sched.c , I have observed that it returns an int value and as I print it with printk.

I have created a int variable 'results_move_task' which capture the result of

move_task and I print it with printk("%d",results_move_task); I observed that it often returns the value '1' and sometimes it returns '2' or more. Is it really correct?

[]s

PS:Sorry about my english.

#1 lore raw
Quoted 4 lines · Cícero

hi

I am looking for the result of the function move_task in

Quoted 8 lines

kernel/sched.c , I have observed that it returns an int value and as I print it with printk.

I have created a int variable 'results_move_task' which capture the result of

move_task and I print it with printk("%d",results_move_task); I observed that it often returns the value '1' and sometimes it returns '2' or more. Is it really correct?

/*
* move_tasks tries to move up to max_nr_move tasks from busiest to this_rq,
* as part of a balancing operation within "domain". Returns the number of
* tasks moved.
*
* Called with both runqueues locked.
*/
static int move_tasks(runqueue_t *this_rq, int this_cpu, runqueue_t *busiest,
unsigned long max_nr_move, struct sched_domain *sd, enum idle_type idle)
{
...

So as the "documentation" states, it returns the number of tasks actually moved. For instance, The balancing code may request 4 tasks be moved, but for various reasons, only 2 were actually moved to other CPUs, move_tasks() would return 2.

Signature · 1 line
Darren Hart <[email protected]>
#2 lore raw
Quoted 30 lines · Darren Hart
Quoted 4 lines · Cícero

hi

I am looking for the result of the function move_task in

Quoted 8 lines

kernel/sched.c , I have observed that it returns an int value and as I print it with printk.

I have created a int variable 'results_move_task' which capture the result of

move_task and I print it with printk("%d",results_move_task); I observed that it often returns the value '1' and sometimes it returns '2' or more. Is it really correct?

/*
* move_tasks tries to move up to max_nr_move tasks from busiest to this_rq,
* as part of a balancing operation within "domain". Returns the number of
* tasks moved.
*
* Called with both runqueues locked.
*/
static int move_tasks(runqueue_t *this_rq, int this_cpu, runqueue_t *busiest,
unsigned long max_nr_move, struct sched_domain *sd, enum idle_type idle)
{
...

Quoted 4 lines

So as the "documentation" states, it returns the number of tasks actually moved. For instance, The balancing code may request 4 tasks be moved, but for various reasons, only 2 were actually moved to other CPUs, move_tasks() would return 2.

and there are a few cases/places where the move target count is limited to only 1.

Signature · 1 line
~Randy