BBB + PREEMPT_RT

Notice how the github account says "RobertCNelson"? Your welcome to
fork that project and push kernel/image with your modifications. I'm
not psychically forcing my config choices down people's throat.
Everything is setup to easily allow you to rebuild/modify/etc
everything. Maybe I just give too many options. So I have my reasons
for leaving PREEMPT disabled by default and on an old tested v3.8
kernel, the last thing i'm going to do is radically change the config.
To much of a risk on a kernel in maintenance only mode at this point.

Regards,

Those are pretty good numbers. Did you have heavy network and disk
(uSD/eMMC) load going as well? IIRC, the uSD/eMMC driver was
responsible for the worst of the latency spikes I saw, but that's been
some time ago and based on the OMAP kernel list traffic, it appears
there have been lots of improvements to that code.

The stress tool generates cpu load only. But it is a good idea to consider other load scenarios, too. The current test was done using ssh so there was at least some network activity. Do you know of a good test tool which allows to generate disk and network load?

I fully understand why it is a bad idea to change the defaul kernel configuration for kernel 3.8. But I think it might be possible to consider such a change for kernel 3.12 or a future kernel version. I’m sure there are lots of people out there who would like that.

Xenomai includes a "dohell" script that can generate disk and network
load. You can always just "dd" to a file for a while.

If you're running a Debian/Ubuntu based system, I've found that running
"aptitude upgrade" if you have a few dated packages can be a major
stress to the system. That gets you both network and disk load, and not
so long ago had a decent chance of wedging the eMMC kernel driver (even
without the Xenomai patches that 'tickled' the eMMC driver bug and made
it more likely to happen).

Opening GUI programs and moving windows around is another good stress.

Interesting result. Would be nice to see a histogram. I will try and duplicate this measurement. Also doing the some measure with the standard kernel would be informative.

That upper tail of 132 is a big problem for me.

Thanks for you tips. I am using a minimal Ubuntu system without a full desktop that is based on http://www.armhf.com/index.php/boards/beaglebone-black/#precise. I used apt-get to update the system. The integrated eMMC and HDMI are deactivated.

To create a network stress I used Ubuntu’s iperf in server mode from another ssh shell while running stress and cyclictest at the same time. The transfer rate to another Ubuntu box reached 94.7 MBit/s and > 100MB were copied. The latency numbers did not change.

