From owner-svn-src-head@FreeBSD.ORG Fri Sep 6 05:37:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 780F42E5; Fri, 6 Sep 2013 05:37:51 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 55D3C272F; Fri, 6 Sep 2013 05:37:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r865bpUN013510; Fri, 6 Sep 2013 05:37:51 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r865boJN013504; Fri, 6 Sep 2013 05:37:50 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201309060537.r865boJN013504@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 6 Sep 2013 05:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255289 - in head/sys: amd64/amd64 amd64/include ia64/ia64 ia64/include mips/include mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Sep 2013 05:37:51 -0000 Author: glebius Date: Fri Sep 6 05:37:49 2013 New Revision: 255289 URL: http://svnweb.freebsd.org/changeset/base/255289 Log: On those machines, where sf_bufs do not represent any real object, make sf_buf_alloc()/sf_buf_free() inlines, to save two calls to an absolutely empty functions. Reviewed by: alc, kib, scottl Sponsored by: Nginx, Inc. Sponsored by: Netflix Modified: head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/include/sf_buf.h head/sys/ia64/ia64/vm_machdep.c head/sys/ia64/include/sf_buf.h head/sys/mips/include/sf_buf.h head/sys/mips/mips/vm_machdep.c Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Fri Sep 6 05:20:11 2013 (r255288) +++ head/sys/amd64/amd64/vm_machdep.c Fri Sep 6 05:37:49 2013 (r255289) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -695,27 +694,6 @@ cpu_reset_real() } /* - * Allocate an sf_buf for the given vm_page. On this machine, however, there - * is no sf_buf object. Instead, an opaque pointer to the given vm_page is - * returned. - */ -struct sf_buf * -sf_buf_alloc(struct vm_page *m, int pri) -{ - - return ((struct sf_buf *)m); -} - -/* - * Free the sf_buf. In fact, do nothing because there are no resources - * associated with the sf_buf. - */ -void -sf_buf_free(struct sf_buf *sf) -{ -} - -/* * Software interrupt handler for queued VM system processing. */ void Modified: head/sys/amd64/include/sf_buf.h ============================================================================== --- head/sys/amd64/include/sf_buf.h Fri Sep 6 05:20:11 2013 (r255288) +++ head/sys/amd64/include/sf_buf.h Fri Sep 6 05:37:49 2013 (r255289) @@ -41,6 +41,18 @@ */ struct sf_buf; +static inline struct sf_buf * +sf_buf_alloc(struct vm_page *m, int pri) +{ + + return ((struct sf_buf *)m); +} + +static inline void +sf_buf_free(struct sf_buf *sf) +{ +} + static __inline vm_offset_t sf_buf_kva(struct sf_buf *sf) { Modified: head/sys/ia64/ia64/vm_machdep.c ============================================================================== --- head/sys/ia64/ia64/vm_machdep.c Fri Sep 6 05:20:11 2013 (r255288) +++ head/sys/ia64/ia64/vm_machdep.c Fri Sep 6 05:37:49 2013 (r255289) @@ -79,7 +79,6 @@ #include #include #include -#include #include #include @@ -353,27 +352,6 @@ cpu_exit(struct thread *td) } /* - * Allocate an sf_buf for the given vm_page. On this machine, however, there - * is no sf_buf object. Instead, an opaque pointer to the given vm_page is - * returned. - */ -struct sf_buf * -sf_buf_alloc(struct vm_page *m, int pri) -{ - - return ((struct sf_buf *)m); -} - -/* - * Free the sf_buf. In fact, do nothing because there are no resources - * associated with the sf_buf. - */ -void -sf_buf_free(struct sf_buf *sf) -{ -} - -/* * Software interrupt handler for queued VM system processing. */ void Modified: head/sys/ia64/include/sf_buf.h ============================================================================== --- head/sys/ia64/include/sf_buf.h Fri Sep 6 05:20:11 2013 (r255288) +++ head/sys/ia64/include/sf_buf.h Fri Sep 6 05:37:49 2013 (r255289) @@ -41,6 +41,18 @@ */ struct sf_buf; +static inline struct sf_buf * +sf_buf_alloc(struct vm_page *m, int pri) +{ + + return ((struct sf_buf *)m); +} + +static inline void +sf_buf_free(struct sf_buf *sf) +{ +} + static __inline vm_page_t sf_buf_page(struct sf_buf *sf) { Modified: head/sys/mips/include/sf_buf.h ============================================================================== --- head/sys/mips/include/sf_buf.h Fri Sep 6 05:20:11 2013 (r255288) +++ head/sys/mips/include/sf_buf.h Fri Sep 6 05:37:49 2013 (r255289) @@ -41,6 +41,18 @@ /* In 64 bit the whole memory is directly mapped */ struct sf_buf; +static inline struct sf_buf * +sf_buf_alloc(struct vm_page *m, int pri) +{ + + return ((struct sf_buf *)m); +} + +static inline void +sf_buf_free(struct sf_buf *sf) +{ +} + static __inline vm_offset_t sf_buf_kva(struct sf_buf *sf) { Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Fri Sep 6 05:20:11 2013 (r255288) +++ head/sys/mips/mips/vm_machdep.c Fri Sep 6 05:37:49 2013 (r255289) @@ -76,7 +76,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef __mips_n64 #include +#endif #ifndef NSFBUFS #define NSFBUFS (512 + maxusers * 16) @@ -523,7 +525,6 @@ sf_buf_init(void *arg) } sf_buf_alloc_want = 0; } -#endif /* * Get an sf_buf from the freelist. Will block if none are available. @@ -531,7 +532,6 @@ sf_buf_init(void *arg) struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags) { -#ifndef __mips_n64 struct sf_buf *sf; int error; @@ -560,9 +560,6 @@ sf_buf_alloc(struct vm_page *m, int flag } mtx_unlock(&sf_freelist.sf_lock); return (sf); -#else - return ((struct sf_buf *)m); -#endif } /* @@ -571,7 +568,6 @@ sf_buf_alloc(struct vm_page *m, int flag void sf_buf_free(struct sf_buf *sf) { -#ifndef __mips_n64 pmap_qremove(sf->kva, 1); mtx_lock(&sf_freelist.sf_lock); SLIST_INSERT_HEAD(&sf_freelist.sf_head, sf, free_list); @@ -579,8 +575,8 @@ sf_buf_free(struct sf_buf *sf) if (sf_buf_alloc_want > 0) wakeup(&sf_freelist); mtx_unlock(&sf_freelist.sf_lock); -#endif } +#endif /* !__mips_n64 */ /* * Software interrupt handler for queued VM system processing.