Re: [PATCH v7 17/23] sched: Initial sched_football test implementation

John Stultz
2024-01-05T05:22:24Z

On Thu, Dec 28, 2023 at 7:19 AM Metin Kaya <metin.kaya@arm.com> wrote:
> On 20/12/2023 12:18 am, John Stultz wrote:
> > +static int __init test_sched_football_init(void)
> > +{
> > + struct task_struct *kth;
> > + int i;
> > +
> > + players_per_team = num_online_cpus();
> > +
> > + mutex_low_list = kmalloc_array(players_per_team, sizeof(struct mutex), GFP_ATOMIC);
> > + mutex_mid_list = kmalloc_array(players_per_team, sizeof(struct mutex), GFP_ATOMIC);
> > +
> > + for (i = 0; i < players_per_team; i++) {
> > + mutex_init(&mutex_low_list[i]);
> > + mutex_init(&mutex_mid_list[i]);
> > + }
> > +
> > + kth = create_fifo_thread(ref_thread, (void *)10, "ref-thread", 20);
> > +
> > + return 0;
> > +}
> > +module_init(test_sched_football_init);
>
> Hit `modpost: missing MODULE_LICENSE() in
> kernel/sched/test_sched_football.o` error when I build this module.
>
> JFYI: the module does not have MODULE_NAME(), MODULE_DESCRIPTION(),
> MODULE_AUTHOR(), module_exit(), ... as well.

Good point. I've only been using it as a built-in.
Added all of those except for module_exit() for now, as I don't want
it to be unloaded while the kthreads are running.

thanks
-john