Re: [PATCH 25/27] nilfs2: block cache for garbage collection

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jörn
Date: Wednesday, September 17, 2008 - 3:49 pm

On Thu, 18 September 2008 04:09:45 +0900, Ryusuke Konishi wrote:

If that is possible I would definitely prefer it.


You should have the same problem already - in some shape or another.  If
you can have two data structures for the same content, a real inode and
a dummy inode, you have a race condition.  Quite possibly one involving
data corruption.

Well, one way to avoid both the race and the locking complexity is by
stopping all writes during GC and destroying all dummy inodes before
writes resume.  But that would be inefficient in several cases.  When
GC'ing data that is dirty in the caches, you move the old stale data
during GC and write the new data soon after.  And you always flush the
caches after GC, even if your machine has no better use for the memory.

So unless I missed something important, I believe the locking is well
worth the effort.

BTW: Some of the explanation you just gave me would do well as
documentation in the source file as well.  That's the sort of background
information new developers can spend month of mistakes and reverse
engineering on. :)

Jörn

-- 
Those who come seeking peace without a treaty are plotting.
-- Sun Tzu
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/27] nilfs2: continuous snapshotting file system, Ryusuke Konishi, (Sun Sep 14, 12:07 pm)
[PATCH 01/27] nilfs2: add document, Ryusuke Konishi, (Sun Sep 14, 12:07 pm)
[PATCH 02/27] nilfs2: disk format and userland interface, Ryusuke Konishi, (Sun Sep 14, 12:07 pm)
[PATCH 03/27] nilfs2: add inode and other major structures, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 04/27] nilfs2: integrated block mapping, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 05/27] nilfs2: B-tree based block mapping, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 06/27] nilfs2: direct block mapping, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 07/27] nilfs2: B-tree node cache, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 08/27] nilfs2: buffer and page operations, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 09/27] nilfs2: meta data file, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 10/27] nilfs2: persistent object allocator, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 11/27] nilfs2: disk address translator, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 12/27] nilfs2: inode map file, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 13/27] nilfs2: checkpoint file, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 14/27] nilfs2: segment usage file, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 15/27] nilfs2: inode operations, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 16/27] nilfs2: file operations, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 17/27] nilfs2: directory entry operations, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 18/27] nilfs2: pathname operations, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 19/27] nilfs2: operations for the_nilfs core object, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 20/27] nilfs2: super block operations, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 21/27] nilfs2: segment buffer, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 22/27] nilfs2: segment constructor, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 23/27] nilfs2: recovery functions, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 24/27] nilfs2: another dat for garbage collection, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 25/27] nilfs2: block cache for garbage collection, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 26/27] nilfs2: ioctl operations, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
[PATCH 27/27] nilfs2: update makefile and Kconfig, Ryusuke Konishi, (Sun Sep 14, 12:08 pm)
Re: [PATCH 01/27] nilfs2: add document, Pavel Machek, (Mon Sep 15, 2:54 am)
Re: [PATCH 18/27] nilfs2: pathname operations, Pekka Enberg, (Mon Sep 15, 11:20 am)
Re: [PATCH 01/27] nilfs2: add document, konishi.ryusuke, (Mon Sep 15, 1:10 pm)
Re: [PATCH 18/27] nilfs2: pathname operations, konishi.ryusuke, (Mon Sep 15, 10:31 pm)
Re: [PATCH 01/27] nilfs2: add document, Chris Mason, (Tue Sep 16, 6:38 am)
Re: [PATCH 01/27] nilfs2: add document, Jörn, (Wed Sep 17, 7:54 am)
Re: [PATCH 02/27] nilfs2: disk format and userland interface, Ryusuke Konishi, (Wed Sep 17, 8:51 am)
Re: [PATCH 01/27] nilfs2: add document, Ryusuke Konishi, (Wed Sep 17, 10:52 am)
Re: [PATCH 25/27] nilfs2: block cache for garbage collection, Ryusuke Konishi, (Wed Sep 17, 12:09 pm)
Re: [PATCH 25/27] nilfs2: block cache for garbage collection, Jörn, (Wed Sep 17, 3:49 pm)
Re: [PATCH 25/27] nilfs2: block cache for garbage collection, Ryusuke Konishi, (Sat Sep 20, 3:43 am)