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 <liliangliang@vivo.com>
(cherry picked from commit 97f7f2ebf3eaa4d5f2e00b0a9c6d23462a25aa2d)
This commit is contained in:
Liangliang Li 2021-05-21 16:56:59 +08:00 committed by Carlos Llamas
parent b0375cb69c
commit 8326170bb6
2 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,7 @@
#include <asm/processor.h>
#include <linux/osq_lock.h>
#include <linux/debug_locks.h>
#include <linux/android_vendor.h>
#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

View File

@ -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 */