Re: [PATCH 3/3] Avoid doing extra 'lstat()'s for d_type if we have an up-to-date cache entry

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

 



Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> writes:

>> > +		if (!ce_uptodate(ce))
>> > +			break;	/* continue? */
>> 
>> I think this should be continue, as the directory D you are interested in
>> may have two files, one modified, the other uptodate.
>
> The thing is, the directory may have subdirectories, and there may be 
> tens of thousands of files there. And maybe this gets called by code that 
> hasn't done any cache preloading at all, so nothing will be up-to-date.
>
> Do we want to loop over thousands of entries? Or do we want to loop as 
> little as possible, and just say "most of the time the first entry will be 
> representative".

Ah, I see.

It depends on how expensive it is to iterate over an in-core array to
check a single bit (that may not even have been updated) in the cache
entries, compared to an extra lstat().  Perhaps we could autotune that,
but it probably is not worth it. ;-)

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

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]