* Preempt-rt kernel build for beagleboard
@ 2012-11-27 10:23 Yu Pan
2012-11-27 15:24 ` Bruce Ashfield
0 siblings, 1 reply; 6+ messages in thread
From: Yu Pan @ 2012-11-27 10:23 UTC (permalink / raw)
To: yocto
[-- Attachment #1: Type: text/plain, Size: 1771 bytes --]
I started looking at Yocto 2 weeks back. Despite the complexity in kernel
building, I found it quite hard to locate information on preempt-rt build.
I was trying to build linux-yocto-rt for beagleboard from "danny" and the
linux-yocto-3.4 kernel, and it seems to be working. I'd like to share how
one can do that in this thread.
Since the kernel does not include an official preempt-rt branch for
beagleboard yet, I choose to directly use the standard/preempt-rt/base
branch. I guess this should work for the preempt-rt kernel, from the fact
that the standard kernel (non preempt-rt) used for beagleboard from the
standard/beagleboard branch is basically identical to that from the
standard/base branch.
Here is what I did.
1. Under poky/meta-yocto-bsp/recipes-kernel/linux, I added a
linux-yocto-rt_3.4.bbappend recipe containing the following lines. The
SRCREV value used is the same as the one in the base
linux-yocto-rt_3.4.bbunder poky/meta/recipes/kernel.
KBRANCH_beagleboard = "standard/preempt-rt/base"
SRCREV_machine_beagleboard ?= "5705c8037d2c47938034ead87c70ae3ebef552f7"
COMPATIBLE_MACHINE_beagleboard = "beagleboard"
2. Modified the PREFERRED_PROVIDER_virtual/kernel variable in
poky/meta-yocto-bsp/conf/machine/beagleboard.conf to "linux-yocto-rt".
3. "bitbake linux-yocto-rt -c menuconfig" to set the Preemption Model to
"Fully Preemptible Kernel (RT)".
4. "bitbake linux-yocto-rt"
5. "bitbake core-image-rt" which includes some realtime test programs on
top of core-image-minimal.
I did some cyclictest on beagleboard using the generated kernel and image
with "/usr/bin/cyclictest -p95 -m". The results did show huge improvement
on max latency especially under load.
Hope it helps.
Cheers
Pan Yu
[-- Attachment #2: Type: text/html, Size: 2753 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Preempt-rt kernel build for beagleboard
2012-11-27 10:23 Preempt-rt kernel build for beagleboard Yu Pan
@ 2012-11-27 15:24 ` Bruce Ashfield
2012-11-28 6:07 ` Yu Pan
0 siblings, 1 reply; 6+ messages in thread
From: Bruce Ashfield @ 2012-11-27 15:24 UTC (permalink / raw)
To: Yu Pan; +Cc: yocto
On 12-11-27 05:23 AM, Yu Pan wrote:
> I started looking at Yocto 2 weeks back. Despite the complexity in
> kernel building, I found it quite hard to locate information on
> preempt-rt build. I was trying to build linux-yocto-rt for beagleboard
> from "danny" and the linux-yocto-3.4 kernel, and it seems to be working.
> I'd like to share how one can do that in this thread.
>
> Since the kernel does not include an official preempt-rt branch for
> beagleboard yet, I choose to directly use the standard/preempt-rt/base
> branch. I guess this should work for the preempt-rt kernel, from the
> fact that the standard kernel (non preempt-rt) used for beagleboard from
> the standard/beagleboard branch is basically identical to that from the
> standard/base branch.
Correct. If you don't have any board specific patches, working with
an existing branch in the tree is fine.
>
> Here is what I did.
> 1. Under poky/meta-yocto-bsp/recipes-kernel/linux, I added a
> linux-yocto-rt_3.4.bbappend recipe containing the following lines. The
> SRCREV value used is the same as the one in the base
> linux-yocto-rt_3.4.bb <http://linux-yocto-rt_3.4.bb> under
> poky/meta/recipes/kernel.
>
> KBRANCH_beagleboard = "standard/preempt-rt/base"
> SRCREV_machine_beagleboard ?= "5705c8037d2c47938034ead87c70ae3ebef552f7"
> COMPATIBLE_MACHINE_beagleboard = "beagleboard"
Also note that the yocto-bsp tool allows the extension of an existing
BSP or kernel to a new board. It should provide some of what you
did via editing the files, I added TomZ in case I've misspoken about
what the tools do in this area.
But what you have above is correct.
>
> 2. Modified the PREFERRED_PROVIDER_virtual/kernel variable in
> poky/meta-yocto-bsp/conf/machine/beagleboard.conf to "linux-yocto-rt".
>
> 3. "bitbake linux-yocto-rt -c menuconfig" to set the Preemption Model to
> "Fully Preemptible Kernel (RT)".
You shouldn't have needed to do this part, since the board already has
a preempt-rt BSP description:
http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-3.4/tree/meta/cfg/kernel-cache/bsp/beagleboard/beagleboard-preempt-rt.scc?h=meta
And when you build the linux-yocto-rt kernel with that board, that
description should be found, and it enables all the base options already.
If you look in your build, what does the file 'linux/meta/top_tgt'
contain ?
Cheers,
Bruce
>
> 4. "bitbake linux-yocto-rt"
>
> 5. "bitbake core-image-rt" which includes some realtime test programs on
> top of core-image-minimal.
>
> I did some cyclictest on beagleboard using the generated kernel and
> image with "/usr/bin/cyclictest -p95 -m". The results did show huge
> improvement on max latency especially under load.
>
> Hope it helps.
>
> Cheers
> Pan Yu
>
>
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Preempt-rt kernel build for beagleboard
2012-11-27 15:24 ` Bruce Ashfield
@ 2012-11-28 6:07 ` Yu Pan
2012-11-28 14:27 ` Bruce Ashfield
2012-11-28 17:58 ` Bruce Ashfield
0 siblings, 2 replies; 6+ messages in thread
From: Yu Pan @ 2012-11-28 6:07 UTC (permalink / raw)
To: Bruce Ashfield; +Cc: yocto
[-- Attachment #1: Type: text/plain, Size: 1594 bytes --]
Hi Bruce,
Thanks for commenting :-)
You shouldn't have needed to do this part, since the board already has
> a preempt-rt BSP description:
>
> http://git.yoctoproject.org/**cgit/cgit.cgi/linux-yocto-3.4/**
> tree/meta/cfg/kernel-cache/**bsp/beagleboard/beagleboard-**
> preempt-rt.scc?h=meta<http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-3.4/tree/meta/cfg/kernel-cache/bsp/beagleboard/beagleboard-preempt-rt.scc?h=meta>
>
> And when you build the linux-yocto-rt kernel with that board, that
> description should be found, and it enables all the base options already.
>
> If you look in your build, what does the file 'linux/meta/top_tgt'
> contain ?
>
This was what puzzles me as well. I thought bitbake should pickup what is
specified in beagleboard-preempt-rt.scc to produce the .config in the
kernel build directory. But it did not, at least for the PREEMPT part.
Below is the PREEMPT related configs in the .config without manually doing
the menuconfig:
# CONFIG_PREEMPT_RCU is not set
CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT__LL is not set
# CONFIG_PREEMPT_RTB is not set
# CONFIG_PREEMPT_RT_FULL is not set
Follow your pointer, I checked linux/meta/top_tgt, it indeed points to
meta/cfg/kernel-cache/bsp/beagleboard/beagleboard-preempt-rt.scc, which
includes ktypes/preempt-rt (why not ktypes/preempt-rt.scc?). In
ktypes/preempt-rt.cfg (included by ktypes/preempt-rt.scc),
CONFIG_PREEMPT_RT_FULL=y is there. So why not this configuration fragment
not picked up in the final .config?
Cheers
Pan Yu
[-- Attachment #2: Type: text/html, Size: 2118 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Preempt-rt kernel build for beagleboard
2012-11-28 6:07 ` Yu Pan
@ 2012-11-28 14:27 ` Bruce Ashfield
2012-11-28 17:58 ` Bruce Ashfield
1 sibling, 0 replies; 6+ messages in thread
From: Bruce Ashfield @ 2012-11-28 14:27 UTC (permalink / raw)
To: Yu Pan; +Cc: yocto
On 12-11-28 01:07 AM, Yu Pan wrote:
> Hi Bruce,
>
> Thanks for commenting :-)
>
> You shouldn't have needed to do this part, since the board already has
> a preempt-rt BSP description:
>
> http://git.yoctoproject.org/__cgit/cgit.cgi/linux-yocto-3.4/__tree/meta/cfg/kernel-cache/__bsp/beagleboard/beagleboard-__preempt-rt.scc?h=meta
> <http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-3.4/tree/meta/cfg/kernel-cache/bsp/beagleboard/beagleboard-preempt-rt.scc?h=meta>
>
> And when you build the linux-yocto-rt kernel with that board, that
> description should be found, and it enables all the base options
> already.
>
> If you look in your build, what does the file 'linux/meta/top_tgt'
> contain ?
>
>
> This was what puzzles me as well. I thought bitbake should pickup what
It's the kern-tools that find the .scc file based on information passed
in from bitbake, in this case, the board name and the kernel type.
> is specified in beagleboard-preempt-rt.scc to produce the .config in the
> kernel build directory. But it did not, at least for the PREEMPT part.
> Below is the PREEMPT related configs in the .config without manually
> doing the menuconfig:
>
> # CONFIG_PREEMPT_RCU is not set
> CONFIG_PREEMPT_NONE=y
> # CONFIG_PREEMPT_VOLUNTARY is not set
> # CONFIG_PREEMPT__LL is not set
> # CONFIG_PREEMPT_RTB is not set
> # CONFIG_PREEMPT_RT_FULL is not set
>
> Follow your pointer, I checked linux/meta/top_tgt, it indeed points to
> meta/cfg/kernel-cache/bsp/beagleboard/beagleboard-preempt-rt.scc, which
And this means that the right one was found.
> includes ktypes/preempt-rt (why not ktypes/preempt-rt.scc?). In
> ktypes/preempt-rt.cfg (included by ktypes/preempt-rt.scc),
> CONFIG_PREEMPT_RT_FULL=y is there. So why not this configuration
> fragment not picked up in the final .config?
It should always make it into the final .config, are you working on
master ? I'll run my own tests here to see if I can reproduce the
failure. Master should also have a better Kconfig audit report, are
you seeing any messages about Kconfig options being dropped ?
Cheers,
Bruce
>
> Cheers
> Pan Yu
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Preempt-rt kernel build for beagleboard
2012-11-28 6:07 ` Yu Pan
2012-11-28 14:27 ` Bruce Ashfield
@ 2012-11-28 17:58 ` Bruce Ashfield
2012-11-29 2:43 ` Yu Pan
1 sibling, 1 reply; 6+ messages in thread
From: Bruce Ashfield @ 2012-11-28 17:58 UTC (permalink / raw)
To: Yu Pan; +Cc: yocto
On 12-11-28 01:07 AM, Yu Pan wrote:
> Hi Bruce,
>
> Thanks for commenting :-)
>
> You shouldn't have needed to do this part, since the board already has
> a preempt-rt BSP description:
>
> http://git.yoctoproject.org/__cgit/cgit.cgi/linux-yocto-3.4/__tree/meta/cfg/kernel-cache/__bsp/beagleboard/beagleboard-__preempt-rt.scc?h=meta
> <http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-3.4/tree/meta/cfg/kernel-cache/bsp/beagleboard/beagleboard-preempt-rt.scc?h=meta>
>
> And when you build the linux-yocto-rt kernel with that board, that
> description should be found, and it enables all the base options
> already.
>
> If you look in your build, what does the file 'linux/meta/top_tgt'
> contain ?
>
>
> This was what puzzles me as well. I thought bitbake should pickup what
> is specified in beagleboard-preempt-rt.scc to produce the .config in the
> kernel build directory. But it did not, at least for the PREEMPT part.
> Below is the PREEMPT related configs in the .config without manually
> doing the menuconfig:
>
> # CONFIG_PREEMPT_RCU is not set
> CONFIG_PREEMPT_NONE=y
> # CONFIG_PREEMPT_VOLUNTARY is not set
> # CONFIG_PREEMPT__LL is not set
> # CONFIG_PREEMPT_RTB is not set
> # CONFIG_PREEMPT_RT_FULL is not set
>
> Follow your pointer, I checked linux/meta/top_tgt, it indeed points to
> meta/cfg/kernel-cache/bsp/beagleboard/beagleboard-preempt-rt.scc, which
> includes ktypes/preempt-rt (why not ktypes/preempt-rt.scc?). In
> ktypes/preempt-rt.cfg (included by ktypes/preempt-rt.scc),
> CONFIG_PREEMPT_RT_FULL=y is there. So why not this configuration
> fragment not picked up in the final .config?
Mystery solved. The fragment is picked up properly in the build and
everything is operating as expected.
We had an old commit (that is still required for some configurations)
that disabled preemption for the beagleboard due to SD card boot
issues.
That being said, the entire point of trying out preempt-rt is for the
extra preemption, and without it, why bother. So I moved the preempt
disable to the standard kernel only in this commit:
http://git.yoctoproject.org/cgit/cgit.cgi/yocto-kernel-cache/commit/?id=551c7ad8c46d371c6b135357ed2d388d45af13d8
Once I update the SRCREVs for the meta branch of the linux-yocto-3.4
tree, you'll get the expected preempt settings out of the box:
> grep PREEMPT linux-beagleboard-preempt-rt-build/.config
CONFIG_TINY_PREEMPT_RCU=y
CONFIG_PREEMPT_RCU=y
CONFIG_PREEMPT=y
CONFIG_PREEMPT_RT_BASE=y
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT__LL is not set
# CONFIG_PREEMPT_RTB is not set
CONFIG_PREEMPT_RT_FULL=y
CONFIG_PREEMPT_COUNT=y
CONFIG_DEBUG_PREEMPT=y
# CONFIG_PREEMPT_TRACER is not set
Cheers,
Bruce
>
> Cheers
> Pan Yu
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Preempt-rt kernel build for beagleboard
2012-11-28 17:58 ` Bruce Ashfield
@ 2012-11-29 2:43 ` Yu Pan
0 siblings, 0 replies; 6+ messages in thread
From: Yu Pan @ 2012-11-29 2:43 UTC (permalink / raw)
To: Bruce Ashfield; +Cc: yocto
[-- Attachment #1: Type: text/plain, Size: 1729 bytes --]
On Thu, Nov 29, 2012 at 1:58 AM, Bruce Ashfield <
bruce.ashfield@windriver.com> wrote:
Mystery solved. The fragment is picked up properly in the build and
> everything is operating as expected.
>
> We had an old commit (that is still required for some configurations)
> that disabled preemption for the beagleboard due to SD card boot
> issues.
>
> That being said, the entire point of trying out preempt-rt is for the
> extra preemption, and without it, why bother. So I moved the preempt
> disable to the standard kernel only in this commit:
>
> http://git.yoctoproject.org/**cgit/cgit.cgi/yocto-kernel-**
> cache/commit/?id=**551c7ad8c46d371c6b135357ed2d38**8d45af13d8<http://git.yoctoproject.org/cgit/cgit.cgi/yocto-kernel-cache/commit/?id=551c7ad8c46d371c6b135357ed2d388d45af13d8>
>
> Once I update the SRCREVs for the meta branch of the linux-yocto-3.4
> tree, you'll get the expected preempt settings out of the box:
>
> > grep PREEMPT linux-beagleboard-preempt-rt-**build/.config
> CONFIG_TINY_PREEMPT_RCU=y
> CONFIG_PREEMPT_RCU=y
> CONFIG_PREEMPT=y
> CONFIG_PREEMPT_RT_BASE=y
> # CONFIG_PREEMPT_NONE is not set
>
> # CONFIG_PREEMPT_VOLUNTARY is not set
> # CONFIG_PREEMPT__LL is not set
> # CONFIG_PREEMPT_RTB is not set
> CONFIG_PREEMPT_RT_FULL=y
> CONFIG_PREEMPT_COUNT=y
> CONFIG_DEBUG_PREEMPT=y
> # CONFIG_PREEMPT_TRACER is not set
Thanks a lot for helping Bruce.
I'm trying to do the modifications to the scc here in the meta branch using
a local bare clone of the linux-yocto-3.4 repository. Still trying to
figure out the bitbake patching failures after modifying the SRCREV_meta
value to point to my recent most meta commission. Will let you know.
Cheers
Pan Yu
[-- Attachment #2: Type: text/html, Size: 2223 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-11-29 2:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-27 10:23 Preempt-rt kernel build for beagleboard Yu Pan
2012-11-27 15:24 ` Bruce Ashfield
2012-11-28 6:07 ` Yu Pan
2012-11-28 14:27 ` Bruce Ashfield
2012-11-28 17:58 ` Bruce Ashfield
2012-11-29 2:43 ` Yu Pan
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.