All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Dimitrov <picmaster@mail.bg>
To: Stefan Christ <s.christ@phytec.de>, meta-freescale@yoctoproject.org
Subject: Re: [meta-fsl-arm][PATCH] classes: use dd's option fsync instead of sync
Date: Tue, 05 May 2015 13:22:59 +0300	[thread overview]
Message-ID: <55489A03.4000309@mail.bg> (raw)
In-Reply-To: <1430815208-42300-1-git-send-email-s.christ@phytec.de>

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 <s.christ@phytec.de>
> ---
> 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 <picmaster@mail.bg>


      reply	other threads:[~2015-05-05 10:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-05  8:40 [meta-fsl-arm][PATCH] classes: use dd's option fsync instead of sync Stefan Christ
2015-05-05 10:22 ` Nikolay Dimitrov [this message]

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=55489A03.4000309@mail.bg \
    --to=picmaster@mail.bg \
    --cc=meta-freescale@yoctoproject.org \
    --cc=s.christ@phytec.de \
    /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.