【问题标题】:Implementing a system call for CPU hotplug为 CPU 热插拔实现系统调用
【发布时间】:2018-01-23 18:45:33
【问题描述】:

我的目标是在 linux 内核中实现一个系统调用来启用/禁用 CPU 内核。

首先,我实现了一个在 4 核系统中禁用 CPU3 的系统调用。

系统调用代码如下:

#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;
}

系统调用已在内核中正确注册,并且我在内核配置期间启用了“cpu hotplug”功能。看图

但是,内核在最后阶段编译失败,我得到了这个错误:

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

我做错了什么?

【问题讨论】:

    标签: linux linux-kernel arm kernel system-calls


    【解决方案1】:
    gzip: stdout: No space left on device
    

    此问题与您的代码无关。您的/boot 文件系统已满。

    【讨论】:

    • 感谢您的回答。我在树莓派 pi3/ModelB 上编译 linux。知道如何解决这个问题吗?
    • 您需要更多空间。我认为你应该在其他硬件上更好地编译内核。
    猜你喜欢
    • 2018-01-28
    • 2023-03-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多