Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 23 Feb 2002 08:06:29 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 23 Feb 2002 08:06:19 -0500 Received: from mx2.elte.hu ([157.181.151.9]:42461 "HELO mx2.elte.hu") by vger.kernel.org with SMTP id ; Sat, 23 Feb 2002 08:06:03 -0500 Date: Sat, 23 Feb 2002 16:03:14 +0100 (CET) From: Ingo Molnar Reply-To: To: Rusty Russell Cc: Linus Torvalds , Matthew Kirkwood , Benjamin LaHaise , David Axmark , William Lee Irwin III , Subject: Re: [PATCH] Lightweight userspace semaphores... In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 23 Feb 2002, Rusty Russell wrote: > 1) Interface is: open /dev/usem, pread, pwrite. i like the patch, but the interface is ugly IMO. Why not new syscalls? I think these lightweight semaphores will become an important part of Linux, so having their own syscall entries is the most correct interface, something like: sys_sem_create() sys_sem_destroy() sys_sem_down() sys_sem_up() /dev/usem is such an ... ioctl()-ish approach. It's a scalability problem as well: read()/write() has (or can have) some implicit locking that is imposed on the usem interface as well. It's a usage robustness issue as well: chroot() environments that have no /dev directory will suddenly lose a functionality of Linux. There is absolutely no problem with adding new syscalls for things like this. Plus sys_sem_create() should do some proper resource limit management, pinning down an unlimited number of pages is bad. Ingo - 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/