Re: Free blocks for GC and WRITE/READ blocking during the GC

David Woodhouse <[email protected]>
Newsgroups gmane.linux.file-systems.jffs
Message-ID <[email protected]>
On Wed, 2002-01-16 at 16:39 +0200, Ivan Dimitrov wrote:
> 1. It's clean that for the proper functionality of the JFFS2 file system and
> GC it needs some free blocks (5?...)
> in the tail. My question is: Are these blocks initially reserved and does
> the file system "hide" them from the user space application so that to be
> sure that they will be always free?

Yes, we hide them from user space by disallowing writes. We just return
-ENOSPC when a write would take us below the amount of space we believe
we need to keep free.

> 2. When the GC is running all write calls are blocked until the GC has
> finished its operations. Then what about reads? I mean when the GC is
> running do the read attempts block in the same manner as write ones?

GC is incremental, and runs to make space for a write. It runs for just
long enough to make enough space for the write that's waiting. By
default there's a GC thread which makes a little bit of space before
it's _actually_ needed, so that writes can go faster. That's optional
though.

Reads don't need to wait for GC. However, if your flash driver cannot
interrupt erases then reads may need to wait sometimes, if they happen
while a block erase is happening.

-- 
dwmw2


To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
the body of a message to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.