diff options
author | Jerome Marchand <jmarchan@redhat.com> | 2017-07-11 00:50:18 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-11 01:32:33 +0200 |
commit | cf8e0fedf0784ef4bc1889380b09eda295e3d109 (patch) | |
tree | 2f69f70cb8cea77fd5e2ab08b581358c90dda699 /mm/zbud.c | |
parent | zram: constify attribute_group structures. (diff) | |
download | linux-cf8e0fedf0784ef4bc1889380b09eda295e3d109.tar.xz linux-cf8e0fedf0784ef4bc1889380b09eda295e3d109.zip |
mm/zsmalloc: simplify zs_max_alloc_size handling
Commit 40f9fb8cffc6 ("mm/zsmalloc: support allocating obj with size of
ZS_MAX_ALLOC_SIZE") fixes a size calculation error that prevented
zsmalloc to allocate an object of the maximal size (ZS_MAX_ALLOC_SIZE).
I think however the fix is unneededly complicated.
This patch replaces the dynamic calculation of zs_size_classes at init
time by a compile time calculation that uses the DIV_ROUND_UP() macro
already used in get_size_class_index().
[akpm@linux-foundation.org: use min_t]
Link: http://lkml.kernel.org/r/20170630114859.1979-1-jmarchan@redhat.com
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Mahendran Ganesh <opensource.ganesh@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/zbud.c')
0 files changed, 0 insertions, 0 deletions