From: Richard Weinberger <richard@nod.at>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: linux-mtd@lists.infradead.org, Artem Bityutskiy <dedekind1@gmail.com>
Subject: Re: [PATCH] UBI: only read UBI_VID_HDR_SIZE when reading the vid_hdr
Date: Thu, 23 Jun 2016 17:16:06 +0200 [thread overview]
Message-ID: <576BFD36.8090702@nod.at> (raw)
In-Reply-To: <20160623150631.GG20657@pengutronix.de>
Am 23.06.2016 um 17:06 schrieb Sascha Hauer:
>>> p = (char *)vid_hdr - ubi->vid_hdr_shift;
>>> read_err = ubi_io_read(ubi, p, pnum, ubi->vid_hdr_aloffset,
>>> - ubi->vid_hdr_alsize);
>>> + UBI_VID_HDR_SIZE);
>>
>> Hmm, I fear this will break as soon ubi->vid_hdr_shift is non-zero.
>
> Ok, just tried and indeed it does break. Would it be an option to read
> UBI_VID_HDR_SIZE + ubi->vid_hdr_shift bytes instead?
Well, you need to satisfy the trick UBI does.
Please read the huge comment on it on top of io.c.
Since in most cases ubi->vid_hdr_shift is 0 we could also do a fast path.
i.e.
if (ubi->vid_hdr_shift)
read_len = ubi->vid_hdr_alsize
else
read_len = UBI_VID_HDR_SIZE;
But first I have to review a view call sites. :-)
Can you tell a bit more on the NAND you're facing that speedup?
I find it surprising that you gain a full second.
Thanks,
//richard
next prev parent reply other threads:[~2016-06-23 15:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-23 13:29 [PATCH] UBI: only read UBI_VID_HDR_SIZE when reading the vid_hdr Sascha Hauer
2016-06-23 14:38 ` Richard Weinberger
2016-06-23 15:06 ` Sascha Hauer
2016-06-23 15:16 ` Richard Weinberger [this message]
2016-06-24 6:10 ` Sascha Hauer
2016-06-24 7:39 ` Boris Brezillon
2016-06-25 8:39 ` [PATCH] ubi: Speedup ubi_io_read_vid_hdr() Richard Weinberger
2016-06-25 9:02 ` Richard Weinberger
2016-06-27 5:22 ` Sascha Hauer
2016-06-27 7:05 ` Richard Weinberger
2016-06-25 8:41 ` [PATCH] UBI: only read UBI_VID_HDR_SIZE when reading the vid_hdr Richard Weinberger
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=576BFD36.8090702@nod.at \
--to=richard@nod.at \
--cc=dedekind1@gmail.com \
--cc=linux-mtd@lists.infradead.org \
--cc=s.hauer@pengutronix.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 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).