Hi ,all. I had been reading this thread of PREEMPT_RT for a few days.
(I miss the starting mails since I can't get to the web page of google groups)

For my situation, I just need my userspace program run once every 1ms sys tick.
The result will be writed to a fifo in FPGA to achive realtime IO control.

Can this be achive by eanbling PREEMPT ? any other works need?

======== 2014-02-28 16:53:26 您在来信中写道: ========

Thanks for you tips. I am using a minimal Ubuntu system without a full desktop that is based on http://www.armhf.com/index.php/boards/beaglebone-black/#precise. I used apt-get to update the system. The integrated eMMC and HDMI are deactivated.

To create a network stress I used Ubuntu's iperf in server mode from another ssh shell while running stress and cyclictest at the same time. The transfer rate to another Ubuntu box reached 94.7 MBit/s and > 100MB were copied. The latency numbers did not change.

Xenomai includes a "dohell" script that can generate disk and network
load. You can always just "dd" to a file for a while.

If you're running a Debian/Ubuntu based system, I've found that running
"aptitude upgrade" if you have a few dated packages can be a major
stress to the system. That gets you both network and disk load, and not
so long ago had a decent chance of wedging the eMMC kernel driver (even
without the Xenomai patches that 'tickled' the eMMC driver bug and made
it more likely to happen).

Opening GUI programs and moving windows around is another good stress.

There are two repos on github which are related to the BBB kernel. It seems that you are active in both of theses repositories.I have always used https://github.com/beagleboard/kernel. But there’s another repo at https://github.com/RobertCNelson/linux-dev. What exactly is the difference between these repos?

The default kernel configuration for kernel 3.8 from https://github.com/beagleboard/kernel is at https://github.com/beagleboard/kernel/blob/3.8/configs/beaglebone. In order to allow people to build a PREEMPT capable version we could simply provide a second kernel configuration. The name could be beaglebone_preempt. This way you wouldn’t have to change the default configuration. On the other hand this would allow people to quickly evaluate the PREEMPT version and have at least some basic determinism.

I have attached my modified kernel configuration. I am currently doing further tests.

beaglebone_preempt.zip (23.9 KB)

I did a test using the latest kernel from https://github.com/beagleboard/kernel/blob/3.8/configs/beaglebone and the kernel configuration I posted this morning. To load the cpu I used stress --cpu 1 & cyclictest -l10000000 -m -n -t1 -p99 -i400 -h400 -q. I have attached the output of cyclictest and an image with the latency histogram.

The maximum latency is now at 262 µs. However, only about 0.2% of the samples are at t>=36 µs. It is clear that a kernel with the simple PREEMPT option is not as good as one with the PREEMPT_RT option. But it is definitely much better than a default kernel without any preemption enabled.

hist_10m_cpu.txt (5.68 KB)

hist_10m_cpu.jpg

I have lately also unsuccessfully tried to install RT_PREEMPT on BBB.

What I have done until now (and failed) is:

A.

  1. Get the sources from here: https://github.com/beagleboard/kernel/tree/3.8-rt
  2. Before make command, enable Full Preemption under kernel features options.
  3. Compile. When testing on BBB, the kernel doesn’t boot.

B.

  1. Get the sources from here: https://github.com/RobertCNelson/linux-dev/tree/am33x-v3.8
  2. ./build_kernel.sh
  3. Download the rt patch from here: https://www.kernel.org/pub/linux/kernel/projects/rt/3.8/patch-3.8.13.14-rt27.patch.bz2 into KERNEL folder
  4. patch p1 < patch-3.8.13.14-rt27.patch
  5. From here, it turned a little bit weird since approximately 21 HUNKS failed. Reading this post: https://groups.google.com/forum/#!topic/beagleboard/aAufDe13SeQ then I re-edited the .patch file taking away the modifications in cpsw.h and cpsw.c (lines 5825 to 7346 from .patch file).
  6. Then repeated steps 1 through 4 again, but using the edited patch.
  7. Use menuconfig to activate Full-Preemption.
  8. ./tools/rebuild.sh
  9. ./tools/install_kernel.sh (with the modifications in the system.sh file)
  10. Plug the SD card in the BBB. and it never booted.

I have seen the osadl 3.8.12 kernel, but I’m more interested in using the 3.8.13 kernel.

If anyone could give away any ideas, I would be really grateful.

Thank you for your time.

I have never heard of a PREEMPT_RT capable kernel for the BBB besides that from OSADL. I have recently had a conversation with Robert C. Nelson. He told me, that kernel 3.8 has problems and did never support PREEMPT_RT. The 3.8-rt branch is no longer in development. Officially, the BBB does not even support simple PREEMPT.

So I guess your only chance is the OSADL kernel. The current version is 3.12.13-rt21. It seems to work. But there are issues with GPMC. I have created a new thread on this topic here: https://groups.google.com/forum/#!category-topic/beagleboard/beaglebone-black/uac_Zh41LYo.

I tried PREEMPT yesterday on 3.12.9 and the ethernet seemed to work. The only thing I had a problem with was USB host.
It failed the probe().

So I reverted. Years ago I filed a bug report with TI regarding the ethernet driver not working with PREEMPT in kernel 3.2.
Some progress has been made, ethernet seemed to work now on 3.12.9.

Dick

Hi thats great!

Is that possible to have your compiled kernel for BBB? I would avoid the compiling process.
Thanks a lot,

Morteza

It’s really nice to see that there is some interest in having a PREEMPT/PREEMPT_RT capable kernel for the BBB.

Well, it’s relatively easy to compile a kernel. If you want to develop applications for the BBB you need a compiler/toolchain. So I guess you might have that already. The instructions to compile a kernel are explained at https://github.com/beagleboard/kernel/tree/3.8.

I could send you my modified kernel configuration. You simply have the replace the original kernel configuration to create the PREEMPT capable kernel.

hi,quikcjack. I had been fallowing the topic for some dates.

I plan to build a CNC controler with BBBlack.
I want to get your kernel config to make a PREEMPT/PREEMPT_RT capable kernel too.

whould you please seem me your kernel confiuration too? Thanks.

======== 2014-03-19 16:47:58 : ========



> It’s really nice to see that there is some interest in having a PREEMPT/PREEMPT_RT capable kernel for the BBB.
>
> Well, it’s relatively easy to compile a kernel. If you want to develop applications for the BBB you need a compiler/toolchain. So I guess you might have that already. The instructions to compile a kernel are explained at https://github.com/beagleboard/kernel/tree/3.8.
>
> I could send you my modified kernel configuration. You simply have the replace the original kernel configuration to create the PREEMPT capable kernel.
>
> Am Freitag, 14. März 2014 13:03:51 UTC+1 schrieb mhfar...@gmail.com:
>
> > Hi thats great!
> >
> > Is that possible to have your compiled kernel for BBB? I would avoid the compiling process.
> > Thanks a lot,
> >
> > Morteza
> >
> > Am Mittwoch, 26. Februar 2014 14:53:05 UTC+1 schrieb quik...@gmail.com:
> >
> > > I have recently tested kernel 3.8.13-rt9 (https://github.com/beagleboard/kernel/tree/3.8-rt) using git://git.kernel.org/pub/scm/linux/kernel/git/clrkwllms/rt-tests.git. I am using Ubuntu 12.04.4. The load was created using stress –cpu 1 which generates a cpu load of about 100%. I then used cyclictest:
> > >
> > > root@ubuntu-armhf:/home/ubuntu/rt-tests# ./cyclictest -l1000000 -m -n -t1 -p99 -i400 -q
> > >
> > > # /dev/cpu_dma_latency set to 0us
> > >
> > > T: 0 ( 770) P:99 I:400 C:1000000 Min: 14 Act: 19 Avg: 18 Max: 132
> > >
> > > uname -a reports:
> > >
> > > root@ubuntu-armhf:/home/ubuntu/rt-tests# uname -a
> > >
> > > Linux ubuntu-armhf 3.8.13-rt9-00899-g160e771 #1 SMP PREEMPT Wed Jun 19 10:49:36 CEST 2013 armv7l armv7l armv7l GNU/Linux
> > >
> > > I am absolutely surprised that the result is looking that good.
> > >
> > > Am Freitag, 21. Februar 2014 09:20:39 UTC+1 schrieb quik...@gmail.com:
> > >
> > > > I am trying to figure out how to create a kernel for the BBB that supports PREEMPT_RT. It’s kind of strange that the BBB’s default kernel does not even have PREEMPT activated. Such a board doesn’t fit to many embedded applications where we need at least some kind of determinism. It is even worse, that nobody seems to care about this problem. Contrary to that, the Raspberry PI’s standard kernel has PREEMPT activacted from the very beginning.
> > > >
> > > > I have tested Robert Nelsons kernel 3.8.13-r9 (https://github.com/beagleboard/kernel/tree/3.8-rt). It does not have PREEMPT_RT activated by default. When doing so, it does not boot. But activating PREEMPT does work. However, development of this branch has stopped several months ago. The official source for RT Linux (3.8.13) has evolved since then. Meanwhile there’s an rt17 patch set (https://www.kernel.org/pub/linux/kernel/projects/rt/3.8/). Did anybody give this a try? Does it work with the BBB?
>
> –
> For more options, visit http://beagleboard.org/discuss
> —
> You received this message because you are subscribed to the Google Groups “BeagleBoard” group.
> To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
> 在此邮件中未发现病毒。
> 检查工具:AVG - www.avg.com
> 版本:2013.0.3462 / 病毒数据库:3722/7208 - 发布日期:03/17/14

|

  • |

= = = = = = = = = = = = = = = = = = = = = =


礼!

winglion
winglion1@163.com
2014-03-19

Sorry for my late answer. I have posted my kernel configuration on March 5. Please take a close look at my postings. You mave have to log in to google to see the attachments.

quikcjack!

Oh, thanks! I will try to get it later. I had allways use email to read this board,
since I am form mainland China and can’t access this board form web page. :frowning:
Any way, thansk for your work and help.

======== 2014-04-04 23:08:32 您在来信中写道: ========

Sorry for my late answer. I have posted my kernel configuration on March 5. Please take a close look at my postings. You mave have to log in to google to see the attachments.

hi,quikcjack. I had been fallowing the topic for some dates.

I plan to build a CNC controler with BBBlack.
I want to get your kernel config to make a PREEMPT/PREEMPT_RT capable kernel too.

whould you please seem me your kernel confiuration too? Thanks.

======== 2014-03-19 16:47:58 : ========

It’s really nice to see that there is some interest in having a PREEMPT/PREEMPT_RT capable kernel for the BBB.

Well, it’s relatively easy to compile a kernel. If you want to develop applications for the BBB you need a compiler/toolchain. So I guess you might have that already. The instructions to compile a kernel are explained at https://github.com/beagleboard/kernel/tree/3.8.

I could send you my modified kernel configuration. You simply have the replace the original kernel configuration to create the PREEMPT capable kernel.

Hi thats great!

Is that possible to have your compiled kernel for BBB? I would avoid the compiling process.
Thanks a lot,

Morteza

I have recently tested kernel 3.8.13-rt9 (https://github.com/beagleboard/kernel/tree/3.8-rt) using git://git.kernel.org/pub/scm/linux/kernel/git/clrkwllms/rt-tests.git. I am using Ubuntu 12.04.4. The load was created using stress –cpu 1 which generates a cpu load of about 100%. I then used cyclictest:

root@ubuntu-armhf:/home/ubuntu/rt-tests# ./cyclictest -l1000000 -m -n -t1 -p99 -i400 -q

/dev/cpu_dma_latency set to 0us

T: 0 ( 770) P:99 I:400 C:1000000 Min: 14 Act: 19 Avg: 18 Max: 132

uname -a reports:

root@ubuntu-armhf:/home/ubuntu/rt-tests# uname -a

Linux ubuntu-armhf 3.8.13-rt9-00899-g160e771 #1 SMP PREEMPT Wed Jun 19 10:49:36 CEST 2013 armv7l armv7l armv7l GNU/Linux

I am absolutely surprised that the result is looking that good.

I am trying to figure out how to create a kernel for the BBB that supports PREEMPT_RT. It’s kind of strange that the BBB’s default kernel does not even have PREEMPT activated. Such a board doesn’t fit to many embedded applications where we need at least some kind of determinism. It is even worse, that nobody seems to care about this problem. Contrary to that, the Raspberry PI’s standard kernel has PREEMPT activacted from the very beginning.

I have tested Robert Nelsons kernel 3.8.13-r9 (https://github.com/beagleboard/kernel/tree/3.8-rt). It does not have PREEMPT_RT activated by default. When doing so, it does not boot. But activating PREEMPT does work. However, development of this branch has stopped several months ago. The official source for RT Linux (3.8.13) has evolved since then. Meanwhile there’s an rt17 patch set (https://www.kernel.org/pub/linux/kernel/projects/rt/3.8/). Did anybody give this a try? Does it work with the BBB?


For more options, visit http://beagleboard.org/discuss

You received this message because you are subscribed to the Google Groups “BeagleBoard” group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

在此邮件中未发现病毒。
检查工具:AVG - www.avg.com
版本:2013.0.3462 / 病毒数据库:3722/7208 - 发布日期:03/17/14

= = = = = = = = = = = = = = = = = = = = = =


礼!

winglion
wing...@163.com
2014-03-19


For more options, visit http://beagleboard.org/discuss

You received this message because you are subscribed to the Google Groups “BeagleBoard” group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

= = = = = = = = = = = = = = = = = = = = = =


礼!

Yang
winglion1@163.com
2014-07-01