All of lore.kernel.org
 help / color / mirror / Atom feed
* Periodic Scheduler in Kernel Space
@ 2020-11-06 16:30 Lakshmi Dhanaraj
  2020-11-09 17:32 ` Jan Kiszka
  0 siblings, 1 reply; 2+ messages in thread
From: Lakshmi Dhanaraj @ 2020-11-06 16:30 UTC (permalink / raw)
  To: sunshilong, : 孙世龙 sunshilong via Xenomai

Hi Sunshilong,

I need to create a 12.5ms periodic scheduler in Xenomai(v3.0.5) Kernel
Space on Linux Kernel 4.9.38 under Ubuntu 18.04.1 LTS.Inside my scheduler I
have multiple semaphore down functions to wait for the response from
multiple threads.

1.I created a periodic task using rtdm_task_init() and
rtdm_task_wait_period() with task priority of 90.It is working fine without
any overruns for a while and my system is getting hanged if I tries to open
system monitor Window.May I know why and I need to set any cpu affinity to
the scheduler thread?But in the driver implementation,for CPU affinity is
setted as CPU_MASK_ALL by default.

2.Tried another way using kthread_create() along with hrtimer_create().In
hrtimer callback function,I am not able to use semaphore down func since it
acts like an interrupt.So I created a separate thread in which my sem_downs
are added and waiting for another semaphore trigger from hrtimer callback()
function.
But here the semaphore trigger from the hrtimer exceeds 12.5 ms upto 18ms
under load.

The issue is that in my first case,the timings are ok but the system
hangs,in my second case system not hanging but timing exceeds.

I verified the timings of both the cases by increasing CPU Load using
"taskset -c (0...7) yes" and stress.Is this the correct way to verify the
stability of my scheduler in kernel space?

I was struck with this problem for more than a week, please help me out to
solve the issue as soon as possible.Awaiting for your reply.






With Thanks & Regards,

Lakshmi.D

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Periodic Scheduler in Kernel Space
  2020-11-06 16:30 Periodic Scheduler in Kernel Space Lakshmi Dhanaraj
@ 2020-11-09 17:32 ` Jan Kiszka
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2020-11-09 17:32 UTC (permalink / raw)
  To: Lakshmi Dhanaraj, sunshilong,
	: 孙世龙 sunshilong via Xenomai


On 06.11.20 17:30, Lakshmi Dhanaraj via Xenomai wrote:
> Hi Sunshilong,
> 
> I need to create a 12.5ms periodic scheduler in Xenomai(v3.0.5) Kernel
> Space on Linux Kernel 4.9.38 under Ubuntu 18.04.1 LTS.Inside my scheduler I
> have multiple semaphore down functions to wait for the response from
> multiple threads.

Why kernel space? It's easy to crash the system from there, you can't
write proprietary code there, it's likely not the place you want to be.

Jan

> 
> 1.I created a periodic task using rtdm_task_init() and
> rtdm_task_wait_period() with task priority of 90.It is working fine without
> any overruns for a while and my system is getting hanged if I tries to open
> system monitor Window.May I know why and I need to set any cpu affinity to
> the scheduler thread?But in the driver implementation,for CPU affinity is
> setted as CPU_MASK_ALL by default.
> 
> 2.Tried another way using kthread_create() along with hrtimer_create().In
> hrtimer callback function,I am not able to use semaphore down func since it
> acts like an interrupt.So I created a separate thread in which my sem_downs
> are added and waiting for another semaphore trigger from hrtimer callback()
> function.
> But here the semaphore trigger from the hrtimer exceeds 12.5 ms upto 18ms
> under load.
> 
> The issue is that in my first case,the timings are ok but the system
> hangs,in my second case system not hanging but timing exceeds.
> 
> I verified the timings of both the cases by increasing CPU Load using
> "taskset -c (0...7) yes" and stress.Is this the correct way to verify the
> stability of my scheduler in kernel space?
> 
> I was struck with this problem for more than a week, please help me out to
> solve the issue as soon as possible.Awaiting for your reply.
> 
> 
> With Thanks & Regards,
> 
> Lakshmi.D
> 


-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-09 17:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-06 16:30 Periodic Scheduler in Kernel Space Lakshmi Dhanaraj
2020-11-09 17:32 ` Jan Kiszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.