CentOSThis forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The goal is to add CMA to the kernel and then install it.
I'm quite sure I followed all steps including the ones listed in chapter 2:
cd ~/rpmbuild/BUILD/kernel-*/linux-*/
cp /boot/config-`uname -r` .config
make oldconfig
make menuconfig
add: # x86_64
cp .config configs/kernel-3.10.0-`uname -m`.config
cp configs/* ~/rpmbuild/SOURCES/
Build new kernel:
rpmbuild -bb --target=`uname -m` kernel.spec 2> build-err.log | tee build-out.log
During the build, the modified .config was automatically changed back to its original version.
The 3rd line is now:
# Linux/x86_64 4.18.0-193.el8.cma.x86_64 Kernel Configuration
cma is the buildid in my kernel.spec. but other changes I did in .config were gone.
I ran the procedure few times to make sure I'm not missing a step.
Each time I did it after installin centos 8.2 from scratch.
In all trials, CMA was not added to the kernel.
I checked it in /proc/meminfo
Have anyone tried to install a custom centos 8.x kernel ?
After booting the new kernel, I checked kernel-4.18.0-3.10.0-x86_64.config located in ~/rpmbuild/SOURCES
It is the modified .config (CONFIG_CMA=y, CONFIG_DMA_CMA=y)
The goal is to add CMA to the kernel and then install it. I'm quite sure I followed all steps including the ones listed in chapter 2:
cd ~/rpmbuild/BUILD/kernel-*/linux-*/
cp /boot/config-`uname -r` .config
make oldconfig
make menuconfig
add: # x86_64
cp .config configs/kernel-3.10.0-`uname -m`.config
cp configs/* ~/rpmbuild/SOURCES/
Build new kernel: rpmbuild -bb --target=`uname -m` kernel.spec 2> build-err.log | tee build-out.log
During the build, the modified .config was automatically changed back to its original version.
The 3rd line is now: # Linux/x86_64 4.18.0-193.el8.cma.x86_64 Kernel Configuration
cma is the buildid in my kernel.spec. but other changes I did in .config were gone. I ran the procedure few times to make sure I'm not missing a step. each time I did it after installin centos 8.2 from scratch. In all trials, CMA was not added to the kernel. I checked it in /proc/meminfo Have anyone tried to install a custom centos 8.x kernel ?
After booting the new kernel, I checked kernel-4.18.0-3.10.0-x86_64.config located in ~/rpmbuild/SOURCES
It is the modified .config (CONFIG_CMA=y, CONFIG_DMA_CMA=y)
You've not followed up in most of your threads here, but did you actually try to boot with the new kernel? And you keep alluding to embedded hardware, running a totally custom system, but don't tell us what this system is/does.
According to the URL, it was tested on 7.x For example, the lines:
Code:
Replace the next line:
cp $RPM_SOURCE_DIR/config-* .
with:
cp $RPM_SOURCE_DIR/kernel-*.config .
are not relevant in 8.2 kernel.spec contains the right line (cp $RPM_SOURCE_DIR/kernel-*.config)
Sorry, no...ALL of those previous threads dealt with this exact issue: enabling CMA. This goes back TWO YEARS now. But you somehow know NOTHING about building a kernel or a module (something you've claimed to have done successfully before).
You posted a link to the CentOS guide to build a kernel...what, exactly, do you think we're going to be able to add that isn't in the official documentation?? That was updated just a few months ago. If it doesn't match your system...you need to follow a different guide, don't you? And the part you say doesn't apply to 8...did you read step one carefully?? Since it says (bolded for emphasis only; partially bolded in original link/text):
Quote:
Originally Posted by CentOS Instructions
If you you do not intend to modify the distributed kernel configuration file you may omit this section (CentOS-7).
...meaning that, if you have CentOS 7...you OMIT THAT SECTION. Do you have CentOS 7????
And again, going back to at least last year, you were directed in another thread to read the Red Hat kernel notice that says explicitly:
Quote:
Originally Posted by Red Hat Knowledgebase
CMA disabled by default
On 64-bit ARM Red Hat Enterprise Linux systems with memory limited to 1G or below, the Contiguous Memory Allocator (CMA) consumed large amount of memory, thus leaving insufficient memory for the rest of the kernel. Consequently, the out-of-memory (OOM) condition sometimes occurred in the kernel or certain user-space applications, such as Shared Memory in Linux (SHM)(/dev/shm).
The CMA support in the Red Hat Enterprise Linux kernel is now disabled by default for all architectures, and CMA no longer causes OOM.(BZ#1519317)
CentOS 8 is built on the RHEL system. Again, you allude to an embedded system...but STILL don't actually tell us anything about it.
You claim to have followed the instructions...yet on the CentOS forums, someone had to explicitly TELL YOU to follow some of the steps that you obviously didn't do: https://forums.centos.org/viewtopic....327075#p327075
....so since you seemingly didn't follow the guide, chances are VERY good that you aren't going to have success.
Do you mean that I should read the red hat procedure and not the one in the above URL ?
Seriously?? You are clearly not paying attention. AGAIN: the Red Hat link is not a 'procedure', and tells you about CMA. AGAIN, if you want to compile a kernel, then *FOLLOW THE CENTOS DOCS*, which you clearly are not. AGAIN: someone had to tell you explicitly in your thread on the CentOS forums to do something that was a pre-requisite. Since you didn't bother reading/following those instructions, you probably aren't following the other steps either.
# make bzImage
# make modules
# make
# make modules_install
# make install
This is not "by the book" way to modify kernel.
Right; AGAIN, you have been working on this for *TWO YEARS* now, and have claimed to have compiled kernels/modules before. You *STILL* don't tell us anything about what you're trying to accomplish (other than repeating over and over, "I need to enable CMA"), or what kind of hardware you're working with. AGAIN: follow the procedures on the CentOS site.
You wrote:
"You claim to have followed the instructions...yet on the CentOS forums, someone had to explicitly TELL YOU to follow some of the steps that you obviously didn't do:
https://forums.centos.org/viewtopic....327075#p327075"
Those steps were completed successfully. But the final goal (CMA enabled) was failed.
Hello,
All I need is to enable CMA under centos 8.2. That's all.
Right; we know this because (AGAIN) this is the eighth time you've asked the same question.
Quote:
The hardware is : Lenovo ThinkSystem SR650 Server (Xeon SP Gen 2)
Really?? Because in some of your other threads, you're saying its some sort of embedded system, and now it's back to the Xeon system you asked about more than a year ago.
Quote:
It's not clear from your answer what is the right way to enable CMA on centos 8.2 The link I have is only: https://wiki.centos.org/HowTos/Custom_Kernel
which fits only Centos 7 (am I right ?)
Seriously???? Again, are you not reading or understanding that doc??? If you want to know how to compile a custom kernel for CentOS, you should **AGAIN** (as you've been told several times very plainly), follow that guide. You don't appear to be, since **AGAIN** that guide tells you to skip things if you are using CentOS 7. AGAIN, you say you're using CentOS 8.
Since CentOS 8 is NOT CentOS 7, what do you think you should do??
Quote:
You wrote:
"You claim to have followed the instructions...yet on the CentOS forums, someone had to explicitly TELL YOU to follow some of the steps that you obviously didn't do:
https://forums.centos.org/viewtopic....327075#p327075"
Those steps were completed successfully. But the final goal (CMA enabled) was failed.
Again, you are missing the point. You started out saying you 'followed the guide'...but you DID NOT, since doing those things were prerequisites to the rest of the guide. Since you skipped very basic things, you most likely skipped others...because if you *DID* follow the instructions, things would work.
AGAIN: you have been working on 'enabling CMA' for two years now; you claim to have done it before as well. Have you actually read up on what's needed, also? Because again, you were pointed to the runtime kernel switches you need to put in, to enable things.
Kernel parameters:
Code:
CONFIG_CMA=y
CONFIG_DMA_CMA=y
CONFIG_CMA_DEBUG=y
CONFIG_CMA_DEBUGFS=y
CONFIG_CMA_AREAS=<PICK A NUMBER FOR YOUR SYSTEM>
Command line boot options (AGAIN: either modify grub or edit line on the fly)
Code:
cma=<SOME MEMORY SIZE>
AGAIN: follow the CentOS instructions and the advice you've been repeatedly given over the past two years. If you cannot (or won't), there isn't much more we can help you with.
Right; yes...this has been said NUMEROUS TIMES thus far.
Quote:
According to the guide: "If you you do not intend to modify the distributed kernel configuration file you may omit this section (CentOS-7)" I want to modify kernel configuration, so how should I change kernel configuration for 8.2 ?
At this point, I would suggest hiring someone.
You have been told, SEVERAL TIMES, to use the CentOS guide; THAT IS HOW YOU DO IT. Cannot be more plain and simple. If you cannot understand that, there is NOTHING we can do to help you. AGAIN: follow that guide..it is clear you have not, or just do not understand how to do it. So far:
You have been given the guide to follow
That guide has step-by-step instructions (with pictures)
You were given the parameters to put into the kernel config
You were given the parameters to use on the boot line and in grub
You have been working on this for TWO YEARS and cannot seem to follow basic, clear instructions
Aside from having someone here type things in for you, there is nothing else we can tell you. So, hire someone or follow the instructions. There is no point in posting repeatedly, "I want to enable CMA!" over and over...there is no point in asking the same things again and again.
When you did 'make menuconfig' did you make the appropriate changes for CMA and save it to .config before exiting out?
Been asked of the OP several times, and that step is one that is mentioned early on in the documentation the OP posted a link to, from the CentOS site. The OP has been working on this for two years at this point, and (based on what's here and on the CentOS forums), hasn't followed the instructions. Step 1 (build preparations) wasn't complete, and step 2 has this listed (bolded and underlined for emphasis only)
Quote:
Originally Posted by CentOS Documentation
First run make oldconfig. Now you should run either make menuconfig, make gconfig or make xconfig to customize the kernel configuration. Once complete, remember to save your changes.
Given the fact the OP has repeatedly said their changes aren't there, I'd strongly suspect they did NOT save their changes.
unpack and prepare the source files
------------------------------------
cd ~/rpmbuild/SPECS
rpmbuild -bp --target=$(uname -m) kernel.spec
You should get the following error:
asciidoc is needed by kernel-4.18.0-193.el8.x86_64
audit-libs-devel is needed by kernel-4.18.0-193.el8.x86_64
binutils-devel is needed by kernel-4.18.0-193.el8.x86_64
bison is needed by kernel-4.18.0-193.el8.x86_64
dwarves is needed by kernel-4.18.0-193.el8.x86_64
elfutils-devel is needed by kernel-4.18.0-193.el8.x86_64
flex is needed by kernel-4.18.0-193.el8.x86_64
gcc is needed by kernel-4.18.0-193.el8.x86_64
java-devel is needed by kernel-4.18.0-193.el8.x86_64
kabi-dw is needed by kernel-4.18.0-193.el8.x86_64
libbpf-devel is needed by kernel-4.18.0-193.el8.x86_64
libcap-devel is needed by kernel-4.18.0-193.el8.x86_64
libcap-ng-devel is needed by kernel-4.18.0-193.el8.x86_64
llvm-toolset is needed by kernel-4.18.0-193.el8.x86_64
m4 is needed by kernel-4.18.0-193.el8.x86_64
make is needed by kernel-4.18.0-193.el8.x86_64
ncurses-devel is needed by kernel-4.18.0-193.el8.x86_64
newt-devel is needed by kernel-4.18.0-193.el8.x86_64
nss-tools is needed by kernel-4.18.0-193.el8.x86_64
numactl-devel is needed by kernel-4.18.0-193.el8.x86_64
openssl-devel is needed by kernel-4.18.0-193.el8.x86_64
pciutils-devel is needed by kernel-4.18.0-193.el8.x86_64
perl(ExtUtils::Embed) is needed by kernel-4.18.0-193.el8.x86_64
perl-devel is needed by kernel-4.18.0-193.el8.x86_64
perl-generators is needed by kernel-4.18.0-193.el8.x86_64
pesign >= 0.10-4 is needed by kernel-4.18.0-193.el8.x86_64
python3-devel is needed by kernel-4.18.0-193.el8.x86_64
python3-docutils is needed by kernel-4.18.0-193.el8.x86_64
xmlto is needed by kernel-4.18.0-193.el8.x86_64
xz-devel is needed by kernel-4.18.0-193.el8.x86_64
zlib-devel is needed by kernel-4.18.0-193.el8.x86_64
After the step: cp .config configs/kernel-`uname -r`.config
the folder configs contains also the file:
kernel-4.18.0-x86_64.config
I double checked: This file contains CMA=y + DMA_CMA=y Can you please tell what is wrong in my steps ?
Yes, we will tell you again: YOU ARE NOT FOLLOWING THE INSTRUCTIONS.
There is no 'wget' statement, yet you're running one.
There is no 'you should get the following error' sections anywhere...yet you're getting those, because up until this point, you have obviously *STILL* not read the guide and found out that you needed to install those missing dependencies.
You are installing an old kernel; something you've been told not to do several times in the past.
You are not copying the config to the correct location (again, NOT FOLLOWING THE INSTRUCTIONS)
There is absolutely nothing we can do to help you; again, you are not following the instructions. If you don't understand them, we can't help with that. Again, hire someone to do this for you, because if after two years you cannot, it's time to move on.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.