Saturday 20 August 2016

Last week update of GSOC

*Create GSOC project repository with instructions and description and some cleanup

*Started preparing a new proposal for a modified patch from what I learned in the GSOC period. As I want to continue working on this project after GSOC period.

Saturday 13 August 2016

Submitted the CMA kexec patch

*Modified the patch descriptions
*Submitted the patch to main kernel community

Link to the patch

https://lkml.org/lkml/2016/8/12/263

***Any review or suggestion is welcome on the patch

Saturday 6 August 2016

Creating the final patch

*Added a new kernel config option CONFIG_KEXEC_CMA to enable the run time allocation feature.
*created a four patch patch set (RFC) for final submission to kernel community.
*This solution won't work fully until CMA pinning issue be solved.
*Solution like GCMA (here the allocation is guaranteed) exist but not in mainline.
*There was a RFC patch (woking) submitted some time back against linux kernel v3.18. I ported my patch in v3.18 kernel. I have done basic testing as I have limited knowledge how to test this kind of patch. This patch needed to be tested with different type of load in memory.

Tuesday 19 July 2016

Initrmfs generator for kdump

Creating a initramfs generator was a part of my GSOC project.

A initramfs is basically a image which is used before root file system get mounted. The kernel simply extract image and uses it as early file system. It sometime contains Microcode for processors. The microcode is applied during boot. The initramfs is basically for advanced users. It's not compulsory. It contains the directory structure of a linux system. It contains any user space utilities, device drivers and mainly the "init" binary which prepares the system. The user generally uses a custom init by help of tools like systemd, which behaved like init. It uses cpio newc format archive as initramfs. This can also be compressed using formats like gzip. This cpio supports device nodes.

For kdump our initramfs's job is to take the dump from /proc/vmcore and save it. The current initramfs for kdump in fedora contains a lot of things which are unnecessary for our purpose. Our job is to create the minimal initramfs.

For this we have to include the necessary things. The systemd unit configuration files, makedumpfile, busybox, usb storage drivers (it takes dump in usb thumb drive). That's what I found necessary till now.

Current kdump user space tool uses dracut for this purpose. dracut puts the necessary things in a folder and creates a cpio archive out of this. Our kdump user space tool puts the necessary things in that temporary folder.
It takes some help of dracut (using dracut functions) for this.


dracut takes modular approach. All the things we want to put in initramfs is in some dracut module. That way dracut can easily takes the decision what to put in the initramfs. The module must include a setup script called module-setup.sh which contains the functions check, install, installkernel which defines if the modules will be included or not and the functionality of modules.

Current kexec tool inserts the extra things (makedumpfile, systemd unit config files etc) which are not present in dracut inbuilt modules by creating a dracut module called 99kdumpbase.

Monday 11 July 2016

Problems with kdump runtime memory allocation patch

After creating the kdump run time memory allocation patch using CMA (Contiguous memory allocator) framework we got review from some members of linux kernel community. They mentioned some issues with CMA.

*CMA doesn't work as it should work. It fails to allocate memory from a CMA area sometime. As, kernel can pin the movable pages (directly or using reference count). This will make the pages temporarily unmovable. hence, CMA fails to allocate memory.

https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org/thread/V4T3QOKEUT4EYUWB3G44SIEJGFI42FQO/

https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org/thread/7KFUPRFNIB7BIS6JCUJ4AVH5YURSIKAJ/

People are trying to solve this problems their own way. Companies using some modified version of CMA for their purpose. There is not any solution to the mainline yet.

Wednesday 22 June 2016

Week 4 report

*The CMA patch for kexec is working on my system with fedora kexec-tools. It is able to do both high and low memory allocation for crash kernel.
*Sent the first version of proposal for CMA patch to linux kernel community.

Wednesday 8 June 2016

GSOC: week 2 report

*Started creating the patch for allocating memory from the CMA area for crash kernel

*Started testing the patch.