2

I'm making a minimal Linux distro with buildroot to learn kernel module development.

If I call a minimal module hello.ko (or almost any other name I've tried), everything works fine.

However, if I use the exact same code, but call the module workqueue.ko, insmod workqueue.ko fails, dmesg contains:

workqueue: module is already loaded

and insmod outputs to stderr:

insmod: can't insert 'workqueue.ko': invalid argument

Both lsmod and cat /proc/modules are empty.

This is the exact repo that produced the problem.

For reference the module code is:

#include <linux/module.h>
#include <linux/kernel.h>

MODULE_LICENSE("GPL");

int init_module(void)
{
    printk(KERN_INFO "hello init\n");
    return 0;
}

void cleanup_module(void)
{
    printk(KERN_INFO "hello cleanup\n");
}

and the kernel version (default implied by buildroot) is 4.9.

GAD3R
  • 66,769
Ciro Santilli OurBigBook.com
  • 18,092
  • 4
  • 117
  • 102

1 Answers1

2
$ uname -a
Linux alan-laptop 4.10.14-200.fc25.x86_64 #1 SMP Wed May 3 22:52:30 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ ls /sys/module/workqueue/
parameters  uevent
$ ls /sys/module/workqueue/parameters/
debug_force_rr_cpu  disable_numa  power_efficient

It's a builtin already. Maybe to provide a namespace for the parameters that effect kernel workqueue behaviour.

sourcejedi
  • 50,249