From owner-freebsd-gnome@FreeBSD.ORG Sun Feb 12 20:43:46 2006 Return-Path: X-Original-To: gnome@freebsd.org Delivered-To: freebsd-gnome@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 799F616A420; Sun, 12 Feb 2006 20:43:46 +0000 (GMT) (envelope-from jylefort@FreeBSD.org) Received: from host-212-68-242-42.brutele.be (host-212-68-242-42.brutele.be [212.68.242.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1238E43D45; Sun, 12 Feb 2006 20:43:44 +0000 (GMT) (envelope-from jylefort@FreeBSD.org) Received: from jsite.lefort.net (jsite.lefort.net [192.168.1.2]) by gateway.lefort.net (Postfix) with ESMTP id 68519549A; Sun, 12 Feb 2006 21:43:38 +0100 (CET) Received: from jsite.lefort.net (localhost [127.0.0.1]) by jsite.lefort.net (Postfix) with SMTP id 17BCAC10F; Sun, 12 Feb 2006 21:43:38 +0100 (CET) Date: Sun, 12 Feb 2006 21:43:37 +0100 From: Jean-Yves Lefort To: Joe Marcus Clarke Message-Id: <20060212214337.3e77f804.jylefort@FreeBSD.org> In-Reply-To: <1139730552.91280.4.camel@shumai.marcuscom.com> References: <1139185642.25725.167.camel@wolverine> <1139187760.730.10.camel@shumai.marcuscom.com> <1139647425.79253.4.camel@shumai.marcuscom.com> <1139674838.37533.78.camel@wolverine> <1139685927.59900.1.camel@shumai.marcuscom.com> <1139713316.37533.84.camel@wolverine> <1139713404.59900.36.camel@shumai.marcuscom.com> <1139726108.12426.18.camel@shumai.marcuscom.com> <1139730552.91280.4.camel@shumai.marcuscom.com> X-Mailer: Sylpheed running on FreeBSD Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Sun__12_Feb_2006_21_43_37_+0100_dn3z.OUviL+EQdk/" Cc: gnome@freebsd.org, ssouhlal@freebsd.org Subject: Re: problems rhythmbox 0.9.3.1 X-BeenThere: freebsd-gnome@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GNOME for FreeBSD -- porting and maintaining List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2006 20:43:46 -0000 --Signature=_Sun__12_Feb_2006_21_43_37_+0100_dn3z.OUviL+EQdk/ Content-Type: multipart/mixed; boundary="Multipart=_Sun__12_Feb_2006_21_43_37_+0100_W4RVMAzqVpqJzp43" --Multipart=_Sun__12_Feb_2006_21_43_37_+0100_W4RVMAzqVpqJzp43 Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, 12 Feb 2006 02:49:12 -0500 Joe Marcus Clarke wrote: > On Sun, 2006-02-12 at 01:35 -0500, Joe Marcus Clarke wrote: > > On Sat, 2006-02-11 at 22:03 -0500, Joe Marcus Clarke wrote: > > > On Sun, 2006-02-12 at 11:01 +0800, Khairil Yusof wrote: > > > > On Sat, 2006-02-11 at 14:25 -0500, Joe Marcus Clarke wrote: > > > >=20 > > > > > And I am also loading songs over NFS....hmmm. What FAM system ar= e you > > > > > using? > > > >=20 > > > > gamin with WANT_FAM_SYSTEM=3Dgamin in /etc/make.conf > > >=20 > > > You should be setting WITH_FAM_SYSTEM in make.conf now. In any event, > > > I'm using gamin as well. > >=20 > > I found the problem. Since gamin is looking at NOTE_ATTRIB for changes, > > even a file access change will trigger a FAM changed event. And since > > such an event triggers a reload of the changed file in r-b, the > > attributes change again, and then r-b loads the file again, ... and so > > on. > >=20 > > It seems to me r-b is being too aggressive in what it considers a > > change. I think a good solution might be to change > > rhythmdb_check_changed_file() in rhythmdb.c to always return TRUE. This > > will remove the "changed" file from the list of changed files, and it > > should never trigger this cycle. > >=20 > > I'll give this a try, and let you know. >=20 > Sorry, this doesn't work. On closer inspection, all events would be > ignored by r-b if this was done. I've copied Jean-Yves and Suleiman on > this to get their opinion. I checked how Linux's inotify works, and > they have separate events for st_atime changing vs. other attributes > (IN_ACCESS vs. IN_ATTRIB). Perhaps we should do something similar. >=20 > In the meantime, the best solutions I can come up with are to disable > NOTE_ATTRIB processing in gamin, or turn off library monitoring in > rhythmbox. The problem is specific to NFS: I don't receive NOTE_ATTRIB events when I read a file on an UFS file system [1]. I've attached a patch which forces polling for remote file systems. I'll commit it if Khairil Yusof confirms that it fixes his problem. [1] This is a kernel bug; if it is fixed, the problem described above will resurface, and we'll probably have to disable NOTE_ATTRIB as Joe suggests. --=20 Jean-Yves Lefort jylefort@FreeBSD.org http://lefort.be.eu.org/ --Multipart=_Sun__12_Feb_2006_21_43_37_+0100_W4RVMAzqVpqJzp43 Content-Type: text/plain; name="gamin.diff" Content-Disposition: attachment; filename="gamin.diff" Content-Transfer-Encoding: quoted-printable diff -ruN /usr/ports/devel/gamin/Makefile gamin/Makefile --- /usr/ports/devel/gamin/Makefile Sat Feb 11 07:58:29 2006 +++ gamin/Makefile Sun Feb 12 21:29:55 2006 @@ -7,7 +7,7 @@ =20 PORTNAME=3D gamin PORTVERSION=3D 0.1.7 -PORTREVISION?=3D 1 +PORTREVISION?=3D 2 CATEGORIES?=3D devel MASTER_SITES=3D http://www.gnome.org/~veillard/gamin/sources/ =20 diff -ruN /usr/ports/devel/gamin/files/patch-server_gam_kqueue.c gamin/file= s/patch-server_gam_kqueue.c --- /usr/ports/devel/gamin/files/patch-server_gam_kqueue.c Thu Feb 9 07:40= :17 2006 +++ gamin/files/patch-server_gam_kqueue.c Sun Feb 12 21:29:13 2006 @@ -1,20 +1,25 @@ --- server/gam_kqueue.c.orig Wed Aug 10 23:50:32 2005 -+++ server/gam_kqueue.c Wed Feb 8 12:43:52 2006 -@@ -10,9 +10,8 @@ ++++ server/gam_kqueue.c Sun Feb 12 21:28:26 2006 +@@ -10,9 +10,10 @@ * FAM should do: we do not call g_dir_open() if the file is a * symbolic link). * - * * kqueue cannot monitor files residing on anything but a UFS - * file system. If kqueue cannot monitor a file, this backend - * will poll it periodically. -+ * * kqueue can only monitor files residing on a UFS file system. -+ * For other file systems, the basic poll backend will be used. ++ * * While kqueue is no longer tied to the UFS file system, it is ++ * better to not use it for remote file systems (because for ++ * such file systems, only local changes are detected by ++ * the kernel). * * * Monitoring a file with kqueue prevents the file system it * resides on from being unmounted, because kqueue can only -@@ -31,7 +30,8 @@ - * - kqueue needs to be moved out the UFS code. +@@ -28,10 +29,9 @@ + * - kqueue needs to be augmented with a filename-based + * monitoring facility; * +- * - kqueue needs to be moved out the UFS code. +- * * Copyright (C) 2005 Joe Marcus Clarke - * Copyright (C) 2005 Jean-Yves Lefort + * Copyright (C) 2005, 2006 Jean-Yves Lefort @@ -22,7 +27,17 @@ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public -@@ -63,7 +63,7 @@ +@@ -53,6 +53,9 @@ + #include + #include + #include ++#ifndef USE_GAMIN_POLLER ++#include ++#endif + #include + #include + #include +@@ -63,7 +66,7 @@ #include "gam_kqueue.h" #include "gam_event.h" #include "gam_server.h" @@ -31,7 +46,17 @@ =20 /*** tunable constants, modify to tweak the backend aggressivity ********= *****/ =20 -@@ -516,7 +516,7 @@ +@@ -509,6 +512,9 @@ + gam_kqueue_monitor_enable_kqueue (Monitor *mon) + { + struct kevent ev[1]; ++#ifndef USE_GAMIN_POLLER ++ struct statfs sb; ++#endif +=20 + if (open_files =3D=3D max_open_files) + { +@@ -516,26 +522,36 @@ return FALSE; } =20 @@ -40,7 +65,41 @@ if (mon->fd < 0) { GAM_DEBUG(DEBUG_INFO, "cannot open %s (%s), falling back to poll\n"= , mon->pathname, g_strerror(errno)); -@@ -840,6 +840,8 @@ + return FALSE; + } +=20 ++#ifndef USE_GAMIN_POLLER ++ if (fstatfs(mon->fd, &sb) =3D=3D 0 && (sb.f_flags & MNT_LOCAL) =3D=3D 0) ++ { ++ GAM_DEBUG(DEBUG_INFO, "%s resides on a remote file system, falling = back to poll\n", mon->pathname); ++ goto poll; ++ } ++#endif ++ + EV_SET(ev, mon->fd, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_CLEAR, VN_NOT= E_ALL, 0, mon); + if (kevent(kq, ev, G_N_ELEMENTS(ev), NULL, 0, NULL) < 0) + { + GAM_DEBUG(DEBUG_INFO, "cannot enable kqueue notification for %s (%s= ), falling back to poll\n", mon->pathname, g_strerror(errno)); +- +- close(mon->fd); +- mon->fd =3D -1; +- +- return FALSE; ++ goto poll; + } +=20 + open_files++; + return TRUE; ++ ++ poll: ++ close(mon->fd); ++ mon->fd =3D -1; ++ ++ return FALSE; + } +=20 + static void +@@ -840,6 +856,8 @@ case GAMIN_EVENT_MOVED: gam_kqueue_sub_monitor_set_missing(smon); break; @@ -49,7 +108,7 @@ } =20 gam_server_emit_event(mon->pathname, isdir, event, smon->subs, 1); -@@ -981,6 +983,8 @@ +@@ -981,6 +999,8 @@ =09 gam_kqueue_hash_table_remove(fmon->smon->fmons, fmon); break; @@ -58,7 +117,7 @@ } } =20 -@@ -1167,11 +1171,13 @@ +@@ -1167,11 +1187,13 @@ channel =3D g_io_channel_unix_new(kq); g_io_add_watch(channel, G_IO_IN, gam_kqueue_kevent_cb, NULL); =20 --Multipart=_Sun__12_Feb_2006_21_43_37_+0100_W4RVMAzqVpqJzp43-- --Signature=_Sun__12_Feb_2006_21_43_37_+0100_dn3z.OUviL+EQdk/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFD7535yzD7UaO4AGoRAnWiAJsE/vxAwk6cihgiBHcgX8GCYHhcAQCeIc0q TQ/O0d4U6P8P0dKSEZ2isMQ= =ELan -----END PGP SIGNATURE----- --Signature=_Sun__12_Feb_2006_21_43_37_+0100_dn3z.OUviL+EQdk/--