Hi - the application i’m using is very RAM hungry (hence my earlier question on hugepages which are now working) and so i would like to turn off CMA so that i can get at the ~330mb that is has allocated to use for more hugepages. I cant just turn this off in the kernel config and rebuild the kernel as the build fails. Is there anyway to turn it off at runtime / make it smaller / get the kernel to build without CMA
In fact any way to get more memory available would be appreciated. I run this headless and just ssh into it for a computing / memory intensive workload so dont need graphics or anything
@Gouwa - this is the thread i started on getting CMA turned off - any ideas if its possible? When i turn off CMA in the kernel config file and build then it starts throwing errors - can get past the first one by ifdef’ing the variable in question:
#ifdef CONFIG_CMA
static int bypass_4K; #endif
but then we are into huge numbers of errors after that - looks fairly integral to the amlogic driver code. Currently waiting on a usb to serial device so i can change the boot options to set cma to zero to see if that works. Is there anyway to change the kernel boot options without the serial device to tap into u-boot?
What version of kernel did you use? How did you turn off CMA? What errors did you encounter?
For image V171028 you can use boot.ini file to set u-boot environment variables.
You need a SD card with fat32 filesystem, put boot.ini file in it and insert it to VIM, when system bootup will read and parse environment variables in boot.ini file.
I built the kernel from https://github.com/khadas/linux so assume latest version. I turned off CMA using both menuconfig and by editing the kvim_defconfig file, by commenting out CONFIG_CMA=y and CONFIG_DMA_CMA=y, tried the combinations of these one by one and both together and get the same error.
first error is bypass_4K being an unused variable and generates an error because of strict rules. When i modified the source to the extract below to remove that error then there are a huge number of errors generated after that, bits of structs missing etc.
#ifdef CONFIG_CMA
static int bypass_4K; #endif
Think the need for CMA is pretty well embedded. Having said that im happy to turn off lots of features as running this headless without a need for GPU so if you know of any way to get past it then im willing to strip lots of the kernel out!
Have tried a boot.ini file on an otherwise blank FAT32 formatted SD card, but couldnt get it to change the boot. My USB to serial device doesnt seem to be working as i just get gibberish out, so getting another one. The boot.ini file was:
well adding cma=100 to the command line appears to have fully stopped it working lol - cant even get it to boot into upgrade mode now! Thru the buttons or Mregister and still cant get serial working (unless anyone can translate this \�-�V�79�;�����3�=��su}W�}wsy���y���_ay���[yM���]YY^���W�-��^+k��%V����UY{��� lol)! Will continue to play
Im trying to make the CMA smaller - though i think i went the wrong way with the numbers, but didnt want to get to 0 straight away given the issue compiling the kernel. But now sadly i have a deveice that wont boot, so im kind of stuck! How do you guys do the initial programme of the devices? Is there somethign i could try?
ive got it back to being recognised on my computer and flashing an image now works ok - but still not booting afterwards. Have ordered a new board as well. Will update if i get it working again or when the new one arrives.
Should have copied your DTS fix the first time instead of messing with u-boot stuff!
Yes - thats where I am now. Image burns ok, but nothing on reset - no hdmi output, no network connection. Have tried erase all flash - but nothing
Still cant get serial working - is there a recomended serial to usb adaptor, ive tried two and they both output garbage. Have got correct settings and followed the guide in docs on how to set it up
@numbqq - Ive got my new VIM2 now - trying to get to a point where i have hugepages on and CMA off.
I have used the Fenix scripts to build now - makes the process easier.
Ive got hugepages on my adding the followign lines to project/fenix/linux/arch/arm64/configs/kvim_defconfig (also added it to defconfig and kvim_defconfig_buildroot for good measure so i didnt have to build mulitple times)
CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y
Using the Fenix scripts then the file (arch/arm64/boot/dts/amlogic/ep-box.dts) you linked to above to change isnt there, but there is a kvim2_linux.dts so i put the changes into that instead. Then i did a make clean and then built again according to fenix scripts instructions - but when i burn the image it doesnt boot (at least doesnt get as far as getting an IP address) as i cant see it on the network.
yeah - have tried two and have tried swapping contacts over. Ive used one of them on a microcontroller project before and it worked fine there. Connections are as per http://docs.khadas.com/develop/SetupSerialTool/ using three wires for 0v, tx and rx.
Will find another serial device to connect to make sure its all still working
ok, thanks will give that a go - kind of deleting stuff in the dark to be honest! Wouldnt mind if it didnt take so long to build and for me to find out it didnt work lol
I don’t know your build setup but modifying device tree should be pretty easy: simply run make kvim.dtb in you kernel dir after you modify the tree and you’ll get a dtb almost in an instant.
It’s been a while since I’ve worked this low level but CMA should clear out pages (eg inode cache) that others request. On ARM however we use this space for a LOT for things other platforms may have in hardware. I would start by stripping down every driver from the kernel you don’t need (eg audio, video, …) and use serial to get a TTY. Basically get to the level of busybox and then run your application with minimal software.