mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
mm/zsmalloc: take obj index back from find_alloced_obj
the obj index value should be updated after return from find_alloced_obj() to avoid CPU burning caused by unnecessary object scanning. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ganesh Mahendran <[email protected]> Reviewed-by: Sergey Senozhatsky <[email protected]> Acked-by: Minchan Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
41b88e14c1
commit
cf675acb74
1 changed files with 6 additions and 2 deletions
|
|
@ -1741,10 +1741,11 @@ static void zs_object_copy(struct size_class *class, unsigned long dst,
|
|||
* return handle.
|
||||
*/
|
||||
static unsigned long find_alloced_obj(struct size_class *class,
|
||||
struct page *page, int index)
|
||||
struct page *page, int *obj_idx)
|
||||
{
|
||||
unsigned long head;
|
||||
int offset = 0;
|
||||
int index = *obj_idx;
|
||||
unsigned long handle = 0;
|
||||
void *addr = kmap_atomic(page);
|
||||
|
||||
|
|
@ -1765,6 +1766,9 @@ static unsigned long find_alloced_obj(struct size_class *class,
|
|||
}
|
||||
|
||||
kunmap_atomic(addr);
|
||||
|
||||
*obj_idx = index;
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
|
|
@ -1790,7 +1794,7 @@ static int migrate_zspage(struct zs_pool *pool, struct size_class *class,
|
|||
int ret = 0;
|
||||
|
||||
while (1) {
|
||||
handle = find_alloced_obj(class, s_page, obj_idx);
|
||||
handle = find_alloced_obj(class, s_page, &obj_idx);
|
||||
if (!handle) {
|
||||
s_page = get_next_page(s_page);
|
||||
if (!s_page)
|
||||
|
|
|
|||
Loading…
Reference in a new issue