All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Donald Becker <becker@scyld.com>
Cc: "David S. Miller" <davem@redhat.com>,
	jmorris@intercode.com.au, kuznet@ms2.inr.ac.ru,
	netdev@oss.sgi.com, linux-security-module@wirex.com
Subject: Re: [PATCH] LSM networking: skb hooks for 2.5.42 (2/7)
Date: Tue, 15 Oct 2002 12:16:26 -0700	[thread overview]
Message-ID: <20021015191626.GD15420@kroah.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0210151353450.1159-100000@beohost.scyld.com>

On Tue, Oct 15, 2002 at 02:14:01PM -0400, Donald Becker wrote:
>   - Your method adds a bunch of hooks when just one would do.

How would you propose a single hook?  Specify the action in the hook?
Linus has already rejected this idea :)

> The usual approach is
>    if (obj->hookfun)  obj->hookfun(obj, method_index, other_params);
> 
> Even this makes the code less readable, but at least doesn't jump all
> over the instruction space.  The impact is a dereference and a test for
> zero, and then a jump over a push/mov instructions for values that
> should already be in registers.

Linus has stated that he didn't want the check and then jump, but an
unconditional jump (even if the function is nothing but a return.)  I
guess this is faster as the processor doesn't have to guess at branch
prediction.  That's why we built these calls in this way.

That being said, a number of people have asked that the networking hooks
be able to "be compiled away", so we will be glad to do this.

thanks,

greg k-h

  reply	other threads:[~2002-10-15 19:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-15 14:36 [PATCH] LSM networking: skb hooks for 2.5.42 (2/7) James Morris
2002-10-15 17:40 ` David S. Miller
2002-10-15 18:14   ` Donald Becker
2002-10-15 19:16     ` Greg KH [this message]
2002-10-15 19:34       ` David S. Miller
2002-10-15 19:45         ` Greg KH
2002-10-15 19:45           ` David S. Miller
2002-10-15 20:12             ` Greg KH
2002-10-15 20:10               ` David S. Miller
2002-10-15 20:28                 ` Greg KH
2002-10-15 20:24                   ` David S. Miller
2002-10-16  0:07                   ` [RFC] change format of LSM hooks Greg KH
2002-10-16  0:03                     ` David S. Miller
2002-10-16  8:15                     ` Greg KH
2002-10-16 18:59                       ` Greg KH
2002-10-16 16:33                         ` joe perches
2002-10-16 23:46                           ` Greg KH
2002-10-16 23:56                             ` David S. Miller
2002-10-16 19:07                         ` Greg KH
2002-10-17  1:41                     ` Rusty Russell
2002-10-17  3:33                       ` Daniel Phillips
2002-10-17 13:21                     ` Christoph Hellwig
2002-10-17 16:55                       ` Greg KH
2002-10-19  2:33                 ` [PATCH] LSM networking: skb hooks for 2.5.42 (2/7) Keith Owens
2002-10-19  2:54                   ` Keith Owens
2002-10-19  3:29                     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021015191626.GD15420@kroah.com \
    --to=greg@kroah.com \
    --cc=becker@scyld.com \
    --cc=davem@redhat.com \
    --cc=jmorris@intercode.com.au \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-security-module@wirex.com \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.