From: David Woodhouse <dwmw2@infradead.org>
To: krishna <krishna.c@globaledgesoft.com>
Cc: linux-mtd@lists.infradead.org,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: why is jiffies 128 in jffs2_find_gc_block() in gc.c of jffs2
Date: Fri, 22 Jul 2005 11:55:42 -0400 [thread overview]
Message-ID: <1122047742.12630.10.camel@localhost.localdomain> (raw)
In-Reply-To: <42E079B8.9070703@globaledgesoft.com>
On Fri, 2005-07-22 at 10:14 +0530, krishna wrote:
> I am not clear why the hardcoded values are 50, 110 and 126
> and why is jiffies moded with 128, why not any other value.
It's just a way to achieve 'randomness' which doesn't actually consume
entropy and which is quick to obtain. It only needs to be relatively
evenly distributed.
We use it for selecting the next eraseblock to be garbage-collected.
50/128 of the time we pick a block from the eraseable_list, 60/128 of
the time we pick a block from the very_dirty_list, 16/128 of the time we
pick a block from the dirty_list, and the remaining 2/128 of the time we
pick a block from the clean_list for garbage collection.
The precise numbers don't have a huge amount of science behind them;
they are mostly guesses about what would achieve evenly-distributed wear
levelling over time without garbage-collecting clean blocks more often
than is necessary.
If you want to conduct tests with various workloads in order to refine
the fairly primitive algorithm described above, that could be useful.
--
dwmw2
parent reply other threads:[~2005-07-22 15:55 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <42E079B8.9070703@globaledgesoft.com>]
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=1122047742.12630.10.camel@localhost.localdomain \
--to=dwmw2@infradead.org \
--cc=krishna.c@globaledgesoft.com \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox