[Feature][ZXW-65]merged P49 base code
Change-Id: I3e09c0c3d47483bc645f02310380ecb7fc6f4041
diff --git a/ap/os/linux/linux-3.4.x/mm/slob.c b/ap/os/linux/linux-3.4.x/mm/slob.c
index 5e6b4d7..f26c8d4 100755
--- a/ap/os/linux/linux-3.4.x/mm/slob.c
+++ b/ap/os/linux/linux-3.4.x/mm/slob.c
@@ -898,8 +898,16 @@
}else
panic("mem out!!");
slob_free_general(mem, sp);
- } else
+ } else {
+ struct page *page;
+ unsigned int order;
+ page = &sp->page;
+ order = get_order(page->private);
+ raw_spin_lock_irqsave(&g_slob_kmalloc_spin_lock, flags);
+ g_slob_kmalloc_pages -= (1 << order);
+ raw_spin_unlock_irqrestore(&g_slob_kmalloc_spin_lock, flags);
put_page(&sp->page);
+ }
#else
sp = slob_page(block);
if (is_slob_page(sp)) {