Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Nov 2016 01:41:45 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r308662 - head/sys/kern
Message-ID:  <201611150141.uAF1fjkg092905@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Tue Nov 15 01:41:45 2016
New Revision: 308662
URL: https://svnweb.freebsd.org/changeset/base/308662

Log:
  [mips] enable relbuf on mips for now to work around page aliasing in mips hardware.
  
  Although the higher end MIPS hardware handles cache aliasing issues in
  hardware, the older cores (r4k, etc) and some compile versions of the
  newer cores (mips24k, mips34k, mips74k) don't have this feature.
  This means we end up with some very unfortunate behaviour that was
  made very obvious by some recent changes to the FFS pager by kib.
  
  So, flip this off until we get our MIPS pmap/cache code upgraded to
  handle aliased pages in software.
  
  Discussed with: kib, bsdimp, juli

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==============================================================================
--- head/sys/kern/vfs_bio.c	Tue Nov 15 01:34:38 2016	(r308661)
+++ head/sys/kern/vfs_bio.c	Tue Nov 15 01:41:45 2016	(r308662)
@@ -4655,7 +4655,24 @@ bdata2bio(struct buf *bp, struct bio *bi
 	}
 }
 
-static int buf_pager_relbuf;
+/*
+ * The MIPS pmap code currently doesn't handle aliased pages.
+ * The VIPT caches may not handle page aliasing themselves, leading
+ * to data corruption.
+ *
+ * As such, this code makes a system extremely unhappy if said
+ * system doesn't support unaliasing the above situation in hardware.
+ * Some "recent" systems (eg some mips24k/mips74k cores) don't enable
+ * this feature at build time, so it has to be handled in software.
+ *
+ * Once the MIPS pmap/cache code grows to support this function on
+ * earlier chips, it should be flipped back off.
+ */
+#ifdef	__mips__
+static int buf_pager_relbuf = 1;
+#else
+static int buf_pager_relbuf = 0;
+#endif
 SYSCTL_INT(_vfs, OID_AUTO, buf_pager_relbuf, CTLFLAG_RWTUN,
     &buf_pager_relbuf, 0,
     "Make buffer pager release buffers after reading");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611150141.uAF1fjkg092905>