LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 09-19-2019, 02:13 AM   #1
zvivered
Member
 
Registered: Sep 2007
Posts: 294

Rep: Reputation: 23
Centos 7.x: Physical buffer allocation


Hello,

Under Centos 7.x (64) I tried to allocate a 32MB contiguous physical memory with:

void *p = dma_alloc_coherent (NULL, 0x2000000, &DmaHandle, GFP_KERNEL);

Also tried:

void *p = __get_free_pages (GFP_KERNEL, __get_order (0x2000000));

In both cases I got p=0 and few error messages in dmesg.

It works fine if the size is 0x400000 (4MB).

Is there a solution without changing the kernel boot command line parameters ?

Thank you,
Zvika
 
Old 09-20-2019, 03:58 PM   #2
zvivered
Member
 
Registered: Sep 2007
Posts: 294

Original Poster
Rep: Reputation: 23
Hello,

I tried to add cma=32M to the kernel parameters.
After boot I got:

more /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.10.0-957.10.1.el7.x86_64 root=/dev/mapper/centos-root ro c
rashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet cma=32M

But;
dma_alloc_coherent (NULL, 0x2000000, &DmaHandle, GFP_KERNEL);
still returns NULL.

According to kernel-parameters.txt;
cma=nn[MG] [ARM,KNL]
Sets the size of kernel global memory area for contiguous
memory allocations. For more information, see
include/linux/dma-contiguous.h


Does it mean that cma is not relevant in x86 ?

Thank you,
Zvika
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
page allocation failure in RHEL 6 on Physical server thirupathi Linux - Server 4 11-29-2013 02:01 AM
[SOLVED] buffer allocation for single file opened twice in different modes SIG_SEGV Linux - Newbie 6 04-03-2013 12:10 AM
Processor priority level for Algorithm for Buffer Allocation manavendra Programming 1 01-09-2010 06:21 PM
physical memory allocation over 4b protagora27 Linux - Kernel 1 02-28-2009 01:03 AM
What is the difference between the free buffer and buffer in the buffer hash queue? Swagata Linux - Enterprise 0 05-25-2006 11:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 07:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration