Search Linux Wireless

Re: [PATCH] rtlwifi: Preallocate USB read buffers and eliminate kalloc in read routine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux