Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/aarch64/aarch64 Set uvmexp.ncolors appropriately, w...



details:   https://anonhg.NetBSD.org/src/rev/6f61439decae
branches:  trunk
changeset: 935415:6f61439decae
user:      rin <rin%NetBSD.org@localhost>
date:      Thu Jul 02 12:59:31 2020 +0000

description:
Set uvmexp.ncolors appropriately, which is required for some CPU
models with VIPT icache.

Otherwise, alias in virtual address results in inconsistent results,
at least for applications that rewrite text of other process, e.g.,
GDB for arm32.

Also, this hopefully fixes other unexpected failures due to alias.

Confirmed that there's no observable regression in performance;
difference in ``time make -j8'' for GENERIC64 kernel on BCM2837
with and without setting uvmexp.ncolors is within 0.1%.

Thanks to ryo@ for discussion.

diffstat:

 sys/arch/aarch64/aarch64/pmap.c |  7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diffs (29 lines):

diff -r 75e64c91a612 -r 6f61439decae sys/arch/aarch64/aarch64/pmap.c
--- a/sys/arch/aarch64/aarch64/pmap.c   Thu Jul 02 12:47:19 2020 +0000
+++ b/sys/arch/aarch64/aarch64/pmap.c   Thu Jul 02 12:59:31 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.80 2020/06/27 00:46:37 rin Exp $    */
+/*     $NetBSD: pmap.c,v 1.81 2020/07/02 12:59:31 rin Exp $    */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.80 2020/06/27 00:46:37 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.81 2020/07/02 12:59:31 rin Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -448,10 +448,7 @@
        UVMHIST_FUNC(__func__);
        UVMHIST_CALLED(pmaphist);
 
-#if 0
-       /* uvmexp.ncolors = icachesize / icacheways / PAGE_SIZE; */
        uvmexp.ncolors = aarch64_cache_vindexsize / PAGE_SIZE;
-#endif
 
        /* devmap already uses last of va? */
        if (virtual_devmap_addr != 0 && virtual_devmap_addr < vend)



Home | Main Index | Thread Index | Old Index