Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Change MCLGET, so that it calls m_clget instead of doing...



details:   https://anonhg.NetBSD.org/src/rev/cf15df8c076e
branches:  trunk
changeset: 322248:cf15df8c076e
user:      maxv <maxv%NetBSD.org@localhost>
date:      Thu Apr 26 19:13:34 2018 +0000

description:
Change MCLGET, so that it calls m_clget instead of doing the work in a
macro. Macros are inefficient when they contain too many instructions and
are used too often, because of cache coherency (and also register use).

This change saves 32KB of kernel .text.

diffstat:

 sys/kern/uipc_mbuf.c |  6 +++---
 sys/sys/mbuf.h       |  4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r fadbd58ecb3a -r cf15df8c076e sys/kern/uipc_mbuf.c
--- a/sys/kern/uipc_mbuf.c      Thu Apr 26 18:56:18 2018 +0000
+++ b/sys/kern/uipc_mbuf.c      Thu Apr 26 19:13:34 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_mbuf.c,v 1.196 2018/04/26 08:31:36 maxv Exp $     */
+/*     $NetBSD: uipc_mbuf.c,v 1.197 2018/04/26 19:13:34 maxv Exp $     */
 
 /*
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.196 2018/04/26 08:31:36 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.197 2018/04/26 19:13:34 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mbuftrace.h"
@@ -653,7 +653,7 @@
 m_clget(struct mbuf *m, int nowait)
 {
 
-       MCLGET(m, nowait);
+       _MCLGET(m, mcl_cache, MCLBYTES, nowait);
 }
 
 #ifdef MBUFTRACE
diff -r fadbd58ecb3a -r cf15df8c076e sys/sys/mbuf.h
--- a/sys/sys/mbuf.h    Thu Apr 26 18:56:18 2018 +0000
+++ b/sys/sys/mbuf.h    Thu Apr 26 19:13:34 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mbuf.h,v 1.189 2018/04/24 08:10:32 maxv Exp $  */
+/*     $NetBSD: mbuf.h,v 1.190 2018/04/26 19:13:34 maxv Exp $  */
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -531,7 +531,7 @@
 /*
  * The standard mbuf cluster pool.
  */
-#define        MCLGET(m, how)  _MCLGET((m), mcl_cache, MCLBYTES, (how))
+#define        MCLGET(m, how)  m_clget((m), (how))
 
 #define        MEXTMALLOC(m, size, how)                                        \
 do {                                                                   \



Home | Main Index | Thread Index | Old Index