Skip to contentSkip to conversation

kernel/rm_work: Improve interaction

PATCH In review Richard Purdie 2 participants 3 messages May 14, 2015 – May 20, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel/rm_work: Improve interaction

The do_shared_workdir task does leave behind the necessary information in shared-work after it completes. We don't make this a "full" sstate task however since that means tarring up and copying what is usually a large amount of data which would be better extracted straight from the original SCM.

The issue with rm_work occurs since it removes the do_shared_workdir stamp meaning subsequent builds will add it back if they need to touch any kernel modules for example. This ends up triggering a near enough complete kernerl rebuild since if configure reruns, populate_sysroot has to rerun.

This change promotes the task to have a "setscene" variant but it doesn't use any of the sstate class lifting to generate the sstate file. The sstate function will therefore never get called since the sstate object will never exist.

We can add the task to the list of tasks rm_work promotes to a setscene variant and unwanted rebuilds of the kernel should be avoided.

meta/classes/kernel.bbclass +5 -0
index 74092e9..54725ba 100644
@@ -235,6 +235,11 @@ kernel_do_install() {
 do_install[prefuncs] += "package_get_auto_pr"
 
 addtask shared_workdir after do_compile before do_compile_kernelmodules
+addtask shared_workdir_setscene
+
+do_shared_workdir_setscene () {
+	exit 1
+}
 
 emit_depmod_pkgdata() {
 	# Stash data for depmod
meta/classes/rm_work.bbclass +1 -1
index e68d02a..5e9efc1 100644
@@ -49,7 +49,7 @@ do_rm_work () {
     cd `dirname ${STAMP}`
     for i in `basename ${STAMP}`*
     do
-        for j in ${SSTATETASKS}
+        for j in ${SSTATETASKS} do_shared_workdir
         do
             case $i in
             *do_setscene*)
#1 lore raw

Hi Richard,

I've observed a side effect of this patch.
The problem is sstate reuse.

Steps to reproduce:
1) bitbake core-image-minimal
2) Change TMPDIR in local.conf

     TMPDIR = "${TOPDIR}/tmp-test"

3) bitbake core-image-minimal

In theory, sstate objects are all reused in step 3. But currently the do_populate_sysroot sstate object of the kernel is not reused. In addition, other kernel tasks like do_fetch, do_patch, do_compile, etc, are rerun.

Best Regards,
Chen Qi

Quoted 51 lines · Richard Purdie

The do_shared_workdir task does leave behind the necessary information in shared-work after it completes. We don't make this a "full" sstate task however since that means tarring up and copying what is usually a large amount of data which would be better extracted straight from the original SCM.

The issue with rm_work occurs since it removes the do_shared_workdir stamp meaning subsequent builds will add it back if they need to touch any kernel modules for example. This ends up triggering a near enough complete kernerl rebuild since if configure reruns, populate_sysroot has to rerun.

This change promotes the task to have a "setscene" variant but it doesn't use any of the sstate class lifting to generate the sstate file. The sstate function will therefore never get called since the sstate object will never exist.

We can add the task to the list of tasks rm_work promotes to a setscene variant and unwanted rebuilds of the kernel should be avoided.

meta/classes/kernel.bbclass +5 -0
index 74092e9..54725ba 100644
@@ -235,6 +235,11 @@ kernel_do_install() {
  do_install[prefuncs] += "package_get_auto_pr"
 
  addtask shared_workdir after do_compile before do_compile_kernelmodules
+addtask shared_workdir_setscene
+
+do_shared_workdir_setscene () {
+	exit 1
+}
 
  emit_depmod_pkgdata() {
  	# Stash data for depmod
meta/classes/rm_work.bbclass +1 -1
index e68d02a..5e9efc1 100644
@@ -49,7 +49,7 @@ do_rm_work () {
      cd `dirname ${STAMP}`
      for i in `basename ${STAMP}`*
      do
-        for j in ${SSTATETASKS}
+        for j in ${SSTATETASKS} do_shared_workdir
          do
              case $i in
              *do_setscene*)
#2 lore raw
Quoted 6 lines · ChenQi

I've observed a side effect of this patch.
The problem is sstate reuse.

Steps to reproduce:
1) bitbake core-image-minimal
2) Change TMPDIR in local.conf

Quoted 7 lines
      TMPDIR = "${TOPDIR}/tmp-test"

3) bitbake core-image-minimal

In theory, sstate objects are all reused in step 3. But currently the do_populate_sysroot sstate object of the kernel is not reused. In addition, other kernel tasks like do_fetch, do_patch, do_compile, etc, are rerun.

Well spotted, I've sent a patch out for this.

Cheers,

Richard