zsmalloc: use bit_spin_lock
Subsystems (2)
[email protected]
maintainerPATCH 46/126 zsmalloc: use bit_spin_lock
From: Minchan Kim <[email protected]>
Subject: zsmalloc: use bit_spin_lock
Use kernel standard bit spin-lock instead of custom mess. Even, it has a bug which doesn't disable preemption. The reason we don't have any problem is that we have used it during preemption disable section by class->lock spinlock. So no need to go to stable.
Signed-off-by Minchan Kim <[email protected]>
Reviewed-by Sergey Senozhatsky <[email protected]>
Cc Vlastimil Babka <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
mm/zsmalloc.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
mm/zsmalloc.c renamed from mm/zsmalloc.c~zsmalloc-use-bit_spin_lock +2 -5
@@ -868,21 +868,17 @@ static unsigned long obj_idx_to_offset(sstatic inline int trypin_tag (unsigned long handle) { -unsigned long *ptr = (unsigned long *)handle; - -return !test_and_set_bit_lock (HANDLE_PIN_BIT , ptr); +return bit_spin_trylock (HANDLE_PIN_BIT , (unsigned long *)handle); }static void pin_tag (unsigned long handle) { -while (!trypin_tag (handle)); +bit_spin_lock (HANDLE_PIN_BIT , (unsigned long *)handle); }static void unpin_tag (unsigned long handle) { -unsigned long *ptr = (unsigned long *)handle;