SMP driver core lock real-time driver

Doug Renton <[email protected]> Mon, 13 Nov 2017 23:26:26 -0500
Newsgroups gmane.linux.real-time.rtai
Message-ID <[email protected]>
I am wondering about how to create a "real-time" thread, or the simplest 
way to get something "real-time".
I generally need one or two real-time threads, one at 2-5Khz (or 
faster), and one at ~100Hz.
I've not considered the options for a long time, but I'm looking at my 
computer's specs, and at new computers, and I see they all now have many 
cores, 6/12 and even 18. Each core apparently has it's own fpu.
I generally communicate through a large chunk of shared memory (~1Gb 
reserved at boot time), with the front end, very simple.
Before I waste a bunch of time, I would like to get some opinions/advice 
on my idea. What I want to do is make a device driver, (or two) that 
never exits, that disables preemption, and reserves it's FPU. Since 
there are so many cores the kernel and user space tasks can run on other 
cores. The device driver (real-time task) will just busy wait/watch a 
clock or external trigger to determine when to run again.

The main details seem to be:

  preempt_disable() will keep preemption from happening
  preempt_enable() will make it possible again
  compile hardware floating-point capabilities into your module (with 
-mhard-float)
     and use two kernel functions kernel_fpu_begin() and kernel_fpu_end()

So should this work? What am I missing?

Doug
_______________________________________________
Rtai mailing list
[email protected]
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai