Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Rongqing Li <rongqing.li@windriver.com>
To: Rongqing Li <rongqing.li@windriver.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 1/1] sstate.bbclass: fix parallel building issue
Date: Fri, 16 Aug 2013 17:05:28 +0800	[thread overview]
Message-ID: <520DEB58.5050905@windriver.com> (raw)
In-Reply-To: <520DE1DE.10608@windriver.com>



On 08/16/2013 04:25 PM, Rongqing Li wrote:
>>> Do we need some kind of a read/write lock on accessing those files.
>>> (Is this
>>> even something that we can do easily though the existing mechanisms?)
>>
>> It would kill performance for no good reason, been there, looked at
>> it...
>>
>> Cheers,
>>
>> Richard
>>
>
> I think reverting the below optimization maybe better than using lock
>
> commit 8c5544c2311b080bb212efb7f6b804db63e125f5
> Author: Richard Purdie <richard.purdie@linuxfoundation.org>
> Date:   Thu Oct 11 13:36:53 2012 +0100
>
>      scripts/cp-noerror: Try and use hardlinks if possible
>
>      Since we generally have lots of copies of the directories created
> using this tool, use
>      hardlinks where possible. This should save a little disk space and
> improve performance
>      slightly.
>
>      (From OE-Core rev: bfa11c028c2da093f7b4e6b7b1d611da90ae052f)
>
>      Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>
>
> -Roy
>
>

I think the upper commit saves lots of space, but the saved time maybe 
be ignored.

On my general building image.

1. aclocal size and numbers of files
         bitbake_build/tmp/sysroots/x86_64-linux/usr/share$ du -sh aclocal
         768K    aclocal

         bitbake_build/tmp/sysroots/x86_64-linux/usr/share$ ls aclocal|wc
              54      54     621
2. do hardlink copy 1000 times
         bitbake_build/tmp/sysroots/x86_64-linux/usr/share$ cat ./aa
         #! /bin/bash

         n=0

         while [ $n -le 1000 ] ; do
             n=`expr "$n" + 1`
             cp -alf aclocal ./tmp/
             rm -rf ./tmp/aclocal
         done
         /bitbake_build/tmp/sysroots/x86_64-linux/usr/share$ time ./aa

         real    0m4.416s
         user    0m0.084s
         sys     0m0.256s

2. do copy 1000 times
         bitbake_build/tmp/sysroots/x86_64-linux/usr/share$ cat ./aa
         #! /bin/bash

         n=0

         while [ $n -le 1000 ] ; do
             n=`expr "$n" + 1`
             cp -rf aclocal ./tmp/
             rm -rf ./tmp/aclocal
         done

         bitbake_build/tmp/sysroots/x86_64-linux/usr/share$ time ./aa

         real    0m8.707s
         user    0m0.104s
         sys     0m0.324s


Since we need several hours to compile a image, several seconds 
improvement...


-- 
Best Reagrds,
Roy | RongQing Li


  reply	other threads:[~2013-08-16  9:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13  8:20 [PATCH 0/1] sstate.bbclass: fix parallel building issue rongqing.li
2013-08-13  8:20 ` [PATCH 1/1] " rongqing.li
2013-08-13 19:02   ` Saul Wold
2013-08-14  5:28     ` Rongqing Li
2013-08-14  6:56       ` Martin Jansa
2013-08-14  9:27         ` Rongqing Li
2013-08-14 10:46         ` Richard Purdie
2013-08-14 10:59           ` Martin Jansa
2013-08-15  9:51             ` Rongqing Li
2013-08-15  9:55               ` Phil Blundell
2013-08-15 10:08                 ` Rongqing Li
2013-08-15 16:23                 ` Richard Purdie
2013-08-15 16:27                   ` Mark Hatle
2013-08-15 23:04                     ` Richard Purdie
2013-08-16  8:25                       ` Rongqing Li
2013-08-16  9:05                         ` Rongqing Li [this message]
2013-08-16  9:27                           ` Richard Purdie
2013-08-15 16:38                   ` Phil Blundell
2013-09-12 15:39   ` Richard Purdie

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=520DEB58.5050905@windriver.com \
    --to=rongqing.li@windriver.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox