Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754800AbZG1QOn (ORCPT ); Tue, 28 Jul 2009 12:14:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754703AbZG1QOm (ORCPT ); Tue, 28 Jul 2009 12:14:42 -0400 Received: from sj-iport-2.cisco.com ([171.71.176.71]:29964 "EHLO sj-iport-2.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754554AbZG1QOl (ORCPT ); Tue, 28 Jul 2009 12:14:41 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAOTAbkqrR7PD/2dsb2JhbAC9U4gnj3oFhAyCLw X-IronPort-AV: E=Sophos;i="4.43,284,1246838400"; d="scan'208";a="190378576" From: Roland Dreier To: Andrew Morton Cc: linux-kernel@vger.kernel.org, jsquyres@cisco.com, rostedt@goodmis.org Subject: Re: [PATCH v2] ummunotify: Userspace support for MMU notifications References: <20090722111538.58a126e3.akpm@linux-foundation.org> <20090722124208.97d7d9d7.akpm@linux-foundation.org> <20090727165329.4acfda1c.akpm@linux-foundation.org> X-Message-Flag: Warning: May contain useful information Date: Tue, 28 Jul 2009 09:14:40 -0700 In-Reply-To: <20090727165329.4acfda1c.akpm@linux-foundation.org> (Andrew Morton's message of "Mon, 27 Jul 2009 16:53:29 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-OriginalArrivalTime: 28 Jul 2009 16:14:41.0080 (UTC) FILETIME=[8303E380:01CA0F9E] Authentication-Results: sj-dkim-3; header.From=rdreier@cisco.com; dkim=pass ( sig from cisco.com/sjdkim3002 verified; ); Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2059 Lines: 50 > > +config UMMUNOTIFY > > + tristate "Userspace MMU notifications" > > + select MMU_NOTIFIER > Does `select' dtrt here if UMMUNOTIFY=m? I never trust it... Yes, it appears to when I test... and all the other users (KVM, SGI_GRU) of MMU_NOTIFIER are tristates that select it, so in practice it seems to work as well. > > > Oh well :( > > A little test app would be nice - I assume you have one. We could toss > in in the tree as a how-to-use example, and people could perhaps turn > it into a regression test - perhaps the LTP people would take it. I'll write up a bit of doc and stick it in Documentation/ummunotify.txt, and create samples/ummunotify/ as well for the next iteration. > > + if (test_bit(UMMUNOTIFY_FLAG_HINT, ®->flags)) { > > + clear_bit(UMMUNOTIFY_FLAG_HINT, ®->flags); > > + } else { > > + set_bit(UMMUNOTIFY_FLAG_HINT, ®->flags); > It's a shame that change_bit() didn't return the old (or new) value. Heh, I didn't know about change_bit(). ... seems like test_and_change_bit() is exactly what would fit here. Will update. > The overall userspace interface seems a bit klunky, but I can't really > suggest anything better. Netlink delivery? I took a quick look at netlink but discarded the idea when I saw that netlink sockets don't support mmap() ... seems that plumbing in mmap support (to handle the kernel exported generation count) is probably more trouble than it's worth, and I'm not sure that all the netlink encapsulation is that much of a win here anyway. I'd prefer to proceed with the "virtual character device" interface -- another option would be sys_ummunotify_create and sys_ummunotify_ctl but I can't really imagine this being worth another couple syscalls. - R. -- 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/