All of lore.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [PATCH] linux-2.6.17-rc3-git13
Date: Mon, 08 May 2006 07:26:02 +0000	[thread overview]
Message-ID: <445EF28A.1010601@bfs.de> (raw)



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

             reply	other threads:[~2006-05-08  7:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-08  7:26 walter harms [this message]
2006-05-09  8:00 ` [KJ] [PATCH] linux-2.6.17-rc3-git13 walter harms
2006-05-09  8:13 ` Greg KH
2006-05-09  9:36 ` walter harms
2006-05-11  1:47 ` Anne Thrax

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=445EF28A.1010601@bfs.de \
    --to=wharms@bfs.de \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.