kernels/linux-2.4.0/fs/dcache.c
/*
 * This is called from kswapd when we think we need some
 * more memory, but aren't really sure how much. So we
 * carefully try to free a _bit_ of our dcache, but not
 * too much.
 *
 * Priority:
 *   0 - very urgent: shrink everything
 *  ...
 *   6 - base-level: try to shrink a bit.
 */
This is called from kswapd when we think we need some
more memory, but aren't really sure how much. So we
carefully try to free a _bit_ of our dcache, but not
too much.

very urgent: shrink everything

6 - base-level: try to shrink a bit.
This is called from kswapd when we think we need some more memory but aren ' t really sure how much . So we carefully try to free a _bit_ of our dcache but not too much . very urgent : shrink everything 6 - base - level : try to shrink a bit .
void shrink_dcache_memory(int priority, unsigned int gfp_mask)
{
	int count = 0;
	if (!(gfp_mask & __GFP_IO))
		return;
	if (priority)
		count = dentry_stat.nr_unused / priority;
	prune_dcache(count);
	kmem_cache_shrink(dentry_cache);
}
void shrink_dcache_memory ( int priority , unsigned int gfp_mask ) { int count = 0 ; if ( ! ( gfp_mask & __GFP_IO ) ) return ; if ( priority ) count = dentry_stat . nr_unused / priority ; prune_dcache ( count ) ; kmem_cache_shrink ( dentry_cache ) ; }
This is called from kswapd when we think we need some
 more memory, but aren't really sure how much.
This is called from kswapd when we think we need some more memory but aren ' t really sure how much .
/*
	 * Nasty deadlock avoidance.
	 *
	 * ext2_new_block->getblk->GFP->shrink_dcache_memory->prune_dcache->
	 * prune_one_dentry->dput->dentry_iput->iput->inode->i_sb->s_op->
	 * put_inode->ext2_discard_prealloc->ext2_free_blocks->lock_super->
	 * DEADLOCK.
	 *
	 * We should make sure we don't hold the superblock lock over
	 * block allocations, but for now:
	 */