public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Strange automatic GC threshold ?
@ 2007-03-19 16:16 Joakim Tjernlund
  2007-03-19 16:49 ` MikeW
  0 siblings, 1 reply; 10+ messages in thread
From: Joakim Tjernlund @ 2007-03-19 16:16 UTC (permalink / raw)
  To: linux-mtd

In jffs2_thread_should_wake() there is this test to
wake up GC thread:
	/* dirty_size contains blocks on erase_pending_list
	 * those blocks are counted in c->nr_erasing_blocks.
	 * If one block is actually erased, it is not longer counted as dirty_space
	 * but it is counted in c->nr_erasing_blocks, so we add it and subtract it
	 * with c->nr_erasing_blocks * c->sector_size again.
	 * Blocks on erasable_list are counted as dirty_size, but not in c->nr_erasing_blocks
	 * This helps us to force gc and pick eventually a clean block to spread the load.
	 */
	dirty = c->dirty_size + c->erasing_size - c->nr_erasing_blocks * c->sector_size;

	if (c->nr_free_blocks + c->nr_erasing_blocks < c->resv_blocks_gctrigger &&
			(dirty > c->nospc_dirty_size))

The && in the above if means that no matter how dirty the FS is, it wont
trigger GC until there is a very low count of free blocks as well(24 in my
case out of 1003). I wonder if that && should be a || instead?

 Jocke

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-03-22 12:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-19 16:16 Strange automatic GC threshold ? Joakim Tjernlund
2007-03-19 16:49 ` MikeW
2007-03-19 17:03   ` Josh Boyer
2007-03-19 17:21     ` Joakim Tjernlund
2007-03-19 17:35       ` Josh Boyer
2007-03-19 18:17         ` Joakim Tjernlund
2007-03-19 18:53           ` Josh Boyer
2007-03-19 19:04             ` MikeW
2007-03-22 12:42             ` Joakim Tjernlund
2007-03-19 18:23       ` MikeW

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox