Re: [PATCH][RFC]fix soft lock up at NFS mount by per-SB LRU-list of unused dentries

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Kentaro Makita <k-makita@...>
Cc: <linux-kernel@...>, <linux-fsdevel@...>, <akpm@...>, <dgc@...>, <viro@...>
Date: Thursday, May 22, 2008 - 6:56 pm

On Thu, May 22, 2008 at 11:22:18AM +0900, Kentaro Makita wrote:

I'd convert all the 'if (count == NULL)' to 'if (!count)' and same
for 'if (count != NULL)' to 'if (count)'....


Probably should add {} to the first branch here as well.


Indentation of the second line of the if is the same as the block of
code underneath it. Probably should read:

			if ((flags & DCACHE_REFERENCED) &&
			    (dentry->d_flags & DCACHE_REFERENCED)) {
				if (--cnt == 0)
					break;

I'm wondering if this loop is an excessively long time to be holding the
dcache_lock. I guess the hol dtime is limited by the size of *count being
passed in. I think we could also do a:

		cond_resched_lock(&dcache_lock);
	
in the loop here to prevent this from occurring....


	if (count)
		*count = cnt;
	else if (!list_empty(&sb->s_dentry_lru))
		goto restart;


unused = 100,000, count = 128 => prune_ratio = 781.

if we have 3 filesystems with 70,000, 25,000 and 5,000 dentries a piece,
that gives us:


Question on lock ordering of sb_lock vs dcache_lock - which is the inner
lock? Are the two of them held together anywhere else? (/me doesn't
have time to searchthe code right now).


70,000 -> 90
25,000 -> 33
 5,000 -> 7

Total = 130. So we will prune a small number more than is asked for. I guess
this isn't a big problem because we exit the loop if count <= 0.

Otherwise it's looking good.

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH][RFC]fix soft lock up at NFS mount by per-SB LRU-..., David Chinner, (Thu May 22, 6:56 pm)