Re: [PATCH] write-tree performance problems
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Apr 20, 2005, 01:09 UTC
- Message-ID
- <Pine.LNX.4.58.0504191804180.6467@ppc970.osdl.org>
- In-Reply-To
- <200504192049.21947.mason@suse.com>
On Tue, 19 Apr 2005, Chris Mason wrote:
> > 5) right before exiting, write-tree updates the index if it made any changes.
This part won't work. It needs to do the proper locking, which means that it needs to create "index.lock" _before_ it reads the index file, and write everything to that one and then do a rename.
If it doesn't need to do the write, it can just remove index.lock without writing to it, obviously.
> The downside to this setup is that I've got to change other index users to > deal with directory entries that are there sometimes and missing other times. > The nice part is that I don't have to "invalidate" the directory entry, if it > is present, it is valid.
To me, the biggest downside is actually the complexity part, and worrying about the directory index ever getting stale. How big do the changes end up being?
Linus