mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
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. Link: http://lkml.kernel.org/r/[email protected] 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]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
1fc6e27d7b
commit
1b8320b620
1 changed files with 3 additions and 7 deletions
|
|
@ -868,21 +868,17 @@ static unsigned long obj_idx_to_offset(struct page *page,
|
|||
|
||||
static 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;
|
||||
|
||||
clear_bit_unlock(HANDLE_PIN_BIT, ptr);
|
||||
bit_spin_unlock(HANDLE_PIN_BIT, (unsigned long *)handle);
|
||||
}
|
||||
|
||||
static void reset_page(struct page *page)
|
||||
|
|
|
|||
Loading…
Reference in a new issue