2

I am writing a device driver to allocate a large buffer for DMA. My system is using (or so I believe) 4k pages, and I want it to use larger pages, i.e. at least 2M pages.

How can I:

  • enable large pages in the system (or check if they're enabled)?
  • specify that the current kmalloc should use large pages?
Nathan Fellman
  • 122,701
  • 101
  • 260
  • 319
  • I'm not sure precisely how to allocate large pages, so I can't answer the question directly, but do note that often large pages simply aren't available due to memory fragmentation. If your device (or IOMMU) supports scatter-gather DMA, it's better to use that instead of a single giant buffer; otherwise, you'll need to reserve your memory early in the boot process, when there are still large contiguous chunks of free physical memory. – bdonlan Jul 15 '12 at 20:08

0 Answers0