Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752147Ab1FNDwn (ORCPT ); Mon, 13 Jun 2011 23:52:43 -0400 Received: from mail-yi0-f46.google.com ([209.85.218.46]:62734 "EHLO mail-yi0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751502Ab1FNDwm (ORCPT ); Mon, 13 Jun 2011 23:52:42 -0400 Date: Tue, 14 Jun 2011 00:53:13 -0300 From: Lucas De Marchi To: Kay Sievers Cc: Andrew Morton , "Eric W. Biederman" , Alan Cox , linux-kernel@vger.kernel.org, Nick Piggin , Al Viro , Christoph Hellwig , Stephen Rothwell , David Howells , "Serge E. Hallyn" , Daniel Lezcano , Jiri Slaby , Greg Kroah-Hartman , James Morris , neilb@suse.de Subject: Re: [PATCH] sysctl: add support for poll() Message-ID: <20110614035313.GA1229@vigoh> References: <20110602134338.0c56160e@lxorguk.ukuu.org.uk> <20110608151732.2b321b9a.akpm@linux-foundation.org> <1307981153.1449.19.camel@mop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1307981153.1449.19.camel@mop> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1939 Lines: 46 * Kay Sievers [2011-06-13 18:05:51 +0200]: > On Thu, 2011-06-09 at 15:16 +0200, Kay Sievers wrote: > > On Thu, Jun 9, 2011 at 00:17, Andrew Morton wrote: > > > > We already have several pollable procfs files, such as > > > fs/proc/base.c:mounts_poll() and I think drivers/md has one. I do > > > think that any work in this area should end up with those custom > > > make-procfs-pollable hacks being identified and removed. > > > > For these files we can probably move the event counter into the > > seq_file structure, and get rid of the dance to kmalloc it and assign > > it to seq_file->private. That might simplify the logic a bit. > > > > [Adding Neil, to get his opinion of moving 'event' so seq_file and get > > rid of the malloc dance] > > I guess, we could do something like this, which looks quite a bit > simpler by moving the poll event counter into the dynamically allocated > seq_file structure itself, instead of having private structures > allocated on top to just carry the counter (patch is just > compile-tested). > > Thanks, > Kay > > --- > drivers/md/md.c | 26 ++++++++------------------ > fs/namespace.c | 4 ++-- > fs/proc/base.c | 2 +- > include/linux/mnt_namespace.h | 1 - > include/linux/seq_file.h | 1 + > mm/swapfile.c | 29 ++++++++--------------------- > 6 files changed, 20 insertions(+), 43 deletions(-) I've successfully tested this on top of 3.0-rc3 for /proc/mounts and /proc/swaps. I've booted with systemd (that depends on mounts and swaps being pollable) and created a small test using epoll. Lucas De Marchi -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/