From f01419fd6d4e5b32fef19d206bc3550cc04567a9 Mon Sep 17 00:00:00 2001 From: "Martin J. Bligh" Date: Wed, 15 Jan 2003 19:46:10 -0800 Subject: [PATCH] (2/3) Initial load balancing Patch from Michael Hohnbaum This adds a hook, sched_balance_exec(), to the exec code, to make it place the exec'ed task on the least loaded queue. We have less state to move at exec time than fork time, so this is the cheapest point to cross-node migrate. Experience in Dynix/PTX and testing on Linux has confirmed that this is the cheapest time to move tasks between nodes. It also macro-wraps changes to nr_running, to allow us to keep track of per-node nr_running as well. Again, no impact on non-NUMA machines. --- fs/exec.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fs/exec.c') diff --git a/fs/exec.c b/fs/exec.c index 4bc2f4d75f25..92716bc7c10b 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1031,6 +1031,8 @@ int do_execve(char * filename, char ** argv, char ** envp, struct pt_regs * regs int retval; int i; + sched_balance_exec(); + file = open_exec(filename); retval = PTR_ERR(file); -- cgit v1.2.3