Skip to content
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

Open
wants to merge 5 commits into
base: Vadym.Mishchuk
Choose a base branch
from

Conversation

vad32m
Copy link

@vad32m vad32m commented Dec 27, 2018

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.

#include <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/sched.h>
#include <linux/time.h>
Copy link
Contributor

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

@@ -47,6 +53,7 @@ void thread_cleanup(void)

if (!ret)
pr_info("Kthread example: thread %d stopped\n", i);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Insignificant changes

threads[i] = kthread_run(thread_fn,
(void *)i, thread_format, i);
threads[i] = kthread_run(thread_fn,
(void *)i, thread_format, i);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Insignificant changes

@IevgenMaliarenko
Copy link
Contributor

Please provide conclusions regarding spin lock and rt-mutex using. Thanks.

@IevgenMaliarenko IevgenMaliarenko added OK The PR has been reviewed and (at least generally) accepted (set by reviewer). ready labels Jan 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OK The PR has been reviewed and (at least generally) accepted (set by reviewer).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants