Date: Mon, 11 Aug 2014 11:35:37 -0500 From: Alan Cox <alc@rice.edu> To: svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: src-committers@freebsd.org, Konstantin Belousov <kib@FreeBSD.org> Subject: Re: svn commit: r269782 - in head/sys/sparc64: include sparc64 Message-ID: <53E8F0D9.9080900@rice.edu> In-Reply-To: <53e7a4fc.2898.352aa941@svn.freebsd.org> References: <53e7a4fc.2898.352aa941@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <sys/proc.h> > #include <sys/sysent.h> > #include <sys/sched.h> > +#include <sys/sf_buf.h> > #include <sys/sysctl.h> > #include <sys/unistd.h> > #include <sys/vmmeter.h> > @@ -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); > +} > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53E8F0D9.9080900>