All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: hejianet <hejianet@linux.vnet.ibm.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: jffs2 copy too long after mounting
Date: Fri, 24 Aug 2012 10:53:17 +0300	[thread overview]
Message-ID: <1345794797.2848.264.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <5019EE49.7000208@linux.vnet.ibm.com>

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

On Thu, 2012-08-02 at 11:04 +0800, hejianet wrote:
> hi All
> my kernel is 2.6.16
> after mounting the nand flash with jffs2 partition, the first copy operation
> for a 15M file(from jffs2 partition to jffs2 partition) take 9
> minutes,but the
> second copy operation takes 1 minutes.
> the disk usage(df result) is over 85%.
> I wonder is there any patch ported to such old kernel?

His is because how JFFS2 is designed. When the mount operation is
finished, JFFS2 does not really finish mounting. There is the background
process which keeps working - it basically reads all files in the system
and checks the CRC, which is needed to find out which nodes are new and
which are obsolete.

So what happens is that you mount JFFS2, the background thread keeps
working (see 'top' for example).

While the background thread works, you can read files. But you cannot
write - writes will be blocked. Well, it is a bit more complex - you can
write a little, but from some point your writes will be blocked until
the background thread finishes. Then the write will continue and finish.

In you case, you mount, start writing your 15MiB file, write gets
blocked, waits for the background thread, then continues write. The
background thread takes ages to finish on big partitions.

The second write is fast because you do not wait for the background
thread any longer.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2012-08-24  7:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-02  3:04 jffs2 copy too long after mounting hejianet
2012-08-02  3:16 ` hejianet
2012-08-06 22:54   ` Brian Norris
2012-08-02  5:58 ` hejianet
2012-08-06 23:02   ` Brian Norris
2012-08-09  5:31     ` hejianet
2012-08-24  7:53 ` Artem Bityutskiy [this message]
2012-10-23  7:13   ` hejianet
2012-11-12 15:35     ` Artem Bityutskiy
     [not found] <50881109.3010107@linux.vnet.ibm.com>
2012-10-25  1:41 ` hejianet
2012-10-26  1:45   ` hejianet
2012-11-12 15:42     ` Artem Bityutskiy

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=1345794797.2848.264.camel@sauron.fi.intel.com \
    --to=dedekind1@gmail.com \
    --cc=hejianet@linux.vnet.ibm.com \
    --cc=linux-mtd@lists.infradead.org \
    /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.