From: Michael Lawnick <nospam_lawnick@gmx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] jffs2: cache data_crc results
Date: Tue, 14 Oct 2008 11:25:22 +0200 [thread overview]
Message-ID: <gd1oi3$c0c$1@ger.gmane.org> (raw)
In-Reply-To: <1223877234-720-7-git-send-email-yanok@emcraft.com>
Ilya Yanok said the following:
> As we moved data_crc() invocation from jffs2_1pass_build_lists() to
> jffs2_1pass_read_inode() data_crc is going to be calculated on each
> inode access. This patch adds caching of data_crc() results. There
> is no significant improvement in speed (because of flash access
> caching added in previous patch I think, crc in RAM is really fast)
> but this patch impacts memory usage -- every b_node structure uses
> 12 bytes instead of 8.
>
> Signed-off-by: Alexey Neyman <avn@emcraft.com>
> Signed-off-by: Ilya Yanok <yanok@emcraft.com>
> ---
> fs/jffs2/jffs2_1pass.c | 5 ++++-
> fs/jffs2/jffs2_private.h | 1 +
> 2 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
> index 9d9ac1a..b41c299 100644
> --- a/fs/jffs2/jffs2_1pass.c
> +++ b/fs/jffs2/jffs2_1pass.c
> @@ -768,7 +768,10 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 inode, char *dest)
> put_fl_mem(jNode, pL->readbuf);
> continue;
> }
> - if (!data_crc(jNode)) {
> + if (b->datacrc == CRC_UNKNOWN)
> + b->datacrc = data_crc(jNode) ?
> + CRC_OK : CRC_BAD;
> + if (b->datacrc == CRC_BAD) {
> put_fl_mem(jNode, pL->readbuf);
> continue;
> }
> diff --git a/fs/jffs2/jffs2_private.h b/fs/jffs2/jffs2_private.h
> index b3fab1c..7a9eda6 100644
> --- a/fs/jffs2/jffs2_private.h
> +++ b/fs/jffs2/jffs2_private.h
> @@ -7,6 +7,7 @@
> struct b_node {
> u32 offset;
> struct b_node *next;
> + enum { CRC_UNKNOWN = 0, CRC_OK, CRC_BAD } datacrc;
> };
>
> struct b_list {
Could be so kind to give us your source reference?
I can't find above code in u-boot 1.3.3 nor 1.3.4
The same seems to apply to the other patches you've sent yesterday :-(
I'm eagerly waiting for summary patch ;-)
Regards,
Michael
next prev parent reply other threads:[~2008-10-14 9:25 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-13 5:53 [U-Boot] [PATCH/RFC] Some speed improvements to U-Boot JFFS2 code Ilya Yanok
2008-10-13 5:53 ` [U-Boot] [PATCH] jffs2: add sector_size field to part_info structure Ilya Yanok
2008-10-13 8:17 ` Wolfgang Denk
2008-10-15 12:35 ` Ilya Yanok
2008-10-13 5:53 ` [U-Boot] [PATCH] jffs2: rewrite jffs2 scanning code based on Linux one Ilya Yanok
2008-10-13 5:53 ` [U-Boot] [PATCH] jffs2: summary support Ilya Yanok
2008-10-13 5:53 ` [U-Boot] [PATCH] jffs2: fix searching for latest version in jffs2_1pass_list_inodes() Ilya Yanok
2008-10-13 5:53 ` [U-Boot] [PATCH] jffs2: add buffer to cache flash accesses Ilya Yanok
2008-10-13 5:53 ` [U-Boot] [PATCH] jffs2: cache data_crc results Ilya Yanok
2008-10-14 9:25 ` Michael Lawnick [this message]
2008-10-13 8:14 ` [U-Boot] [PATCH/RFC] Some speed improvements to U-Boot JFFS2 code Wolfgang Denk
2008-10-15 12:44 ` Ilya Yanok
2008-10-16 12:36 ` Michael Lawnick
2008-11-01 1:00 ` Ilya Yanok
2008-11-02 16:02 ` Wolfgang Denk
2008-11-02 19:08 ` Ilya Yanok
2008-11-04 11:14 ` Michael Lawnick
2008-11-04 12:31 ` Michael Lawnick
2008-11-04 13:14 ` Joakim Tjernlund
2008-11-05 7:59 ` Michael Lawnick
2008-11-11 6:49 ` Alexey Neyman
2008-11-11 8:19 ` Joakim Tjernlund
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='gd1oi3$c0c$1@ger.gmane.org' \
--to=nospam_lawnick@gmx.de \
--cc=u-boot@lists.denx.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