[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0805051928230.20837@alien.or.mcafeemobile.com>
Date: Mon, 5 May 2008 19:30:48 -0700 (PDT)
From: Davide Libenzi <davidel@...ilserver.org>
To: Andrew Morton <akpm@...ux-foundation.org>
cc: Ulrich Drepper <drepper@...hat.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
netdev@...r.kernel.org, mtk.manpages@...il.com,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH 02/18] flag parameters: socket and socketpair
On Mon, 5 May 2008, Andrew Morton wrote:
> On Mon, 5 May 2008 19:13:14 -0700 (PDT) Davide Libenzi <davidel@...ilserver.org> wrote:
>
> > On Mon, 5 May 2008, Andrew Morton wrote:
> >
> > > On Sun, 4 May 2008 23:42:46 -0400 Ulrich Drepper <drepper@...hat.com> wrote:
> > >
> > > > +static const struct flags_rmap sock_file_flags_remap[] = {
> > > > + { SOCK_CLOEXEC, O_CLOEXEC },
> > > > +};
> > > > +
> > > > asmlinkage long sys_socket(int family, int type, int protocol)
> > > > {
> > > > int retval;
> > > > struct socket *sock;
> > > > + int fflags;
> > > > +
> > > > + type = flags_remap(sock_file_flags_remap,
> > > > + ARRAY_SIZE(sock_file_flags_remap),
> > > > + type, &fflags);
> > >
> > > oh, so that's what it does.
> > >
> > > afaict we only ever remap one or two flags. Would it not be more efficient
> > > to do that inline? Something along the lines of:
> > >
> > > type = flag_remap(type, &fflags, SOCK_whatever, O_whatever);
> > > type = flag_remap(type, &fflags, SOCK_whatever2, O_whatever2);
> > >
> > > ?
> >
> > I think it is better to keep it able to remap more than one flag, with a
> > single call, that is table driven.
> >
>
> The table-driven approach is slower for one and probably two bits and it is
> somewhat less readable. What do we gain in return for this?
I think we can spend a few hours countering each other Pros&Cons about
performance, size, style, etc...
Not worth if you ask me. So if you like the other way better, ask Uli to
fix it your way.
- Davide
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists