linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Quentin Schulz <quentin.schulz@bootlin.com>
To: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: dedekind1@gmail.com, richard@nod.at, dwmw2@infradead.org,
	computersforpeace@gmail.com, marek.vasut@gmail.com,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	thomas.petazzoni@bootlin.com
Subject: Re: [PATCH 2/2] ubi: introduce ubi.nocheck parameter to skip CRC check when attaching ubi vol
Date: Mon, 23 Apr 2018 11:40:09 +0200	[thread overview]
Message-ID: <20180423094009.5cjvg7jxvwiegq2g@qschulz> (raw)
In-Reply-To: <20180420191924.18b81e96@bbrezillon>

[-- Attachment #1: Type: text/plain, Size: 3382 bytes --]

Hi Boris,

On Fri, Apr 20, 2018 at 07:19:24PM +0200, Boris Brezillon wrote:
> On Fri, 20 Apr 2018 10:52:41 +0200
> Quentin Schulz <quentin.schulz@bootlin.com> wrote:
> 
> > There's already ECC on NAND pages so there may be no need for one to
> > check the CRC of a UBI volume.
> 
> That's true that ECC can help detecting corruptions, but I don't think
> this is the actual reason for disabling CRC check at volume open time.
> The actual reason for doing that is when the UBI volume user (in our
> case the squashfs FS) is also checking data consistency on its own
> (which is the case for squashfs).
> 
> > 
> > Let's introduce a ubi.nocheck parameter that let one skip the CRC check
> > when attaching a UBI volume.
> > 
> > This also drastically speeds kernel boot by removing a potentially
> > useless check, e.g. I gained 3.2s on boot time of a SPEAr600-based board
> > for a ~20MB UBI volume used as rootfs.
> 
> Can you give the old and new open/mount time instead of telling how
> much you gained on the whole boot-time?

# grabserial -v -d /dev/ttyUSB0 -t "Starting kernel"

Kernel command line is:
rootfstype=squashfs root=/dev/ubiblock0_0 ubi.mtd=ubi ubi.block=0,rootfs mtdparts=nand:92M@36M(ubi)

Current behaviour (CRC checking):
[2.335558 0.017867] ubi0: attaching mtd7
[2.504021 0.168463] ubi0: scanning is finished
[2.519824 0.015803] ubi0: attached mtd7 (name "ubi", size 92 MiB)
[2.523987 0.004163] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
[2.530447 0.006460] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
[2.535836 0.005389] ubi0: VID header offset: 512 (aligned 512), data offset: 2048
[2.541601 0.005765] ubi0: good PEBs: 736, bad PEBs: 0, corrupted PEBs: 0
[2.547923 0.006322] ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128
[2.554223 0.006300] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 463835917
[2.562460 0.008237] ubi0: available PEBs: 0, total reserved PEBs: 736, PEBs reserved for bad PEB handling: 20
[2.569779 0.007319] ubi0: background thread "ubi_bgt0d" started, PID 546
[4.550142 1.980363] block ubiblock0_0: created from ubi0:0(rootfs)

Skipping CRC check (ubi.nocheck=0,rootfs):
[2.349903 0.019126] ubi0: attaching mtd7
[2.516995 0.167092] ubi0: scanning is finished
[2.527101 0.010106] ubi0: skipping CRC check for volume rootfs
[2.536719 0.009618] ubi0: attached mtd7 (name "ubi", size 92 MiB)
[2.541859 0.005140] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
[2.547744 0.005885] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
[2.552990 0.005246] ubi0: VID header offset: 512 (aligned 512), data offset: 2048
[2.560497 0.007507] ubi0: good PEBs: 736, bad PEBs: 0, corrupted PEBs: 0
[2.568010 0.007513] ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128
[2.574723 0.006713] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 463835917
[2.586223 0.011500] ubi0: available PEBs: 0, total reserved PEBs: 736, PEBs reserved for bad PEB handling: 20
[2.592365 0.006142] ubi0: background thread "ubi_bgt0d" started, PID 545
[2.595960 0.003595] block ubiblock0_0: created from ubi0:0(rootfs)

It seems like it's more in the magnitude of 2s rather than 3, but still.

This is retrieved from the boot log.

Thanks,
Quentin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2018-04-23  9:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20  8:52 [PATCH 1/2] ubi: move constants for ubi vol parsing from kernel param to ubi.h Quentin Schulz
2018-04-20  8:52 ` [PATCH 2/2] ubi: introduce ubi.nocheck parameter to skip CRC check when attaching ubi vol Quentin Schulz
2018-04-20  9:37   ` Richard Weinberger
2018-04-20  9:50     ` Quentin Schulz
2018-06-11 10:20     ` Quentin Schulz
2018-06-14  7:29       ` Richard Weinberger
2018-06-14  8:04         ` Boris Brezillon
2018-06-14  8:07           ` Richard Weinberger
2018-04-20 17:19   ` Boris Brezillon
2018-04-23  9:40     ` Quentin Schulz [this message]
2018-04-23 12:08       ` Boris Brezillon

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=20180423094009.5cjvg7jxvwiegq2g@qschulz \
    --to=quentin.schulz@bootlin.com \
    --cc=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=dedekind1@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=richard@nod.at \
    --cc=thomas.petazzoni@bootlin.com \
    /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;
as well as URLs for NNTP newsgroup(s).