[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Speeding up df
From: |
Bernhard Voelker |
Subject: |
Re: Speeding up df |
Date: |
Sun, 31 Jul 2016 21:33:19 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 |
@Padraig:
I'll be away from keyboard the next 3 weeks, so please continue
with this one to finally push.
On 07/25/2016 01:21 PM, Philipp Thomas wrote:
> * Pádraig Brady (address@hidden) [20160725 01:20]:
>
>>> otherwise it looks good to me.
>>
>> Excellent. +1
>
> I'll pass on your kind words to my collegue.
>
>> Worth a mention in improvements in NEWS too.
>
> Like so?
>
> + Df now uses a hash table to filter the mount list. This sped up
> + processing of a 22000 lines mount list by nearly 60%.
>
> If yes and Bernies explains me why we'd need an additional hash_free call
> I'll post the changed patch.
Thanks. I wrapped this into a patch with a nice commit message.
I also squashed in the renaming of the 'devlist' variable, as that
many "devlists" were too confusing.
I see this hashing as a starting point, as other functions also need
a better lookup ... and to avoid superfluous stat/statfs calls (see
e.g. "strace -e stat,statfs df -a").
BTW: surprisingly, one can get a HUGE /proc/self/mountinfo very easily:
# !!! DO NOT DO THIS (with "seq 25") !!!
mkdir /root/tmp &&
for f in $(seq 25); do \
mkdir /root/tmp/$f \
&& mount --bind / /root/tmp/$f
done
To get the 20.000-30.000 entries, you only need ~"seq 16".
Have a nice day,
Berny
0001-df-improve-performance-with-many-mount-points.patch
Description: Text Data