My goal is to implement a system call in linux kernel that enables/disables a CPU core.

First, I implemented a system call that disbales CPU3 in a 4-core system.

The system call code is as follows:

#include <linux/kernel.h>
#include <linux/slab.h>
#include <asm/uaccess.h>
#include <asm/unistd.h>
#include <linux/cpumask.h>
#include <linux/smp.h>

asmlinkage long sys_new_syscall(void)
    unsigned int cpu3;

    set_cpu_online (cpu3, false) ;          /* clears the CPU in the cpumask */
    printk ("CPU%u is offline\n", cpu3);

    return 0;

The system call was registered correctly in the kernel and I enabled 'cpu hotplug' feature during kernel configuration ( See picture ) Kernel configuration

However, the kernel failed to compile in the last stage and I got this error:

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.6.7-rt13-v7+ with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
arch/arm/boot/Makefile:99: recipe for target 'install' failed
make[1]: *** [install] Error 1
arch/arm/Makefile:333: recipe for target 'install' failed
make: *** [install] Error 2

What am I doing wrong ?

  • This may be silly, but it appears that the computer you are using to compile the linux image has run out of disk space. This can happen if building out of a mounted drive even if rootfs still has space.
    – crasic
    Aug 15 '17 at 20:28
  • Thank you for your answer. I am compiling linux on raspberry pi3/ModelB. Any idea how can I fix this problem?
    – A.Chaalane
    Aug 15 '17 at 20:54
  • Did you expand the file system after installing your Pi? The .img only writes a ~1GB filesystem that has very little extra space. The first line of the output of df -h will tell you the size of the root file system and how much space is left, it should be the size of your SD card. You can expand the filesystem easily using raspi-config under Advanced Options, option A1
    – crasic
    Aug 15 '17 at 21:05
  • I wanted to expand the file system I got this in the terminal : Your partition layout is not currently supported by this tool.You are probably using NOOBS, in which case your root filesystem is already expanded anyway.
    – A.Chaalane
    Aug 16 '17 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.