From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932864Ab2DKSEh (ORCPT ); Wed, 11 Apr 2012 14:04:37 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:61997 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932777Ab2DKSEd convert rfc822-to-8bit (ORCPT ); Wed, 11 Apr 2012 14:04:33 -0400 MIME-Version: 1.0 In-Reply-To: <4F85C640.3060608@zytor.com> References: <20120401125741.GA7484@p183.telecom.by> <4F78D0BA.9040709@zytor.com> <4F7F1864.8090606@zytor.com> <4F85C640.3060608@zytor.com> From: Linus Torvalds Date: Wed, 11 Apr 2012 11:04:10 -0700 X-Google-Sender-Auth: ODhzSvPPagqMH-alz-1eBaVvzxc Message-ID: Subject: Re: [PATCH] nextfd(2) To: "H. Peter Anvin" Cc: KOSAKI Motohiro , Alexey Dobriyan , akpm@linux-foundation.org, viro@zeniv.linux.org.uk, drepper@gmail.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 11, 2012 at 10:58 AM, H. Peter Anvin wrote: > > But it still has the same braindamage: one system call per loop > invocation, and we can do better.  I would much rather see fdwalk() in SUS. Why would we bother to do better? System calls are cheap, and usually you actually do want to do something about the fd, so you actually want to iterate over them. I'd much rather have simple cheap interfaces than anything else. If SuS has a F_NEXT fcntl, let's just do that thing. Much simpler than doing something more complex and then just having to emulate the simple thing in user space anyway. If a standard interface exists, we should just use it. Linus From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [PATCH] nextfd(2) Date: Wed, 11 Apr 2012 11:04:10 -0700 Message-ID: References: <20120401125741.GA7484@p183.telecom.by> <4F78D0BA.9040709@zytor.com> <4F7F1864.8090606@zytor.com> <4F85C640.3060608@zytor.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: KOSAKI Motohiro , Alexey Dobriyan , akpm@linux-foundation.org, viro@zeniv.linux.org.uk, drepper@gmail.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org To: "H. Peter Anvin" Return-path: Received: from mail-wi0-f178.google.com ([209.85.212.178]:61997 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932777Ab2DKSEd convert rfc822-to-8bit (ORCPT ); Wed, 11 Apr 2012 14:04:33 -0400 In-Reply-To: <4F85C640.3060608@zytor.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Apr 11, 2012 at 10:58 AM, H. Peter Anvin wrote: > > But it still has the same braindamage: one system call per loop > invocation, and we can do better. =A0I would much rather see fdwalk()= in SUS. Why would we bother to do better? System calls are cheap, and usually you actually do want to do something about the fd, so you actually want to iterate over them. I'd much rather have simple cheap interfaces than anything else. If SuS has a F_NEXT fcntl, let's just do that thing. Much simpler than doing something more complex and then just having to emulate the simple thing in user space anyway. If a standard interface exists, we should just use it. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html