diff options
author | Roland McGrath <roland@redhat.com> | 2010-09-07 19:36:28 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-03-21 12:43:26 -0700 |
commit | 43bcb928c27f7a0fc53b95fac85354ee73b6cd1b (patch) | |
tree | 40b08b48f09dff03427f7badce46761fe30b27b1 /fs | |
parent | b48366b5f84c8a52dca99b241c444793ec6dd771 (diff) |
execve: improve interactivity with large arguments
commit 7993bc1f4663c0db67bb8f0d98e6678145b387cd upstream.
This adds a preemption point during the copying of the argument and
environment strings for execve, in copy_strings(). There is already
a preemption point in the count() loop, so this doesn't add any new
points in the abstract sense.
When the total argument+environment strings are very large, the time
spent copying them can be much more than a normal user time slice.
So this change improves the interactivity of the rest of the system
when one process is doing an execve with very large arguments.
Signed-off-by: Roland McGrath <roland@redhat.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/exec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/exec.c b/fs/exec.c index 8fc4e4099cd..982c3c8473c 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -418,6 +418,8 @@ static int copy_strings(int argc, char __user * __user * argv, while (len > 0) { int offset, bytes_to_copy; + cond_resched(); + offset = pos % PAGE_SIZE; if (offset == 0) offset = PAGE_SIZE; |