Source-Changes-HG archive

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

[src/pgoyette-localcount]: src/sys/kern Add membar_datadep_consumer() to {b, c...



details:   https://anonhg.NetBSD.org/src/rev/aafe4efdfd73
branches:  pgoyette-localcount
changeset: 852905:aafe4efdfd73
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Tue Apr 25 21:36:41 2017 +0000

description:
Add membar_datadep_consumer() to {b,c}devsw_lookup() to ensure that
the devsw content is visible.

Again, thanks riastradh@

diffstat:

 sys/kern/subr_devsw.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r 8e56d9b4d49e -r aafe4efdfd73 sys/kern/subr_devsw.c
--- a/sys/kern/subr_devsw.c     Tue Apr 25 21:31:33 2017 +0000
+++ b/sys/kern/subr_devsw.c     Tue Apr 25 21:36:41 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_devsw.c,v 1.34.2.15 2017/04/25 21:31:33 pgoyette Exp $    */
+/*     $NetBSD: subr_devsw.c,v 1.34.2.16 2017/04/25 21:36:41 pgoyette Exp $    */
 
 /*-
  * Copyright (c) 2001, 2002, 2007, 2008 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_devsw.c,v 1.34.2.15 2017/04/25 21:31:33 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_devsw.c,v 1.34.2.16 2017/04/25 21:36:41 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_dtrace.h"
@@ -452,6 +452,9 @@
        if (bmajor < 0 || bmajor >= max_bdevsws)
                return (NULL);
 
+       /* Wait for the content of the struct bdevsw to become visible */
+       membar_datadep_consumer();
+
        return (bdevsw[bmajor]);
 }
 
@@ -513,6 +516,9 @@
        if (cmajor < 0 || cmajor >= max_cdevsws)
                return (NULL);
 
+       /* Wait for the content of the struct bdevsw to become visible */
+       membar_datadep_consumer();
+
        return (cdevsw[cmajor]);
 }
 



Home | Main Index | Thread Index | Old Index