All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Ed Bartosh <ed.bartosh@linux.intel.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] kernel.bbclass: Fix race condition
Date: Tue, 05 May 2015 21:06:41 +0100	[thread overview]
Message-ID: <1430856401.8074.13.camel@linuxfoundation.org> (raw)
In-Reply-To: <1430748689-7217-1-git-send-email-ed.bartosh@linux.intel.com>

On Mon, 2015-05-04 at 17:11 +0300, Ed Bartosh wrote:
> Race condition between do_compile_kernelmodules and do_shared_workdir
> tasks occurs when do_compilemodules changes files in include/generated/*
> while do_shared_workdir tries to copy them to shared working directory.
> 
> Functionality of do_shared_workdir has been moved to separate function
> mk_shared_workdir and called from do_kernel_compile. do_shared_workdir
> left in the code as it may be used in many recipes.
> 
> [YOCTO #7321]
> 
> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
> ---
>  meta/classes/kernel.bbclass | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 125ed88..13c0180 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -192,6 +192,8 @@ kernel_do_compile() {
>  	if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then
>  		gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}"
>  	fi
> +
> +	mk_shared_workdir
>  }
>  
>  do_compile_kernelmodules() {
> @@ -245,7 +247,7 @@ emit_depmod_pkgdata() {
>  
>  PACKAGEFUNCS += "emit_depmod_pkgdata"
>  
> -do_shared_workdir () {
> +mk_shared_workdir () {
>  	cd ${B}
>  
>  	kerneldir=${STAGING_KERNEL_BUILDDIR}
> @@ -289,6 +291,14 @@ do_shared_workdir () {
>  	fi
>  }
>  
> +# NOTE!!! Functionality of do_shared_workdir has been moved to mk_shared_workdir
> +# and called from kernel_do_compile.
> +# It caused race condition with do_compile_kernelmodules when it runs
> +# in parallel with do_compile_kernelmodules
> +do_shared_workdir () {
> +	:
> +}
> +
>  # We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware
>  sysroot_stage_all () {
>  	:

This fails on the autobuilder with a missing kernel-None package.
Building lttng-modules, then looking at the package dependencies 100%
reproduces. The problem is this line:

echo "${KERNEL_VERSION}" > $kerneldir/kernel-abiversion

since KERNEL_VERSION is obtained from ${B} via:

KERNEL_VERSION = "${@get_kernelversion_headers('${B}')}"

and ${B} isn't populated when the do_compile shell script is generated
resulting in the file containing "None".

Cheers,

Richard




  parent reply	other threads:[~2015-05-05 20:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-14 16:56 [PATCH] kernel.bbclass: Fix race condition Ed Bartosh
2015-05-01 14:28 ` Richard Purdie
2015-05-01 14:31   ` Bruce Ashfield
2015-05-04 14:11   ` Ed Bartosh
2015-05-04 14:33     ` Bruce Ashfield
2015-05-05 20:06     ` Richard Purdie [this message]
2015-05-06 10:26       ` Ed Bartosh
2015-05-06 14:03       ` [PATCH v.4] " Ed Bartosh
2015-05-06 14:12         ` Bruce Ashfield
2015-05-06 14:27         ` Richard Purdie
2015-05-06 20:28           ` [PATCH v.5] " Ed Bartosh
  -- strict thread matches above, loose matches on Subject: below --
2015-03-12 20:14 [PATCH] " Ed Bartosh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1430856401.8074.13.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=ed.bartosh@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.