| To: | Donald Becker <becker@xxxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH] LSM networking: skb hooks for 2.5.42 (2/7) |
| From: | Greg KH <greg@xxxxxxxxx> |
| Date: | Tue, 15 Oct 2002 12:16:26 -0700 |
| Cc: | "David S. Miller" <davem@xxxxxxxxxx>, jmorris@xxxxxxxxxxxxxxxx, kuznet@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx, linux-security-module@xxxxxxxxx |
| In-reply-to: | <Pine.LNX.4.44.0210151353450.1159-100000@xxxxxxxxxxxxxxxxx> |
| References: | <20021015.104014.34145167.davem@xxxxxxxxxx> <Pine.LNX.4.44.0210151353450.1159-100000@xxxxxxxxxxxxxxxxx> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
| User-agent: | Mutt/1.4i |
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 |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH] LSM networking: skb hooks for 2.5.42 (2/7), Donald Becker |
|---|---|
| Next by Date: | Re: [PATCH] LSM networking: skb hooks for 2.5.42 (2/7), David S. Miller |
| Previous by Thread: | Re: [PATCH] LSM networking: skb hooks for 2.5.42 (2/7), Donald Becker |
| Next by Thread: | Re: [PATCH] LSM networking: skb hooks for 2.5.42 (2/7), David S. Miller |
| Indexes: | [Date] [Thread] [Top] [All Lists] |