]> Git Repo - linux.git/commit
zram: reduce load operation in page_same_filled
authorSangwoo Park <[email protected]>
Wed, 3 May 2017 21:55:56 +0000 (14:55 -0700)
committerLinus Torvalds <[email protected]>
Wed, 3 May 2017 22:52:11 +0000 (15:52 -0700)
commitf0fe9984656604ea8effd5ff82709ff8ce1f954b
tree8b2998a6041eb33b592ed10abd551a7a29fc43b6
parent302128dce142d780417aa548bfd7ef4dfb89fa80
zram: reduce load operation in page_same_filled

In page_same_filled function, all elements in the page is compared with
next index value.  The current comparison routine compares the (i)th and
(i+1)th values of the page.

In this case, two load operaions occur for each comparison.  But if we
store first value of the page stores at 'val' variable and using it to
compare with others, the load opearation is reduced.  It reduce load
operation per page by up to 64times.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Sangwoo Park <[email protected]>
Reviewed-by: Sergey Senozhatsky <[email protected]>
Acked-by: Minchan Kim <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/block/zram/zram_drv.c
This page took 0.052102 seconds and 4 git commands to generate.