From owner-svn-src-all@FreeBSD.ORG Fri Sep 6 17:08:37 2013 Return-Path: Delivered-To: svn-src-all@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 D199DB07; Fri, 6 Sep 2013 17:08:37 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: from mail-lb0-x22a.google.com (mail-lb0-x22a.google.com [IPv6:2a00:1450:4010:c04::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B1C542FC8; Fri, 6 Sep 2013 17:08:36 +0000 (UTC) Received: by mail-lb0-f170.google.com with SMTP id w7so3144214lbi.1 for ; Fri, 06 Sep 2013 10:08:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=1/JuLOUlWCuBWY5oSqZ/VcasqhQfboOe1fatfHUTsrE=; b=Ym7qKc2oqB/weJkzfSATf3TYXQjnkRYhv+Txqoe+1NhAdr8053pNUDA0KBKb8kX0Av 2YAHJgkqeiBeko0SSFigPFy+dKxeL7lfipRV0uhNoyuJ7c1Wco7aBApvdIYMUGTb8a+G DEBr4nAohNXAytdzIM372MBpmm8Razw1/TiyyflfyHqXgTSdGzxn+//cIY5MnfdoRMI9 0W1/4kpeW5+32tLCsUSjHRcYzFqgq1gK6yaAJmfCFYS6fsH0P1IC7c3fc6vJ118fXMPh Hq/6v0+7I18S9rgdxYqZneQ0jYAUNNV0Gfvbv496OsETLiWWL0EFBtSFTaHWZUdL2m84 zReA== MIME-Version: 1.0 X-Received: by 10.152.115.176 with SMTP id jp16mr3009085lab.17.1378487314512; Fri, 06 Sep 2013 10:08:34 -0700 (PDT) Sender: rizzo.unipi@gmail.com Received: by 10.114.200.165 with HTTP; Fri, 6 Sep 2013 10:08:34 -0700 (PDT) In-Reply-To: <201309060537.r865boJN013504@svn.freebsd.org> References: <201309060537.r865boJN013504@svn.freebsd.org> Date: Fri, 6 Sep 2013 19:08:34 +0200 X-Google-Sender-Auth: IvpVcxCCGafPSHL1V_Sk98SX5Qw Message-ID: Subject: Re: svn commit: r255289 - in head/sys: amd64/amd64 amd64/include ia64/ia64 ia64/include mips/include mips/mips From: Luigi Rizzo To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Sep 2013 17:08:37 -0000 On Fri, Sep 6, 2013 at 7:37 AM, Gleb Smirnoff wrote: > 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. > this seems to break the build WITHOUT_CLANG: cc1: warnings being treated as errors In file included from /usr/home/luigi/FreeBSD/head/sys/dev/md/md.c:87: /usr/home/luigi/FreeBSD/head/sys/sys/sf_buf.h:69: warning: redundant redeclaration of 'sf_buf_alloc' ./machine/sf_buf.h:46: warning: previous definition of 'sf_buf_alloc' was here /usr/home/luigi/FreeBSD/head/sys/sys/sf_buf.h:70: warning: redundant redeclaration of 'sf_buf_free' ./machine/sf_buf.h:53: warning: previous definition of 'sf_buf_free' was here *** [md.o] Error code 1 I don't know what could be a good way to handle this, maybe make sf_buf_alloc/sf_buf_free/sf_buf_mext prototypes mandatory in machine/sf_buf.h, and use the prototypes here only in the !_KERNEL case ? (and btw do we need sf_buf_mext() in that case ?) cheers luigi I >> do >> here > > *** [md.o] Error code 1 > > > 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. >