Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8fe007e authored by Minchan Kim's avatar Minchan Kim Committed by Vinayak Menon
Browse files

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/1464736881-24886-6-git-send-email-minchan@kernel.org


Signed-off-by: default avatarMinchan Kim <minchan@kernel.org>
Reviewed-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Git-commit: 1b8320b620d6caa5879380f83f3884908ceedd4a
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Change-Id: I07548b9ea31f5379265217f6fa0362befc6f8663
Signed-off-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
parent 4ca9471c
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -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)