From 8326170bb6a02c97289689a4efda7062e991285f Mon Sep 17 00:00:00 2001 From: Liangliang Li Date: Fri, 21 May 2021 16:56:59 +0800 Subject: [PATCH] ANDROID: GKI: Add OEM data to mutex/rwsem Reserve ANDROID_OEM_DATA in struct mutex/rw_semaphore for recording information about the lock, such as the lock owner, which helps with OEM specific lock optimization. Bug: 188869548 Change-Id: I33f767a1823f854a8deb8ba9078079aa6a9d76ea Signed-off-by: Liangliang Li (cherry picked from commit 97f7f2ebf3eaa4d5f2e00b0a9c6d23462a25aa2d) --- include/linux/mutex.h | 2 ++ include/linux/rwsem.h | 1 + 2 files changed, 3 insertions(+) diff --git a/include/linux/mutex.h b/include/linux/mutex.h index 8f226d460f51..35d7b14239e2 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h @@ -19,6 +19,7 @@ #include #include #include +#include #ifdef CONFIG_DEBUG_LOCK_ALLOC # define __DEP_MAP_MUTEX_INITIALIZER(lockname) \ @@ -73,6 +74,7 @@ struct mutex { #ifdef CONFIG_DEBUG_LOCK_ALLOC struct lockdep_map dep_map; #endif + ANDROID_OEM_DATA_ARRAY(1, 2); }; #ifdef CONFIG_DEBUG_MUTEXES diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index 34bd4eebcfaf..59f1674a6624 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h @@ -65,6 +65,7 @@ struct rw_semaphore { struct lockdep_map dep_map; #endif ANDROID_VENDOR_DATA(1); + ANDROID_OEM_DATA_ARRAY(1, 2); }; /* In all implementations count != 0 means locked */