From: Joe Perches <joe@perches.com>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: John W Linville <linville@tuxdriver.com>, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] rtlwifi: Preallocate USB read buffers and eliminate kalloc in read routine
Date: Mon, 19 Mar 2012 13:52:45 -0700 [thread overview]
Message-ID: <1332190365.6525.10.camel@joe2Laptop> (raw)
In-Reply-To: <4F6798C2.1000203@lwfinger.net>
On Mon, 2012-03-19 at 15:36 -0500, Larry Finger wrote:
> On 03/18/2012 09:46 PM, Joe Perches wrote:
> > On Sun, 2012-03-18 at 21:42 -0500, Larry Finger wrote:
> >> The current version of rtlwifi for USB operations uses kmalloc to
> >> acquire a 32-bit buffer for reading.
> > trivia:
> >> +++ wireless-testing-new/drivers/net/wireless/rtlwifi/usb.c
> > []
> >> @@ -955,6 +947,13 @@ int __devinit rtl_usb_probe(struct usb_i
> >> return -ENOMEM;
> >> }
> >> rtlpriv = hw->priv;
> >> + rtlpriv->usb_data = kzalloc(RTL_USB_MAX_RX_COUNT * sizeof(u32),
> >> + GFP_KERNEL);
> >> + if (!rtlpriv->usb_data) {
> >> + RT_ASSERT(false, "USB data buffer allocation failed\n");
> > The RT_ASSERT isn't really necessary as kzalloc already
> > does a dump_stack on allocation failure.
> I thought it only dumped the stack when some form of kernel debugging was enabled.
<annoying wiseguy mode>
If by kernel debugging you mean enabling CONFIG_PRINTK,
then yes that's true...
<>
The kernel does a dump_stack on any k.alloc or v.alloc failure.
see: warn_alloc_failed in mm/page_alloc.c
You can suppress it with GFP_NOWARN.
prev parent reply other threads:[~2012-03-19 20:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-19 2:42 [PATCH] rtlwifi: Preallocate USB read buffers and eliminate kalloc in read routine Larry Finger
2012-03-19 2:46 ` Joe Perches
2012-03-19 20:36 ` Larry Finger
2012-03-19 20:52 ` Joe Perches [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=1332190365.6525.10.camel@joe2Laptop \
--to=joe@perches.com \
--cc=Larry.Finger@lwfinger.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/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