As you know by now, the kernel is most certainly not a process nor a thread. Having said that, the kernel does contain kernel threads; like their user space counterparts, kernel threads can be created as required (from within the core kernel, a device driver, a kernel module). They are schedulable entities (KSEs!) and, of course, each of them has a task structure; thus, their scheduling policy and priority can be queried or set as required..
So, to the point at hand: to set the scheduling policy and/or priority of a kernel thread, the kernel typically makes use of the kernel/sched/core.c:sched_setscheduler_nocheck() (GFP exported) kernel API; here, we show its signature and an example of its typical usage; the comments that follow make it quite self-explanatory:
// kernel/sched/core.c
/**
* sched_setscheduler_nocheck - change the scheduling policy and/or RT priority of a thread from kernelspace.
* @p: the task...