From owner-svn-src-all@FreeBSD.ORG Sun Sep 7 05:47:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1DE1F4F6; Sun, 7 Sep 2014 05:47:00 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7882813AC; Sun, 7 Sep 2014 05:46:58 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s875ku83026995 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 7 Sep 2014 09:46:56 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s875ku9E026994; Sun, 7 Sep 2014 09:46:56 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 7 Sep 2014 09:46:56 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r271213 - head/sys/mips/include Message-ID: <20140907054656.GJ17059@FreeBSD.org> References: <201409062238.s86McXJE068463@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409062238.s86McXJE068463@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.18-1 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: Sun, 07 Sep 2014 05:47:00 -0000 Thanks, Adrian. I noticed that some arches that use SFBUF_MAP actually override only the sf_buf_unmap() routine, and sf_buf_map() matches the default one. Might be a good idea to add SFBUF_UNMAP macro, and override sf_buf_map()/sf_buf_unmap() separately, to reduce copy-n-paste a little bit. On Sat, Sep 06, 2014 at 10:38:33PM +0000, Adrian Chadd wrote: A> Author: adrian A> Date: Sat Sep 6 22:38:32 2014 A> New Revision: 271213 A> URL: http://svnweb.freebsd.org/changeset/base/271213 A> A> Log: A> Implement local sfbuf_map and sfbuf_unmap for MIPS32. A> A> The pre-rework behaviour was not to keep the cached mappings around after A> the sfbuf was used but instead to recycle said mappings. A> A> PR: kern/193400 A> A> Modified: A> head/sys/mips/include/sf_buf.h A> head/sys/mips/include/vmparam.h A> A> Modified: head/sys/mips/include/sf_buf.h A> ============================================================================== A> --- head/sys/mips/include/sf_buf.h Sat Sep 6 22:37:47 2014 (r271212) A> +++ head/sys/mips/include/sf_buf.h Sat Sep 6 22:38:32 2014 (r271213) A> @@ -48,4 +48,23 @@ sf_buf_page(struct sf_buf *sf) A> } A> A> #endif /* __mips_n64 */ A> + A> +#ifndef __mips_n64 /* in 32 bit mode we manage our own mappings */ A> + A> +static inline void A> +sf_buf_map(struct sf_buf *sf, int flags) A> +{ A> + A> + pmap_qenter(sf->kva, &sf->m, 1); A> +} A> + A> +static inline int A> +sf_buf_unmap(struct sf_buf *sf) A> +{ A> + pmap_qremove(sf->kva, 1); A> + return (1); A> +} A> + A> +#endif /* ! __mips_n64 */ A> + A> #endif /* !_MACHINE_SF_BUF_H_ */ A> A> Modified: head/sys/mips/include/vmparam.h A> ============================================================================== A> --- head/sys/mips/include/vmparam.h Sat Sep 6 22:37:47 2014 (r271212) A> +++ head/sys/mips/include/vmparam.h Sat Sep 6 22:38:32 2014 (r271213) A> @@ -189,6 +189,7 @@ A> A> #ifndef __mips_n64 A> #define SFBUF A> +#define SFBUF_MAP A> #endif A> A> #endif /* !_MACHINE_VMPARAM_H_ */ A> -- Totus tuus, Glebius.