Re: [PATCH 1/3] staging: ozwpan: Remove redundant null check before kfree in ozpd.c

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

 



On Tue, Nov 20, 2012 at 04:18:06PM +0000, Rupesh Gujare wrote:
> On 20/11/12 14:16, Dan Carpenter wrote:
> >But more importantly does any of the memory pools code actually
> >make a difference in benchmarks? What is the difference between
> >running with OZ_MAX_TX_POOL_SIZE as zero and it set to 6?
> 
> Agree. Thats is a good test to look for.
> 
> >We have this very complicated code with spinlocks and linked lists
> >to save six 56 byte allocations... It's silly. :P Just use
> >kmalloc().
> 
> Probably we will need to kmalloc() & kfree() few hundred times every
> second when data transfer is taking places. By maintaining a pool of
> 6, we avoid calling kmalloc frequently.  Although I agree that some
> benchmarking is required here to verify that we actually get some
> advantage with current implementation.
> 

The kernel already provides a way to handle this.  Look at
kmem_cache_create().

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux