Thread (2 messages) 2 messages, 2 authors, 2002-06-12
  • (off-list ancestor, not in this archive)
  • Re: slab cache · Stephen C. Tweedie <hidden> · 2002-06-10
  • Re: slab cache · David Chow <hidden> · 2002-06-12

Re: slab cache

From: David Chow <hidden>
Date: 2002-06-12 15:05:29

Stephen C. Tweedie wrote:
Hi,

On Sun, Jun 09, 2002 at 10:52:46PM +0800, David Chow wrote:

quoted
I am trying to improve the speed of my fs code. I have a fixed sized 
buffer for my fs, I currently use kmalloc for allocation of buffers 
greater than 4k, use get_free_page for 4k buffers and vmalloc for large 
buffers.
Allocations larger than pagesize always put a higher stress on the VM
and reduce performance.  Your best bet for top performance will be
simply to perform no allocations larger than pagesize.  You can use a
slab cache for those allocations if you want, and that may have some
advantages depending on the locality of allocations in your code.

Using 4k buffers does not limit your ability to use larger data
structures --- you can still chain 4k buffers together by creating an
array of struct page* pointers via which you can access the data.

--Stephen
Yes, but for me it is very hard. When doing compression code, most of 
the stuff is not even byte aligned, most of them might be bitwise 
operated, it need very change to existing code. I've already use 
get_free_page to allocate memory that is 4k to avoid some stress to the 
vm, I have no idea about the difference of get_fee_page and the slab 
cache. All my linear buffers stuff is already using array of page 
pointers, if there any benefits for changing them to use slabcache? 
Please advice, thanks.

regards,
David Chow


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help