Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2/include/linux linux/rwsem: Reorder mem...



details:   https://anonhg.NetBSD.org/src/rev/6c2a8d91f78b
branches:  trunk
changeset: 1028578:6c2a8d91f78b
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 11:22:00 2021 +0000

description:
linux/rwsem: Reorder members to avoid confusing lockdebug.

diffstat:

 sys/external/bsd/drm2/include/linux/rwsem.h |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 52fca288eb67 -r 6c2a8d91f78b sys/external/bsd/drm2/include/linux/rwsem.h
--- a/sys/external/bsd/drm2/include/linux/rwsem.h       Sun Dec 19 11:21:54 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/rwsem.h       Sun Dec 19 11:22:00 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rwsem.h,v 1.4 2021/12/19 11:21:45 riastradh Exp $      */
+/*     $NetBSD: rwsem.h,v 1.5 2021/12/19 11:22:00 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -55,12 +55,16 @@
 #define        up_write                linux_up_write
 
 struct rw_semaphore {
-       kmutex_t        rws_lock;
-       kcondvar_t      rws_cv;
+       /*
+        * Note: rws_lock and rws_cv must not be first; doing so
+        * confuses lockdebug.
+        */
        struct lwp      *rws_writer;
        unsigned        rws_readers;
        bool            rws_writewanted;
        bool            rws_debug;
+       kmutex_t        rws_lock;
+       kcondvar_t      rws_cv;
 };
 
 void init_rwsem(struct rw_semaphore *);



Home | Main Index | Thread Index | Old Index