[kde-freebsd] [patch] Digikam 2.6 - too many open files

Alberto Villa avilla at freebsd.org
Fri Jun 15 11:57:06 UTC 2012


On Friday 15 June 2012 12:48:48 Oleg Sidorkin wrote:
> Original fix is a workaround of QT behavior on MacOS - as far as I
> understand Linux is able to monitor files without opening them using
> inotify. FreeBSD has no similar functions so QT has to open each file to
> monitor it.

Yes. inotify monitors file names, kqueue monitors file descriptors.

Can you spot differences in file monitoring after you've applied your patch, 
anyway (maybe move some pictures away to let it start with the original code)? 
Due to differences in KDirWatch implementations, there is a chance that the 
final behaviour doesn't change (kqueue is able to detect modifications to 
files when monitoring a directory). In fact, it looks like code previous to 
the commit that triggered the bug was monitoring only directories, so the 
patch should have no effects apart from reduced efficiency.

Anyway there is something I don't understand. I spent some time reading 
KDirWatch code, and FAM is used by default on FreeBSD. Now, FAM uses 
Gamin, and Gamin says:

Gamin will only provide realtime notification of changes for at most n files,
where n is the minimum value between (kern.maxfiles * 0.7) and
(kern.maxfilesperproc - 200). Beyond that limit, files will be polled.

Why is digiKam failing and not just polling transparently? Is it (or most 
likely KDE-Libs) using QFileSystemWatcher instead (which uses plain kqueue 
without falling back to polling, if I remember correctly)?
-- 
Alberto Villa, FreeBSD committer <avilla at FreeBSD.org>
http://people.FreeBSD.org/~avilla

It is hard to predict, in particular about the future.
		-- Robert Storm Petersen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 314 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-freebsd/attachments/20120615/6f4009dd/attachment.sig>


More information about the kde-freebsd mailing list