> On 08/30, Peter Zijlstra wrote:
> >
> > On Thu, 2007-08-30 at 09:50 +0200, Vitaly Mayatskikh wrote:
> > > Short-living process returns its timeslice to the parent, this affects
> > > process that creates a lot of such short-living threads, because its
> > > not a parent for new threads. Patch fixes this issue and doesn't break
> > > kabi as does the patch from reporter:
http://lkml.org/lkml/2007/4/7/21
> >
> > > plain text document attachment (2.6.21-timeslice.patch), "proposed
> > > patch"
> > > diff -up -bB ./include/linux/sched.h.orig ./include/linux/sched.h
> > > --- ./include/linux/sched.h.orig 2007-08-21 09:20:22.000000000 +0200
> > > +++ ./include/linux/sched.h 2007-08-27 10:14:06.000000000 +0200
> > > @@ -827,7 +827,9 @@ struct task_struct {
> > >
> > > unsigned long policy;
> > > cpumask_t cpus_allowed;
> > > - unsigned int time_slice, first_time_slice;
> > > + unsigned int time_slice;
> > > + /* Pid of creator */
> > > + unsigned int cpid;
> >
> > might as well make that pid_t, or maybe even a struct pid* and keep a
> > reference on it - the struct pid police might have an opinion.
>
> I agree, "struct pid*" is better, because
>
> 1. we don't need a costly find_pid() in sched_exit()
> 2. we don't suffer from pid re-use problem