From owner-svn-src-head@FreeBSD.ORG Mon Aug 11 16:35:46 2014 Return-Path: Delivered-To: svn-src-head@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 F368ADD4; Mon, 11 Aug 2014 16:35:45 +0000 (UTC) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (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 B9B5B2173; Mon, 11 Aug 2014 16:35:44 +0000 (UTC) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.14.5/8.14.5) with SMTP id s7BGWYaP018169; Mon, 11 Aug 2014 11:35:38 -0500 Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by pp2.rice.edu with ESMTP id 1nppmn06k1-1; Mon, 11 Aug 2014 11:35:38 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id EAF9E460148; Mon, 11 Aug 2014 11:35:37 -0500 (CDT) Message-ID: <53E8F0D9.9080900@rice.edu> Date: Mon, 11 Aug 2014 11:35:37 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r269782 - in head/sys/sparc64: include sparc64 References: <53e7a4fc.2898.352aa941@svn.freebsd.org> In-Reply-To: <53e7a4fc.2898.352aa941@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=1.67643676718399e-14 kscore.compositescore=0 circleOfTrustscore=0 compositescore=0.714301145562988 urlsuspect_oldscore=0.714301145562988 suspectscore=13 recipient_domain_to_sender_totalscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=0 rbsscore=0.714301145562988 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1408110191 Cc: src-committers@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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: Mon, 11 Aug 2014 16:35:46 -0000 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. > > Reported and tested by: dumbbell > Diagnosed and reviewed by: alc > Sponsored by: The FreeBSD Foundation This change fixes things on sparc64, but there is also an opportunity here to make sf_buf operations much faster on newer sparc64 hardware. If someone is interested in doing this, then please e-mail me. Basically, if dcache_color_ignore is non-zero, then sparc64's direct map can be used. It shouldn't be a difficult change. > Added: > head/sys/sparc64/include/sf_buf.h > - copied, changed from r269781, head/sys/i386/include/sf_buf.h > Modified: > head/sys/sparc64/include/vmparam.h > head/sys/sparc64/sparc64/vm_machdep.c > > Copied and modified: head/sys/sparc64/include/sf_buf.h (from r269781, head/sys/i386/include/sf_buf.h) > ============================================================================== > --- head/sys/i386/include/sf_buf.h Sun Aug 10 15:21:26 2014 (r269781, copy source) > +++ head/sys/sparc64/include/sf_buf.h Sun Aug 10 16:59:39 2014 (r269782) > @@ -31,6 +31,5 @@ > > void sf_buf_map(struct sf_buf *, int); > int sf_buf_unmap(struct sf_buf *); > -boolean_t sf_buf_invalidate_cache(vm_page_t); > > #endif /* !_MACHINE_SF_BUF_H_ */ > > Modified: head/sys/sparc64/include/vmparam.h > ============================================================================== > --- head/sys/sparc64/include/vmparam.h Sun Aug 10 15:21:26 2014 (r269781) > +++ head/sys/sparc64/include/vmparam.h Sun Aug 10 16:59:39 2014 (r269782) > @@ -240,6 +240,6 @@ extern vm_offset_t vm_max_kernel_address > #define ZERO_REGION_SIZE PAGE_SIZE > > #define SFBUF > -#define SFBUF_NOMD > +#define SFBUF_MAP > > #endif /* !_MACHINE_VMPARAM_H_ */ > > Modified: head/sys/sparc64/sparc64/vm_machdep.c > ============================================================================== > --- head/sys/sparc64/sparc64/vm_machdep.c Sun Aug 10 15:21:26 2014 (r269781) > +++ head/sys/sparc64/sparc64/vm_machdep.c Sun Aug 10 16:59:39 2014 (r269782) > @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -443,3 +444,18 @@ uma_small_free(void *mem, int size, u_in > vm_page_free(m); > atomic_subtract_int(&vm_cnt.v_wire_count, 1); > } > + > +void > +sf_buf_map(struct sf_buf *sf, int flags) > +{ > + > + pmap_qenter(sf->kva, &sf->m, 1); > +} > + > +int > +sf_buf_unmap(struct sf_buf *sf) > +{ > + > + pmap_qremove(sf->kva, 1); > + return (1); > +} > >