Re: Bigger slabs

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

 



> 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?

The slab's purpose are small allocations, that's what it is there for.
If you need larger allocations you need to grab contigous pages
yourself, in your case __get_free_pages(GFP_KERNEL, 8). 8 is the order
of pages, iow. 2**8 (assuming 4k pages).

Are you really sure you need 1MB of contigous space? I don't know driver
writing very well but that sounds awfully large. If it is a driver with
open source maybe you should talk to people who know their things and
present the problem, you didn't say what kind of driver it is.

Alex


--
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