From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nix Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Added inotify support. Date: Sat, 06 Oct 2012 19:51:32 +0100 Message-ID: <87626ntowb.fsf@spindle.srvr.nix> References: <2181827.T3JxG88qQt@descartes> <83lifoa7hr.fsf@gnu.org> <87obkkcu92.fsf@wanadoo.es> <87lifkvoxl.fsf@spindle.srvr.nix> <87ehlbtv0r.fsf@spindle.srvr.nix> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1349549506 15966 80.91.229.3 (6 Oct 2012 18:51:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Oct 2012 18:51:46 +0000 (UTC) Cc: =?utf-8?Q?=C3=93scar?= Fuentes , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 06 20:51:52 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TKZTZ-0001aL-N6 for ged-emacs-devel@m.gmane.org; Sat, 06 Oct 2012 20:51:49 +0200 Original-Received: from localhost ([::1]:46839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKZTT-0005mg-Tj for ged-emacs-devel@m.gmane.org; Sat, 06 Oct 2012 14:51:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKZTR-0005mZ-Pm for emacs-devel@gnu.org; Sat, 06 Oct 2012 14:51:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TKZTQ-0004WL-5J for emacs-devel@gnu.org; Sat, 06 Oct 2012 14:51:41 -0400 Original-Received: from icebox.esperi.org.uk ([81.187.191.129]:58954 helo=mail.esperi.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKZTP-0004Uj-RH for emacs-devel@gnu.org; Sat, 06 Oct 2012 14:51:40 -0400 Original-Received: from spindle.srvr.nix (nix@spindle.srvr.nix [192.168.14.15]) by mail.esperi.org.uk (8.14.5/8.14.5) with ESMTP id q96IpWio000793; Sat, 6 Oct 2012 19:51:32 +0100 Emacs: it's not slow --- it's stately. In-Reply-To: (Stefan Monnier's message of "Sat, 06 Oct 2012 13:01:03 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) X-DCC-STAT_FI_X86_64_VIRTUAL-Metrics: spindle 1245; Body=3 Fuz1=3 Fuz2=3 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 81.187.191.129 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:154135 Archived-At: On 6 Oct 2012, Stefan Monnier stated: >>> - can we reliably determine whether it will work? >> No :( you get that subset of events that happened on the local machine >> only, but even I ran Emacs on the server, it would see a local >> filesystem but would *still* miss events -- those happening on the >> desktop. > > That's a misfeature that should be easy to fix (in the kernel): any FS > should be able to indicate whether it will reliably send > inotify notices, so that client code can be told when it requests > inotify events for a particular object whether it will work reliably. Unfortunately not, because e.g. a perfectly normal local ext4 filesystem can be unreliable if it is NFS-exported -- worse, it can be *partially* unreliable if only a subtree is exported, and it can flip between reliable and potentially unreliable on the fly as you export or unexport filesystems. >>> IIUC inotify works reliably for local file-systems (even if they're >>> exported because the other hosts's actions will be locally performed >>> by the nfsd) >> Those don't always appear :( the nfsd doesn't do all its actions at a >> level that inotify can see, alas, > > If nfsd applies a modification and it's not reflected with some inotify > event, I think that's a bug that the kernel developers would want to fix. They don't care. If an event doesn't come through the normal VFS layers, inotify won't see it, and that's that. >>> Can inotify inform Emacs that its notices won't be reliable (so Emacs >>> can decide to use polling instead)? >> I don't think so. The answer in any case is 'inotify is never reliable': >> even if the FS is not exported across the network and never becomes >> exportted across the network, the queue can fill up and lose events and >> the like. > > Can't that be fixed by making it possible to "compress" the queue, > e.g. replace a bunch of events on FILE with a single "something happened > to FILE", or in the worst case replace all the events with a single > "queue filled up, all the files might have been modified in arbitrary > ways". Theoretically, yes, only that would require you to look at previously queued events, which soon gets you into locking horrors. (As a first approximation, *anything* to do with the filesystem soon gets you into locking horrors.) > This would let it be reliable even in the face of lost events. > >>> Aren't they used by most GUI file managers? >> Yes. If you have an NFS-mounted home directory, you get used to hitting >> refresh in GUI file managers :( > > So there's nothing for Emacs to worry about, because Emacs won't fix > those issues. Oh yes, indeed. I'm just arguing against ripping out polling and replacing it with inotify, really: we need at least a customization knob for people who know their filesystems are NFS-exported or otherwise network-affected to tweak to say 'poll, please'. -- NULL && (void)