Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-s…
Browse files Browse the repository at this point in the history
…ched

* 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
  • Loading branch information
Linus Torvalds committed Nov 27, 2007
2 parents ff1ea52 + f7b9329 commit 0685ab4
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
4 changes: 3 additions & 1 deletion fs/proc/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,9 @@ static cputime_t task_stime(struct task_struct *p)
stime = nsec_to_clock_t(p->se.sum_exec_runtime) -
cputime_to_clock_t(task_utime(p));

p->prev_stime = max(p->prev_stime, clock_t_to_cputime(stime));
if (stime >= 0)
p->prev_stime = max(p->prev_stime, clock_t_to_cputime(stime));

return p->prev_stime;
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion include/asm-generic/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* then it defines them prior including asm-generic/resource.h. )
*/

#define RLIMIT_CPU 0 /* CPU time in ms */
#define RLIMIT_CPU 0 /* CPU time in sec */
#define RLIMIT_FSIZE 1 /* Maximum filesize */
#define RLIMIT_DATA 2 /* max data size */
#define RLIMIT_STACK 3 /* max stack size */
Expand Down
2 changes: 1 addition & 1 deletion kernel/acct.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ static u32 encode_float(u64 value)
* The acct_process() call is the workhorse of the process
* accounting system. The struct acct is built here and then written
* into the accounting file. This function should only be called from
* do_exit().
* do_exit() or when switching to a different output file.
*/

/*
Expand Down
2 changes: 1 addition & 1 deletion kernel/sched_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ static int sched_debug_show(struct seq_file *m, void *v)
u64 now = ktime_to_ns(ktime_get());
int cpu;

SEQ_printf(m, "Sched Debug Version: v0.06-v22, %s %.*s\n",
SEQ_printf(m, "Sched Debug Version: v0.07, %s %.*s\n",
init_utsname()->release,
(int)strcspn(init_utsname()->version, " "),
init_utsname()->version);
Expand Down
12 changes: 6 additions & 6 deletions kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

/*
* Targeted preemption latency for CPU-bound tasks:
* (default: 20ms * ilog(ncpus), units: nanoseconds)
* (default: 20ms * (1 + ilog(ncpus)), units: nanoseconds)
*
* NOTE: this latency value is not the same as the concept of
* 'timeslice length' - timeslices in CFS are of variable length
Expand All @@ -36,14 +36,14 @@ unsigned int sysctl_sched_latency = 20000000ULL;

/*
* Minimal preemption granularity for CPU-bound tasks:
* (default: 1 msec * ilog(ncpus), units: nanoseconds)
* (default: 4 msec * (1 + ilog(ncpus)), units: nanoseconds)
*/
unsigned int sysctl_sched_min_granularity = 1000000ULL;
unsigned int sysctl_sched_min_granularity = 4000000ULL;

/*
* is kept at sysctl_sched_latency / sysctl_sched_min_granularity
*/
static unsigned int sched_nr_latency = 20;
static unsigned int sched_nr_latency = 5;

/*
* After fork, child runs first. (default) If set to 0 then
Expand All @@ -61,7 +61,7 @@ unsigned int __read_mostly sysctl_sched_compat_yield;

/*
* SCHED_BATCH wake-up granularity.
* (default: 10 msec * ilog(ncpus), units: nanoseconds)
* (default: 10 msec * (1 + ilog(ncpus)), units: nanoseconds)
*
* This option delays the preemption effects of decoupled workloads
* and reduces their over-scheduling. Synchronous workloads will still
Expand All @@ -71,7 +71,7 @@ unsigned int sysctl_sched_batch_wakeup_granularity = 10000000UL;

/*
* SCHED_OTHER wake-up granularity.
* (default: 10 msec * ilog(ncpus), units: nanoseconds)
* (default: 10 msec * (1 + ilog(ncpus)), units: nanoseconds)
*
* This option delays the preemption effects of decoupled workloads
* and reduces their over-scheduling. Synchronous workloads will still
Expand Down
7 changes: 6 additions & 1 deletion kernel/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,11 @@ struct user_struct * alloc_uid(struct user_namespace *ns, uid_t uid)
struct user_struct *new;

new = kmem_cache_alloc(uid_cachep, GFP_KERNEL);
if (!new)
if (!new) {
uids_mutex_unlock();
return NULL;
}

new->uid = uid;
atomic_set(&new->__count, 1);
atomic_set(&new->processes, 0);
Expand All @@ -355,13 +358,15 @@ struct user_struct * alloc_uid(struct user_namespace *ns, uid_t uid)

if (alloc_uid_keyring(new, current) < 0) {
kmem_cache_free(uid_cachep, new);
uids_mutex_unlock();
return NULL;
}

if (sched_create_user(new) < 0) {
key_put(new->uid_keyring);
key_put(new->session_keyring);
kmem_cache_free(uid_cachep, new);
uids_mutex_unlock();
return NULL;
}

Expand Down

0 comments on commit 0685ab4

Please sign in to comment.