-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lesson 10 homework #115
base: Vadym.Mishchuk
Are you sure you want to change the base?
Lesson 10 homework #115
Conversation
Signed-off-by: Vadym Mishchuk <[email protected]>
Signed-off-by: Vadym Mishchuk <[email protected]>
Signed-off-by: Vadym Mishchuk <[email protected]>
Signed-off-by: Vadym Mishchuk <[email protected]>
Signed-off-by: Vadym Mishchuk <[email protected]>
kthread_example/kthread_module.c
Outdated
#include <linux/kernel.h> | ||
#include <linux/kthread.h> | ||
#include <linux/sched.h> | ||
#include <linux/time.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use only required include headers
kthread_example/kthread_module.c
Outdated
@@ -47,6 +53,7 @@ void thread_cleanup(void) | |||
|
|||
if (!ret) | |||
pr_info("Kthread example: thread %d stopped\n", i); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Insignificant changes
kthread_example/kthread_module.c
Outdated
threads[i] = kthread_run(thread_fn, | ||
(void *)i, thread_format, i); | ||
threads[i] = kthread_run(thread_fn, | ||
(void *)i, thread_format, i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Insignificant changes
Please provide conclusions regarding spin lock and rt-mutex using. Thanks. |
Kernel module which creates thread with calls to kthread_create and kthread_run.
In different versions it uses rt-mutex or spinlock to protect critical section. All spawned threads will be killed during rmmod.