Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 Explain why this is the right value, otherw...



details:   https://anonhg.NetBSD.org/src/rev/6b87ada5ce40
branches:  trunk
changeset: 348879:6b87ada5ce40
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sun Nov 13 12:58:40 2016 +0000

description:
Explain why this is the right value, otherwise someone (like me) could be
tempted to increase it. The invlpg part is from rmind, the statistical from
me.

diffstat:

 sys/arch/x86/x86/pmap_tlb.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r cff548d60c23 -r 6b87ada5ce40 sys/arch/x86/x86/pmap_tlb.c
--- a/sys/arch/x86/x86/pmap_tlb.c       Sun Nov 13 12:38:14 2016 +0000
+++ b/sys/arch/x86/x86/pmap_tlb.c       Sun Nov 13 12:58:40 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap_tlb.c,v 1.7 2015/07/24 15:20:37 hannken Exp $     */
+/*     $NetBSD: pmap_tlb.c,v 1.8 2016/11/13 12:58:40 maxv Exp $        */
 
 /*-
  * Copyright (c) 2008-2012 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.7 2015/07/24 15:20:37 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.8 2016/11/13 12:58:40 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -74,7 +74,14 @@
        kcpuset_t *             tp_cpumask;
 } pmap_tlb_packet_t;
 
-/* No more than N seperate invlpg. */
+/*
+ * No more than N separate invlpg.
+ *
+ * Statistically, a value of six is big enough to cover the requested number
+ * of pages in ~ 95% of the TLB shootdowns we are getting. We therefore rarely
+ * reach the limit, and increasing it can actually reduce the performance due
+ * to the high cost of invlpg.
+ */
 #define        TP_MAXVA                6
 
 /*



Home | Main Index | Thread Index | Old Index