Re: Bigger slabs

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

 



Leonid Podolny wrote:
Hi,
For my driver I needed to allocate a contigous 1Mb buffer. kmalloc() is unable to allocate more than 128kb, so I went and fixed slab.c to allow allocation of 256k, 512k and 1M slabs. I can allow that, since a device I work on will be shipped in a closed preinstalled box. The question is, since it is so trivial, there must be a really good reason to disallow slabs of more that 128kb. Otherwise, it would have been done years ago. It seems to me practical to kmalloc even larger blocks of memory. What is that reason?
L.

Hi,
If you want to allocate big memory chuncks, you have to use pages functions like __get_free_pages().
Slabs are only used for little objects which are often allocated and freed (like processus descr, or descr file...). So with the function kmalloc (function using the slab), you are able to allocate little buffer.
But if you wantto allocate big buffers, DO NOT modify the kernel, USE pages functions !




--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux