[kde-freebsd] Re: QFilesSystemWatcher instead of polling/FAM
Raphael Kubo da Costa
kubito at gmail.com
Sat Nov 6 04:13:12 CET 2010
On Friday 25 June 2010 13:37:53 Tijl Coosemans wrote:
> Hi,
>
> KDE currently uses polling to detect file and directory changes on
> FreeBSD, which can use up cpu time (and laptop battery power). The
> kded4 process seems to make heavy use of this and currently
> continuously consumes about 5% of my cpu and often causes it to be
> throttled up by powerd.
>
> I've attached a patch that makes KDE use QFileSystemWatcher on FreeBSD
> which uses kqueue instead of stat. I've been using it for the past few
> days and it seems to work rather well.
>
> One thing I'm not sure about is whether it works with NFS, so it could
> use some more testing. If you'd like to test it, replace
> /usr/ports/x11/kdelibs4/files/patch-kio-kio-kdirwatch.cpp with the
> attached patch and reinstall kdelibs.
Hello everyone,
I have some good news.
Some days ago I was talking to David Faure on IRC and told him the kdirwatch
unit tests were all passing only using the (Linux-only) inotify backend, which
he confirmed. This means the situation should be much better on non-Linux
systems now with regard to this part of the code.
Today, he has made a lot of commits to the kdirwatch code, and all the unit
tests have passed here using the Stat, Fam and QFSWatcher backends. He said
all his commits can be backported, and I'll look into that with him next week.
His commits include a lot of code cleanup besides bug fixes. I told him we
were using Tijl's patches in the ports tree, and he said
<dfaure> gah there are fixes in that first patch which I just made today
<dfaure> most of my qfswatch-related fixes were in there
<dfaure> you can tell him it was a good patch. I just wish I had seen it
earlier
As I always say, let's try to upstream as much as we can.
If you guys want to give the patches a try, they're commits 1193411, 1193413,
1193414, 1193424, 1193435, 1193436, 1193437, 1193441 and 1193442.
I also mentioned Tijl's merge request to Qt and that we already use it in the
ports tree. So now FreeBSD also uses the QFSWatcher backend by default now
instead of the Stat one, and Fam is the preferred NFS backend (it falls back
to Stat automatically so there should be no regression from the patch we
currently have).
Cheers,
Raphael
More information about the kde-freebsd
mailing list