mm: zbud: fix condition check on allocation size
authorHeesub Shin <heesub.shin@samsung.com>
Wed, 31 Jul 2013 20:53:40 +0000 (13:53 -0700)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:47:19 +0000 (11:47 +0900)
commitc81b00e74776b98feb94b984b3ea42a2f3d0f3da
tree4c6140f5bee31f38d18d16c24bf06c11391fe1b5
parent6e19d46a034c6310385cd60843d83aa74f4402e0
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.

Change-Id: Ief305088b6983c01426300a0638520f51b17ad2a
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/zbud.c