netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] make lock/release_sock fast calls
@ 2004-03-31 19:24 Stephen Hemminger
  2004-04-01  4:45 ` Christoph Hellwig
  2004-04-01  7:07 ` David S. Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Hemminger @ 2004-03-31 19:24 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

lock_sock and release_sock are no longer inline, but they are called in
the critical path of many operations, so it makes sense to use register based
fastcall.

diff -Nru a/include/net/sock.h b/include/net/sock.h
--- a/include/net/sock.h	Wed Mar 31 11:13:36 2004
+++ b/include/net/sock.h	Wed Mar 31 11:13:36 2004
@@ -561,8 +561,8 @@
 extern void __release_sock(struct sock *sk);
 #define sock_owned_by_user(sk)	((sk)->sk_lock.owner)
 
-extern void lock_sock(struct sock *sk);
-extern void release_sock(struct sock *sk);
+extern void FASTCALL(lock_sock(struct sock *sk));
+extern void FASTCALL(release_sock(struct sock *sk));
 
 /* BH context may only use the following locking interface. */
 #define bh_lock_sock(__sk)	spin_lock(&((__sk)->sk_lock.slock))
diff -Nru a/net/core/sock.c b/net/core/sock.c
--- a/net/core/sock.c	Wed Mar 31 11:13:36 2004
+++ b/net/core/sock.c	Wed Mar 31 11:13:36 2004
@@ -1151,7 +1151,7 @@
 	atomic_set(&sk->sk_refcnt, 1);
 }
 
-void lock_sock(struct sock *sk)
+void fastcall lock_sock(struct sock *sk)
 {
 	might_sleep();
 	spin_lock_bh(&(sk->sk_lock.slock));
@@ -1163,7 +1163,7 @@
 
 EXPORT_SYMBOL(lock_sock);
 
-void release_sock(struct sock *sk)
+void fastcall release_sock(struct sock *sk)
 {
 	spin_lock_bh(&(sk->sk_lock.slock));
 	if (sk->sk_backlog.tail)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] make lock/release_sock fast calls
  2004-03-31 19:24 [PATCH] make lock/release_sock fast calls Stephen Hemminger
@ 2004-04-01  4:45 ` Christoph Hellwig
  2004-04-01  7:07 ` David S. Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2004-04-01  4:45 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David S. Miller, netdev

On Wed, Mar 31, 2004 at 11:24:07AM -0800, Stephen Hemminger wrote:
> lock_sock and release_sock are no longer inline, but they are called in
> the critical path of many operations, so it makes sense to use register based
> fastcall.

Not sure I agree.  If you care for performance you compile with
CONFIG_REGPARAM set, no?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] make lock/release_sock fast calls
  2004-03-31 19:24 [PATCH] make lock/release_sock fast calls Stephen Hemminger
  2004-04-01  4:45 ` Christoph Hellwig
@ 2004-04-01  7:07 ` David S. Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David S. Miller @ 2004-04-01  7:07 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

On Wed, 31 Mar 2004 11:24:07 -0800
Stephen Hemminger <shemminger@osdl.org> wrote:

> lock_sock and release_sock are no longer inline, but they are called in
> the critical path of many operations, so it makes sense to use register based
> fastcall.

I think I'll add this change when 2.6.6 opens up.

Someone haggled about CONFIG_REGPARM, but that argument is crap.
We have "FASTCALL()" for a reason, and CONFIG_REGPARM does not
obviate it.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-04-01  7:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-31 19:24 [PATCH] make lock/release_sock fast calls Stephen Hemminger
2004-04-01  4:45 ` Christoph Hellwig
2004-04-01  7:07 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).