1

I need to modify a network adapter driver to increase its performance for my use, and I need a huge physical memory chunk to be contiguous.

I will need several of these chunks based on the number of ports. Each chunk should be around 64MB.

Currently I am looking at my option to be CMA and bootmem.

Is there any other option for same and I haven't used any of it till date so can someone give me a direction on how to use it? as in are there inbuilt functions to manage this allocated memory or will I have to manage it all in my driver?

sawdust
  • 16,103
  • 3
  • 40
  • 50
Kanishka
  • 19
  • 6
  • Welcome to StackOverflow! I added some space to your question, and made the title slightly more telling. Hope you don't mind the edits – salezica Nov 16 '16 at 18:31
  • [Hugepages](https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt)? – Michael Foukarakis Nov 16 '16 at 18:34
  • You left it unstated, and it may be obvious to some people, but you're looking for *physical* memory that is contiguous, rather than *virtual* memory. The distinction is important. – sawdust Nov 17 '16 at 01:23
  • I meant, I cannot split the individual chunks into smaller size that I can get using kernel mallocs. – Kanishka Nov 17 '16 at 05:57
  • *"I meant, I cannot split the individual chunks ..."* -- No, that does not clarify your intentions. *"are there inbuilt functions to manage this allocated memory"* -- Why would you have a driver allocate so much memory that it has to be *"managed"*? BTW your consistent avoidance of (or failure to) distinguishing between virtual or physical memory in your SO posts is troubling. – sawdust Nov 17 '16 at 07:17
  • I need physically contiguous memory not virtual, and in case of my driver currently its creating multiple thousand entries (@time of IO) almost in parallel throughout execution. Currently I am managing it using a pool of my data structure, but I want to see if using a huge chunk of physically contiguous memory would improve its performance, which theoretically should happen. – Kanishka Nov 21 '16 at 09:22
  • @Kanishka I would love to know why you need these massive multiple chunks of continuous memory. Is it because network packets appear in memory faster than they can be processed? – Neil May 30 '17 at 11:30
  • My application has two parts, once the system has come up and all the drivers are in place first part of my app takes up almost all the memory to manage it by itself. due to this second part where the new network driver needed kmalloc'd memory in run time fails. I was trying to create a pool out of this kmalloc'd memory before the other part claims all that is left. – Kanishka Jun 15 '17 at 13:04
  • As of now I have found a brute force approach to get this chunk bymaking sure the kmalloc'd memory address is contiguous. So its working for now but I am open to any better solution. – Kanishka Jun 15 '17 at 13:08

0 Answers0