Skip to contentSkip to conversation

JFFS2 on 8MB Flash-Chip conneted to MPC850 works extremly slow :(

DISCUSSION Wojciech Kromer 4 participants 16 messages Aug 28, 2001 – Sep 5, 2001 1 message not in the archive Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

I have JFFS2 on my 8MBFujitsu Flash Chip connected to MPC850 (50Mhz). I've decided to have root file system on that flash, but it boots extremly slow.
It takes about 5 minutes. With compressed initial ram disk on flash it takes less
than 30s.

Q1 Why?
Q2 I work on mtd-snapshot-20010628.tar.bz2. Are there any speed changes in furthere releases?

--
* * * * * * * * * * * *
* per pedes ad astra! *
* * * * * * * * * * * * mailto:[email protected]

#1 lore raw
Quoted 11 lines · Wojciech Kromer

I have JFFS2 on my 8MBFujitsu Flash Chip connected to MPC850 (50Mhz). I've decided to have root file system on that flash, but it boots extremly slow.
It takes about 5 minutes. With compressed initial ram disk on flash it takes less
than 30s.

Q1 Why?
Q2 I work on mtd-snapshot-20010628.tar.bz2. Are there any speed changes in furthere releases?

It will take longer than a ramdisk because of the way jffs2 works, but it looks like you might not be setting your flash timings

#2 lore raw
Quoted 4 lines

It will take longer than a ramdisk because of the way jffs2 works, but it looks like you might not be setting your flash timings

Do You mean 'wait wtates' on MPC chip-select configuration? Or trere are some time settings in MTD?

--
* * * * * * * * * * * *
* per pedes ad astra! *
* * * * * * * * * * * * mailto:[email protected]

#3 lore raw
Quoted 8 lines · Wojciech Kromer
Quoted 5 lines

It will take longer than a ramdisk because of the way jffs2 works, but it looks like you might not be setting your flash timings

Do You mean 'wait wtates' on MPC chip-select configuration? Or trere are some time settings in MTD

I don't know what an "MDC" is, mut whatever changes your bus timings

#4 lore raw

Re: JFFS2 on 8MB Flash-Chip conneted to MPC850 works extremly slow:(

Quoted 2 lines

I don't know what an "MDC" is, mut whatever changes your bus timings

I can only change wait-states in ORx (option register in MPC850). But just mounting jffs2 still takes about 2 min :(

-Are thre any settings in JFFS2 code, or in MTD code? -Maybe I can enlarge some buffers? But I don't know where.

--
* * * * * * * * * * * *
* per pedes ad astra! *
* * * * * * * * * * * * mailto:[email protected]

#5 lore raw

Re: JFFS2 on 8MB Flash-Chip conneted to MPC850 works extremly slow:(

Review

Quoted 8 lines · Wojciech Kromer
Quoted 2 lines

I don't know what an "MDC" is, mut whatever changes your bus timings

I can only change wait-states in ORx (option register in MPC850). But just mounting jffs2 still takes about 2 min :(

(quoted diff) +0 -2
-Are thre any settings in JFFS2 code, or in MTD code?
-Maybe I can enlarge some buffers? But I don't know where.

jffs2 has to scan the entire medium at mount. Also, if there are "unformatted" sectors, it erases them (so the first mount will be slower than subsequent mounts). Did you look at you data sheets and see if that is as tight as the timing can be?

#6 lore raw

Re: JFFS2 on 8MB Flash-Chip conneted to MPC850 works extremly slow:(

Quoted 4 lines · [email protected] said:

jffs2 has to scan the entire medium at mount. Also, if there are
"unformatted" sectors, it erases them (so the first mount will be slower than subsequent mounts). Did you look at you data sheets and see if that is as tight as the timing can be?

The erase of unclean sectors is done in the background after the mount has finished. One day we'll get round to fixing the drivers so that we don't busy-wait for erases to complete either.

--
dwmw2

#7 lore raw

Re: JFFS2 on 8MB Flash-Chip conneted to MPC850 works extremly slow:(

Quoted 4 lines

The erase of unclean sectors is done in the background after the mount has finished. One day we'll get round to fixing the drivers so that we don't busy-wait for erases to complete either.

Please anonuce it on the list.

--
* * * * * * * * * * * *
* per pedes ad astra! *
* * * * * * * * * * * * mailto:[email protected]

#8 lore raw

Re: JFFS2 on 8MB Flash-Chip conneted to MPC850 works extremly slow:(

Quoted 5 lines · [email protected] said:
Quoted 3 lines

The erase of unclean sectors is done in the background after the mount has finished. One day we'll get round to fixing the drivers so that we don't busy-wait for erases to complete either.

Please anonuce it on the list.

It won't make your mount any faster. You have a sane CPU which can handle having both a cached and uncached mapping of a physical region - try doing that in your map driver (see ocelot.c for inspiration) and see if it helps.

You may also want to investigate burst reads from the flash chips, if your hardware is capable of it.

Another possibility is to work with the people who want XIP so you can give the JFFS2 code a direct pointer to the flash chips and avoid the out-of-line function calls on every read.

--
dwmw2

#9 lore raw

RE: JFFS2 on 8MB Flash-Chip conneted to MPC850 works extremly slow:(

Quoted 5 lines
Quoted 3 lines · [email protected] said:
Quoted 3 lines

The erase of unclean sectors is done in the background after the mount has finished. One day we'll get round to fixing the drivers so that we don't busy-wait for erases to complete either.

Quoted 7 lines
Quoted 1 line

Please anonuce it on the list.

It won't make your mount any faster. You have a sane CPU which can handle having both a cached and uncached mapping of a physical region - try doing
that in your map driver (see ocelot.c for inspiration) and see if it helps.

Is this(both a cached and uncached mapping)possible on an MPC860?

#10 lore raw

Re: JFFS2 on 8MB Flash-Chip conneted to MPC850 works extremly slow:(

Quoted 1 line · [email protected] said:

Is this(both a cached and uncached mapping)possible on an MPC860?

Not sure, but I thought so - only Intel make processors which can't do that, don't they?

--
dwmw2

#11 lore raw

Re: JFFS2 on 8MB Flash-Chip conneted to MPC850 works extremly slow:(

In reply to David Woodhouse
Quoted 5 lines

It won't make your mount any faster. You have a sane CPU which can handle having both a cached and uncached mapping of a physical region - try doing that in your map driver (see ocelot.c for inspiration) and see if it helps.

OK, now I'm testing the ocelot's trick. But I do not understand it.

........................

        ocelot_flash_map.map_priv_1 =
        (unsigned long)ioremap_nocache(FLASH_WINDOW_ADDR, FLASH_WINDOW_SIZE);

        ocelot_flash_map.map_priv_2 =
         (unsigned long)__ioremap(FLASH_WINDOW_ADDR, FLASH_WINDOW_SIZE, 0);

^^^^^^^^ so we have chached version in map_priv_2

..........................

__u8 ocelot_read8(struct map_info *map, unsigned long ofs)

{
        return __raw_readb(map->map_priv_1 + ofs);
}

void ocelot_write8(struct map_info *map, __u8 d, unsigned long adr)

{
        cacheflush = 1;
        __raw_writeb(d, map->map_priv_1 + adr);
        mb();
}

^^^^^ and now we're using uncached version for reading and wrining !!!!!!!!!!!!!!!!!!!!!!!!! ?????????????????

void ocelot_copy_from_cache(struct map_info *map, void *to, unsigned long from, ss

{
        if (cacheflush) {
                dma_cache_inv(map->map_priv_2, map->size);
                cacheflush = 0;
        }
        memcpy_fromio(to, map->map_priv_1 + from, len);
}

^^^^^^^ and flushing chache after some writes !!!! ???

Q1 What is cahed version usef for?
Q2 Is it a bug?

--
* * * * * * * * * * * *
* per pedes ad astra! *
* * * * * * * * * * * * mailto:[email protected]

#12 lore raw

Re: JFFS2 on 8MB Flash-Chip conneted to MPC850 works extremly slow:(

Quoted 1 line · [email protected] said:

OK, now I'm testing the ocelot's trick. But I do not understand it.

The idea is that read{8,16,32} and write{8,16,32} are used for commands and reading status, and should be uncached. copy_from() is used for copying data from the flash, and can be cached. We have to flush the cache any time a command is sent, because it could be a write or erase command.

This means that we don't get a lot of benefit from storing data in the cache for long periods of time (except maybe on read-only flashes), but at least we can burst-read to fill a cache line, if the hardware can do it.

Flushing the cache on every write cycle to the flash chip may be a little excessive - perhaps the chip driver itself should have to explicitly flush the cache when the data are actually likely to change - I'm not sure if that'd be a win though.

--
dwmw2

A message that is not in the archive (sent off-list or not yet received): [email protected]

#14 lore raw

Re: JFFS2 on 8MB Flash-Chip conneted to MPC850 works extremly slow:(

Quoted 7 lines · David Woodhouse
Quoted 2 lines · [email protected] said:

OK, than You for understanding it. My hardware dosen't support
burst-read

If the kernel is reading from any part of the flash more than once between write cycles, you'll see a benefit from that too - and reading a whole cache line may improve matters even if it doesn't burst.

But mount time is still the same

sh-2.03# time mount /dev/mtdblock0 /mnt -t jffs2

real    1m55.648s
user    0m0.000s
sys     1m55.630s

--
* * * * * * * * * * * *
* per pedes ad astra! *
* * * * * * * * * * * * mailto:[email protected]

#15 lore raw

Re: JFFS2 on 8MB Flash-Chip conneted to MPC850 works extremly slow:(

Quoted 7 lines

But mount time is still the same

sh-2.03# time mount /dev/mtdblock0 /mnt -t jffs2

real    1m55.648s
user    0m0.000s
sys     1m55.630s

Do You know any other file-system which give me:
-I can use it as root-fs
-fast reading from flash
-compresion
-writing could be slow

--
* * * * * * * * * * * *
* per pedes ad astra! *
* * * * * * * * * * * * mailto:[email protected]

#16 lore raw

Re: JFFS2 on 8MB Flash-Chip conneted to MPC850 works extremly slow:(

Quoted 2 lines · [email protected] said:

Do You know any other file-system which give me: -I can use it as
root-fs -fast reading from flash -compresion -writing could be slow

You could use a cramfs root filesystem then mount a small jffs2 partition, or just implement checkpointing in JFFS2.

--
dwmw2