From: Joe Perches <joe@perches.com>
To: Cong Wang <amwang@redhat.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Subject: Re: [Patch net-next] icmp: avoid allocating large struct on stack
Date: Fri, 31 May 2013 20:34:29 -0700 [thread overview]
Message-ID: <1370057669.10556.104.camel@joe-AO722> (raw)
In-Reply-To: <1370057053-20519-1-git-send-email-amwang@redhat.com>
On Sat, 2013-06-01 at 11:24 +0800, Cong Wang wrote:
> struct icmp_bxm is a large struct, reduce stack usage
> by allocating it on heap.
[]
> diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
[]
> @@ -558,6 +558,10 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
> }
> }
>
> + icmp_param = kzalloc(sizeof(*icmp_param), GFP_ATOMIC);
why kzalloc if the previous stack was uninitialized?
next prev parent reply other threads:[~2013-06-01 3:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-01 3:24 [Patch net-next] icmp: avoid allocating large struct on stack Cong Wang
2013-06-01 3:34 ` Joe Perches [this message]
2013-06-01 3:42 ` Cong Wang
2013-06-01 5:22 ` Eric Dumazet
2013-06-02 1:14 ` Cong Wang
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=1370057669.10556.104.camel@joe-AO722 \
--to=joe@perches.com \
--cc=amwang@redhat.com \
--cc=davem@davemloft.net \
--cc=netdev@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;
as well as URLs for NNTP newsgroup(s).