mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Karsten Keil <kkeil@suse.de>
To: Frank Seidel <fseidel@suse.de>
Cc: "linux kernel" <linux-kernel@vger.kernel.org>,
	akpm@linux-foundation.org, kkeil@suse.de,
	linux-isdn@vger.kernel.org, "Frank Seidel" <frank@f-seidel.de>,
	"Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>,
	"Andreas Eversberg" <andreas@eversberg.eu>,
	"Hannes Eder" <hannes@hanneseder.net>,
	"Adrian Bunk" <bunk@kernel.org>
Subject: Re: [PATCHv2] isdn: reduce stack size of mISDN_dsp
Date: Sun, 1 Mar 2009 20:54:50 +0100	[thread overview]
Message-ID: <20090301195450.GA18618@pingi.kke.suse.de> (raw)
In-Reply-To: <49AAC180.9000707@suse.de>

On Sun, Mar 01, 2009 at 06:10:24PM +0100, Frank Seidel wrote:
> From: Frank Seidel <frank@f-seidel.de>
> 
> Reduce stack size memory footprint of mISDN_dsp.
> (From 1468 bytes for dsp_cmx_send on i386 down
> to 44).

Looks safer and has the same function as before, but
I think we should work on a better solution later, which
use one buffer per instance and allocate it on creation time.
Andreas, what do you think ?

> 
> Signed-off-by: Frank Seidel <frank@f-seidel.de>
> ---
>  drivers/isdn/mISDN/dsp_cmx.c |   12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> --- a/drivers/isdn/mISDN/dsp_cmx.c
> +++ b/drivers/isdn/mISDN/dsp_cmx.c
> @@ -1592,13 +1592,21 @@ dsp_cmx_send(void *arg)
>  	struct dsp_conf_member *member;
>  	struct dsp *dsp;
>  	int mustmix, members;
> -	s32 mixbuffer[MAX_POLL+100], *c;
> +	s32 *mixbuffer;
> +	s32 *c;
>  	u8 *p, *q;
>  	int r, rr;
>  	int jittercheck = 0, delay, i;
>  	u_long flags;
>  	u16 length, count;
>  
> +	mixbuffer = kmalloc(sizeof(*mixbuffer) * (MAX_POLL + 100), GFP_KERNEL);
> +	if (!mixbuffer) {
> +		printk(KERN_ERR "mISDN_dsp: cannot allocate buffer(%s)\n",
> +		       __func__);
> +		return;
> +	}
> +
>  	/* lock */
>  	spin_lock_irqsave(&dsp_lock, flags);
>  
> @@ -1811,6 +1819,8 @@ dsp_cmx_send(void *arg)
>  
>  	/* unlock */
>  	spin_unlock_irqrestore(&dsp_lock, flags);
> +
> +	kfree(mixbuffer);
>  }
>  
>  /*

-- 
Karsten Keil

      reply	other threads:[~2009-03-01 19:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-01 16:32 [PATCH] " Frank Seidel
2009-03-01 16:51 ` Karsten Keil
2009-03-01 16:53   ` Frank Seidel
2009-03-01 17:10 ` [PATCHv2] " Frank Seidel
2009-03-01 19:54   ` Karsten Keil [this message]

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=20090301195450.GA18618@pingi.kke.suse.de \
    --to=kkeil@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=andreas@eversberg.eu \
    --cc=bunk@kernel.org \
    --cc=frank@f-seidel.de \
    --cc=fseidel@suse.de \
    --cc=hannes@hanneseder.net \
    --cc=ilpo.jarvinen@helsinki.fi \
    --cc=linux-isdn@vger.kernel.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®