All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [KJ] [PATCH] linux-2.6.17-rc3-git13
@ 2006-05-08  7:26 walter harms
  2006-05-09  8:00 ` walter harms
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: walter harms @ 2006-05-08  7:26 UTC (permalink / raw)
  To: kernel-janitors



Anne Thrax wrote:
> do_task_stat() was using too much stack
> from make checkstack:
> 0x080eae08 do_task_stat:                                1752
> 
> So I took almost all the variables used in the function and made a new 
> structure do_task_stat_vars, and dynamically allocated it in the function.
> This is supposed to be a quick hack, and hopefully the authors will 
> really do something about it.
> 
> Signed off by: Anne Thrax <foobarfoobarfoobar@gmail.com>
> 
> --- linux-2.6.17-rc3-git13/fs/proc/array.c      2006-05-07 
> 23:01:50.000000000 -0400
> +++ linux-uml/fs/proc/array.c   2006-05-08 01:31:12.000000000 -0400
> @@ -316,7 +316,7 @@
> 
>  static int do_task_stat(struct task_struct *task, char * buffer, int 
> whole)
>  {
> -       unsigned long vsize, eip, esp, wchan = ~0UL;
> +       /* unsigned long vsize, eip, esp, wchan = ~0UL;
>         long priority, nice;
>         int tty_pgrp = -1, tty_nr = 0;
>         sigset_t sigign, sigcatch;
> @@ -332,35 +332,49 @@
>         unsigned long rsslim = 0;
>         struct task_struct *t;
>         char tcomm[sizeof(task->comm)];
> +       */
> +       struct do_task_stat_vars *vars;
> +       vars = kmalloc(sizeof(struct do_task_stat_vars), GFP_KERNEL);
> +       vars->vsize = vars->eip = vars->esp = vars->wchan = ~0UL;
> +       vars->tty_pgrp = -1;
> +       vars->tty_nr = 0;
> +       vars->pgid = -1;
> +       vars->sid = -1;
> +       vars->num_threads = 0;
> +       vars->cmin_flt = vars->cmaj_flt = vars->min_flt = vars->maj_flt 

i am missing a check that kmalloc succeded. i agree with nish that
defining vars outside the header is bad style (but possible for C99, 
unfortunaly).

happy hacking,
  wh
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-05-11  1:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-08  7:26 [KJ] [PATCH] linux-2.6.17-rc3-git13 walter harms
2006-05-09  8:00 ` walter harms
2006-05-09  8:13 ` Greg KH
2006-05-09  9:36 ` walter harms
2006-05-11  1:47 ` Anne Thrax

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.