]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
mm: zbud: fix condition check on allocation size
authorHeesub Shin <heesub.shin@samsung.com>
Thu, 18 Jul 2013 23:56:26 +0000 (09:56 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 18 Jul 2013 23:56:26 +0000 (09:56 +1000)
commitab45ef7d58b41469f1496b8175f3d59cc8868e38
tree650b41fc03958b5fa206cb97a60f679f3c1e9699
parentbbbb5512677cc80985d3296b9ed72f3af8a35e55
mm: zbud: fix condition check on allocation size

zbud_alloc() incorrectly verifies the size of allocation limit.  It should
deny the allocation request greater than (PAGE_SIZE - ZHDR_SIZE_ALIGNED -
CHUNK_SIZE), not (PAGE_SIZE - ZHDR_SIZE_ALIGNED) which has no remaining
spaces for its buddy.  There is no point in spending the entire zbud page
storing only a single page, since we don't have any benefits.

Signed-off-by: Heesub Shin <heesub.shin@samsung.com>
Acked-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Cc: Bob Liu <bob.liu@oracle.com>
Cc: Dongjun Shin <d.j.shin@samsung.com>
Cc: Sunae Seo <sunae.seo@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/zbud.c