Re: [PATCH 2/2] Btrfs: load the key from the dir item in readdir into a fake dentry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/26/2011 02:50 PM, Andi Kleen wrote:
> Josef Bacik <josef@xxxxxxxxxx> writes:
>> +
>> +				newkey = kzalloc(sizeof(struct btrfs_key),
>> +						 GFP_NOFS);
>> +				if (!newkey)
>> +					goto no_dentry;
>> +				tmp = d_alloc(filp->f_dentry, &q);
> 
> This doesn't seem to address the "find / fills all memory with dentries"
> concerns brought up earlier at all.
> 

Nope, this part does in patch 1/1

+	/*
+	 * If this dentry needs lookup, don't set the referenced flag so that it
+	 * is more likely to be cleaned up by the dcache shrinker in case of
+	 * memory pressure.
+	 */
+	if (!d_need_lookup(dentry))
+		dentry->d_flags |= DCACHE_REFERENCED;


> d_alloc uses a normal GFP_KERNEL, which is quite in appropiate for this.
> 
> It should at least reclaim and probably more, but even then it's
> risky.
> 

Ah yeah I guess I should have probably used GFP_KERNEL.  Sorry about that,

Josef
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux