From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 2967DE00997; Tue, 5 May 2015 03:23:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (picmaster[at]mail.bg) * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [193.201.172.118 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's * domain * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mx2.mail.bg (mx2.mail.bg [193.201.172.118]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id B9AF2E00961 for ; Tue, 5 May 2015 03:23:00 -0700 (PDT) Received: from [192.168.0.62] (unknown [93.152.143.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx2.mail.bg (Postfix) with ESMTPSA id B11166000D65; Tue, 5 May 2015 13:22:59 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mail.bg; s=default; t=1430821379; bh=z5M2OXLfiFNpTDP8M1fNfehaTNFYsq4RPxxi9SoA1mI=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=uiBPArjabtxjV8P2yp9XOAkNib9tFJEXX0yEmpJmumDN1AaoS61iJ+Q99SqHzlSNZ Td+0yVLyTUE77qTY3Iqtb/qXfMYW/ZPvknxwLc+lo7s7iGRNcgfAMF7ZoKh5U8UtX8 hxM+cASavu4RVwc18ooq+GR4B3pWmr6NLOMdDChk= Message-ID: <55489A03.4000309@mail.bg> Date: Tue, 05 May 2015 13:22:59 +0300 From: Nikolay Dimitrov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0 MIME-Version: 1.0 To: Stefan Christ , meta-freescale@yoctoproject.org References: <1430815208-42300-1-git-send-email-s.christ@phytec.de> In-Reply-To: <1430815208-42300-1-git-send-email-s.christ@phytec.de> Subject: Re: [meta-fsl-arm][PATCH] classes: use dd's option fsync instead of sync X-BeenThere: meta-freescale@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Usage and development list for the meta-fsl-* layers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 10:23:03 -0000 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 05/05/2015 11:40 AM, Stefan Christ wrote: > The shell command sync flushes all filesystem buffers in the system. On > a bigger multiuser system there are multiple gigs of data sometimes in > the buffer which then are written out to disk at once. It's better to > only flush the specific file with dd's option 'fsync'. > > Signed-off-by: Stefan Christ > --- > Hi, > > I'm curious why the bbclass image_types_fsl.bbclass uses a double 'sync' to > burn the sdcard image. Is there a specific reason, why a single sync is not > sufficient to write the data to disk? > > Furthermore calling sync will flush all filesystem buffers on the system. It > maybe a performance bottleneck because this may fill up the disk controller > capacity quickly. > > Kind regards, > Stefan > --- > classes/image_types_fsl.bbclass | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/classes/image_types_fsl.bbclass b/classes/image_types_fsl.bbclass > index 75eca59..1ebcb06 100644 > --- a/classes/image_types_fsl.bbclass > +++ b/classes/image_types_fsl.bbclass > @@ -178,8 +178,8 @@ generate_imx_sdcard () { > fi > > # Burn Partition > - dd if=${WORKDIR}/boot.img of=${SDCARD} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync > - dd if=${SDCARD_ROOTFS} of=${SDCARD} conv=notrunc seek=1 bs=$(expr ${BOOT_SPACE_ALIGNED} \* 1024 + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync > + dd if=${WORKDIR}/boot.img of=${SDCARD} conv=notrunc,fsync seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) > + dd if=${SDCARD_ROOTFS} of=${SDCARD} conv=notrunc,fsync seek=1 bs=$(expr ${BOOT_SPACE_ALIGNED} \* 1024 + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) > } > > # > @@ -293,7 +293,7 @@ generate_mxs_sdcard () { > > parted ${SDCARD} print > > - dd if=${SDCARD_ROOTFS} of=${SDCARD} conv=notrunc seek=1 bs=$(expr ${BOOT_SPACE_ALIGNED} \* 1024 + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync > + dd if=${SDCARD_ROOTFS} of=${SDCARD} conv=notrunc,fsync seek=1 bs=$(expr ${BOOT_SPACE_ALIGNED} \* 1024 + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) > } > > IMAGE_CMD_sdcard () { > Tested-by: Nikolay Dimitrov