From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 09:07:40 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 C7CC61CA; Tue, 12 Aug 2014 09:07:40 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D6092E52; Tue, 12 Aug 2014 09:07:40 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s7C97XPw062587 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 12 Aug 2014 12:07:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s7C97XPw062587 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s7C97W2b062586; Tue, 12 Aug 2014 12:07:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 12 Aug 2014 12:07:32 +0300 From: Konstantin Belousov To: Alan Cox Subject: Re: svn commit: r269782 - in head/sys/sparc64: include sparc64 Message-ID: <20140812090732.GC2737@kib.kiev.ua> References: <53e7a4fc.2898.352aa941@svn.freebsd.org> <53E8F0D9.9080900@rice.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+xNpyl7Qekk2NvDX" Content-Disposition: inline In-Reply-To: <53E8F0D9.9080900@rice.edu> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home 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 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: Tue, 12 Aug 2014 09:07:41 -0000 --+xNpyl7Qekk2NvDX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 11, 2014 at 11:35:37AM -0500, Alan Cox wrote: > On 08/10/2014 11:59, Konstantin Belousov wrote: > > Author: kib > > Date: Sun Aug 10 16:59:39 2014 > > New Revision: 269782 > > URL: http://svnweb.freebsd.org/changeset/base/269782 > > > > Log: > > On sparc64, do not keep mappings for the destroyed sf_bufs. Sparc64 > > pmap, unlike i386, and similar to i386/xen pv, does not tolerate > > abandoned mappings for the freed pages. > > =20 > > Reported and tested by: dumbbell > > Diagnosed and reviewed by: alc > > Sponsored by: The FreeBSD Foundation >=20 >=20 > This change fixes things on sparc64, but there is also an opportunity > here to make sf_buf operations much faster on newer sparc64 hardware.=20 > If someone is interested in doing this, then please e-mail me.=20 > Basically, if dcache_color_ignore is non-zero, then sparc64's direct map > can be used. It shouldn't be a difficult change. The following patch should implement use of dcache_color_ignore, like hw_direct_map on powerpc aim. I did not found a way around the machine/tlb.h hack. The patch compiled on ppc64 and sparc64. diff --git a/sys/powerpc/include/vmparam.h b/sys/powerpc/include/vmparam.h index c46f395..965f8e4 100644 --- a/sys/powerpc/include/vmparam.h +++ b/sys/powerpc/include/vmparam.h @@ -210,5 +210,6 @@ struct pmap_physseg { #define SFBUF #define SFBUF_NOMD #define SFBUF_OPTIONAL_DIRECT_MAP hw_direct_map +#define SFBUF_PHYS_DMAP(x) (x) =20 #endif /* _MACHINE_VMPARAM_H_ */ diff --git a/sys/sparc64/include/vmparam.h b/sys/sparc64/include/vmparam.h index 8e7d76c..cc97ade 100644 --- a/sys/sparc64/include/vmparam.h +++ b/sys/sparc64/include/vmparam.h @@ -241,5 +241,8 @@ extern vm_offset_t vm_max_kernel_address; =20 #define SFBUF #define SFBUF_MAP +#define SFBUF_OPTIONAL_DIRECT_MAP dcache_color_ignore +#include +#define SFBUF_PHYS_DMAP(x) TLB_DIRECT_TO_PHYS(x) =20 #endif /* !_MACHINE_VMPARAM_H_ */ diff --git a/sys/sys/sf_buf.h b/sys/sys/sf_buf.h index 8a6c56f..de164a1 100644 --- a/sys/sys/sf_buf.h +++ b/sys/sys/sf_buf.h @@ -112,7 +112,7 @@ sf_buf_kva(struct sf_buf *sf) { #ifdef SFBUF_OPTIONAL_DIRECT_MAP if (SFBUF_OPTIONAL_DIRECT_MAP) - return (VM_PAGE_TO_PHYS((vm_page_t)sf)); + return (SFBUF_PHYS_DMAP(VM_PAGE_TO_PHYS((vm_page_t)sf))); #endif =20 return (sf->kva); --+xNpyl7Qekk2NvDX Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJT6dlUAAoJEJDCuSvBvK1Bu8kP+gIjsYUdftvk7YMY7moi4Pf7 FLY6+SOAi5ZlGNvyPXTVi/yeca73Vz15YSU1aS3X6LQXOLhX3CJ1EI39X/kSDMHc Q3gxhu4ICxRvonX19ygUS1ET1clV8J32eSbDC1AVVAzqq5eunkSzAjFnFUSSqvwx YChm8V3ZvnNR/4vCMc0NcpRu0L4ljWQzlj3WT5Zr66MayrJw37yTbLm1XfnZS70H jdWneJ81FnUhDLHdK3XoPWwFFlhixZnA0NX5QwYATFD7Uw3VZDz5RTNJPXaj81l6 UCu5nyiBBeYGJkgWFFn2XWu5s9PHng1UNMs5hYopUBH3qQx4wWCM2rVq4bEQiLhS jKDKjZPaQlvfpCO2Cwiby5UWNTguNW/exegyaSCVbom60h1PUHR315tv9wkQs8NK dlDWuDXVFFP64kTTkqIid+i873qRA1/9v2Qa7s5Rotz4clGoS1iAjWrnaQjyj/TF C+eSFVNLVXEg31HgENpzuLCWwv98JA3L66E0aPldL0QAPMsCRhTjlivQl45nRTXj Fj/ioMJPEjYKbBXyw8sr02Y97nHcftGuNo2G8KTwGL5IA31ipDevHEJaTZR06kj8 pqogwbrhT59peTAUG0V++uhZt2D7ehZkVJosZcLbO/a3rsc4YcgvKGKEZvXW/oFg pf8Igfi2TVpOtjj4GV4e =6B2s -----END PGP SIGNATURE----- --+xNpyl7Qekk2NvDX--