]> git.baikalelectronics.ru Git - kernel.git/commit
mm/z3fold: move decrement of pool->pages_nr into __release_z3fold_page()
authorMiaohe Lin <linmiaohe@huawei.com>
Fri, 29 Apr 2022 06:16:05 +0000 (23:16 -0700)
committerakpm <akpm@linux-foundation.org>
Fri, 29 Apr 2022 06:16:05 +0000 (23:16 -0700)
commit759ed3c93a3346288424bad463de62659ea22d78
treed34a03f89d7aad4218da29d60e94cda13e6c2d32
parent4fe0eaa5fd70d785616bbacd5ba9c4cd1eec48b8
mm/z3fold: move decrement of pool->pages_nr into __release_z3fold_page()

The z3fold will always do atomic64_dec(&pool->pages_nr) when the
__release_z3fold_page() is called.  Thus we can move decrement of
pool->pages_nr into __release_z3fold_page() to simplify the code.

Also we can reduce the size of z3fold.o ~1k.

Without this patch:
   text    data     bss     dec     hex filename
  15444    1376       8   16828    41bc mm/z3fold.o
With this patch:
   text    data     bss     dec     hex filename
  15044    1248       8   16300    3fac mm/z3fold.o

Link: https://lkml.kernel.org/r/20220308134311.59086-7-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Vitaly Wool <vitaly.wool@konsulko.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/z3fold.c