Commit 0685ab4fb8e527639d9867df60d49dccba85d842

Authored by Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched

* git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched:
  sched: bump version of kernel/sched_debug.c
  sched: fix minimum granularity tunings
  sched: fix RLIMIT_CPU comment
  sched: fix kernel/acct.c comment
  sched: fix prev_stime calculation
  sched: don't forget to unlock uids_mutex on error paths

Showing 6 changed files Side-by-side Diff

... ... @@ -374,7 +374,9 @@
374 374 stime = nsec_to_clock_t(p->se.sum_exec_runtime) -
375 375 cputime_to_clock_t(task_utime(p));
376 376  
377   - p->prev_stime = max(p->prev_stime, clock_t_to_cputime(stime));
  377 + if (stime >= 0)
  378 + p->prev_stime = max(p->prev_stime, clock_t_to_cputime(stime));
  379 +
378 380 return p->prev_stime;
379 381 }
380 382 #endif
include/asm-generic/resource.h
... ... @@ -12,7 +12,7 @@
12 12 * then it defines them prior including asm-generic/resource.h. )
13 13 */
14 14  
15   -#define RLIMIT_CPU 0 /* CPU time in ms */
  15 +#define RLIMIT_CPU 0 /* CPU time in sec */
16 16 #define RLIMIT_FSIZE 1 /* Maximum filesize */
17 17 #define RLIMIT_DATA 2 /* max data size */
18 18 #define RLIMIT_STACK 3 /* max stack size */
... ... @@ -413,7 +413,7 @@
413 413 * The acct_process() call is the workhorse of the process
414 414 * accounting system. The struct acct is built here and then written
415 415 * into the accounting file. This function should only be called from
416   - * do_exit().
  416 + * do_exit() or when switching to a different output file.
417 417 */
418 418  
419 419 /*
kernel/sched_debug.c
... ... @@ -199,7 +199,7 @@
199 199 u64 now = ktime_to_ns(ktime_get());
200 200 int cpu;
201 201  
202   - SEQ_printf(m, "Sched Debug Version: v0.06-v22, %s %.*s\n",
  202 + SEQ_printf(m, "Sched Debug Version: v0.07, %s %.*s\n",
203 203 init_utsname()->release,
204 204 (int)strcspn(init_utsname()->version, " "),
205 205 init_utsname()->version);
... ... @@ -22,7 +22,7 @@
22 22  
23 23 /*
24 24 * Targeted preemption latency for CPU-bound tasks:
25   - * (default: 20ms * ilog(ncpus), units: nanoseconds)
  25 + * (default: 20ms * (1 + ilog(ncpus)), units: nanoseconds)
26 26 *
27 27 * NOTE: this latency value is not the same as the concept of
28 28 * 'timeslice length' - timeslices in CFS are of variable length
29 29  
30 30  
... ... @@ -36,14 +36,14 @@
36 36  
37 37 /*
38 38 * Minimal preemption granularity for CPU-bound tasks:
39   - * (default: 1 msec * ilog(ncpus), units: nanoseconds)
  39 + * (default: 4 msec * (1 + ilog(ncpus)), units: nanoseconds)
40 40 */
41   -unsigned int sysctl_sched_min_granularity = 1000000ULL;
  41 +unsigned int sysctl_sched_min_granularity = 4000000ULL;
42 42  
43 43 /*
44 44 * is kept at sysctl_sched_latency / sysctl_sched_min_granularity
45 45 */
46   -static unsigned int sched_nr_latency = 20;
  46 +static unsigned int sched_nr_latency = 5;
47 47  
48 48 /*
49 49 * After fork, child runs first. (default) If set to 0 then
... ... @@ -61,7 +61,7 @@
61 61  
62 62 /*
63 63 * SCHED_BATCH wake-up granularity.
64   - * (default: 10 msec * ilog(ncpus), units: nanoseconds)
  64 + * (default: 10 msec * (1 + ilog(ncpus)), units: nanoseconds)
65 65 *
66 66 * This option delays the preemption effects of decoupled workloads
67 67 * and reduces their over-scheduling. Synchronous workloads will still
... ... @@ -71,7 +71,7 @@
71 71  
72 72 /*
73 73 * SCHED_OTHER wake-up granularity.
74   - * (default: 10 msec * ilog(ncpus), units: nanoseconds)
  74 + * (default: 10 msec * (1 + ilog(ncpus)), units: nanoseconds)
75 75 *
76 76 * This option delays the preemption effects of decoupled workloads
77 77 * and reduces their over-scheduling. Synchronous workloads will still
... ... @@ -337,8 +337,11 @@
337 337 struct user_struct *new;
338 338  
339 339 new = kmem_cache_alloc(uid_cachep, GFP_KERNEL);
340   - if (!new)
  340 + if (!new) {
  341 + uids_mutex_unlock();
341 342 return NULL;
  343 + }
  344 +
342 345 new->uid = uid;
343 346 atomic_set(&new->__count, 1);
344 347 atomic_set(&new->processes, 0);
... ... @@ -355,6 +358,7 @@
355 358  
356 359 if (alloc_uid_keyring(new, current) < 0) {
357 360 kmem_cache_free(uid_cachep, new);
  361 + uids_mutex_unlock();
358 362 return NULL;
359 363 }
360 364  
... ... @@ -362,6 +366,7 @@
362 366 key_put(new->uid_keyring);
363 367 key_put(new->session_keyring);
364 368 kmem_cache_free(uid_cachep, new);
  369 + uids_mutex_unlock();
365 370 return NULL;
366 371 }
367 372