From: shenghui Subject: Re: [PATCH] fix return value for mb_cache_shrink_fn when nr_to_scan > 0 Date: Tue, 20 Jul 2010 09:02:57 +0800 Message-ID: References: <4C425273.5000702@gmail.com> <20100718060106.GA579@infradead.org> <4C42A10B.2080904@gmail.com> <201007192039.06670.agruen@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Christoph Hellwig , Eric Sandeen , linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk, linux-mm@kvack.org, linux-ext4 , kernel-janitors To: Andreas Gruenbacher Return-path: In-Reply-To: <201007192039.06670.agruen@suse.de> Sender: owner-linux-mm@kvack.org List-Id: linux-ext4.vger.kernel.org 2010/7/20 Andreas Gruenbacher : > On Sunday 18 July 2010 08:36:59 Wang Sheng-Hui wrote: >> I regenerated the patch. Please check it. > > The logic for calculating how many objects to free is still wrong: > mb_cache_shrink_fn returns the number of entries scaled by > sysctl_vfs_cache_pressure / 100. =C2=A0It should also scale nr_to_scan by= the > inverse of that. =C2=A0The sysctl_vfs_cache_pressure =3D=3D 0 case (never= scale) may > require special attention. > > See dcache_shrinker() in fs/dcache.c. > > Thanks, > Andreas > Sorry, I haven't found any special attention on sysctl_vfs_cache_pressure =3D=3D 0 case or scale nr_to_scan in fs/dcache.c 900static int shrink_dcache_memory(int nr, gfp_t gfp_mask) 901{ 902 if (nr) { 903 if (!(gfp_mask & __GFP_FS)) 904 return -1; 905 prune_dcache(nr); 906 } 907 return (dentry_stat.nr_unused / 100) * sysctl_vfs_cache_pressur= e; 908} --=20 Thanks and Best Regards, shenghui -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org