All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged] zram-reduce-load-operation-in-page_same_filled.patch removed from -mm tree
@ 2017-05-04 19:13 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-05-04 19:13 UTC (permalink / raw)
  To: minchan, mm-commits, sangwoo2.park, sergey.senozhatsky


The patch titled
     Subject: zram: reduce load operation in page_same_filled
has been removed from the -mm tree.  Its filename was
     zram-reduce-load-operation-in-page_same_filled.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Sangwoo Park <sangwoo2.park@lge.com>
Subject: 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/1488428104-7257-1-git-send-email-sangwoo2.park@lge.com
Signed-off-by: Sangwoo Park <sangwoo2.park@lge.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/block/zram/zram_drv.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff -puN drivers/block/zram/zram_drv.c~zram-reduce-load-operation-in-page_same_filled drivers/block/zram/zram_drv.c
--- a/drivers/block/zram/zram_drv.c~zram-reduce-load-operation-in-page_same_filled
+++ a/drivers/block/zram/zram_drv.c
@@ -195,15 +195,17 @@ static bool page_same_filled(void *ptr,
 {
 	unsigned int pos;
 	unsigned long *page;
+	unsigned long val;
 
 	page = (unsigned long *)ptr;
+	val = page[0];
 
-	for (pos = 0; pos < PAGE_SIZE / sizeof(*page) - 1; pos++) {
-		if (page[pos] != page[pos + 1])
+	for (pos = 1; pos < PAGE_SIZE / sizeof(*page); pos++) {
+		if (val != page[pos])
 			return false;
 	}
 
-	*element = page[pos];
+	*element = val;
 
 	return true;
 }
_

Patches currently in -mm which might be from sangwoo2.park@lge.com are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-04 19:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-04 19:13 [merged] zram-reduce-load-operation-in-page_same_filled.patch removed from -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.