Re: [PATCH] zswap: Same-filled pages handling

2017-11-28 Thread Dan Streetman
On Mon, Nov 20, 2017 at 6:46 PM, Andrew Morton wrote: > > On Wed, 18 Oct 2017 10:48:32 + Srividya Desireddy > wrote: > > > +/* Enable/disable handling same-value filled pages (enabled by default) */ > > +static bool zswap_same_filled_pages_enabled = true; > > +module_param_named(same_filled_

Re: [PATCH] zswap: Same-filled pages handling

2017-11-20 Thread Andrew Morton
On Wed, 18 Oct 2017 10:48:32 + Srividya Desireddy wrote: > +/* Enable/disable handling same-value filled pages (enabled by default) */ > +static bool zswap_same_filled_pages_enabled = true; > +module_param_named(same_filled_pages_enabled, > zswap_same_filled_pages_enabled, > +

Re: [PATCH] zswap: Same-filled pages handling

2017-11-17 Thread Dan Streetman
On Thu, Nov 2, 2017 at 11:08 AM, Srividya Desireddy wrote: > > On Wed, Oct 19, 2017 at 6:38 AM, Matthew Wilcox wrote: >> On Thu, Oct 19, 2017 at 12:31:18AM +0300, Timofey Titovets wrote: >>> > +static void zswap_fill_page(void *ptr, unsigned long value) >>> > +{ >>> > + unsigned int pos; >>>

Re: [PATCH] zswap: Same-filled pages handling

2017-11-17 Thread Dan Streetman
On Wed, Oct 18, 2017 at 5:31 PM, Timofey Titovets wrote: >> +static int zswap_is_page_same_filled(void *ptr, unsigned long *value) >> +{ >> + unsigned int pos; >> + unsigned long *page; >> + >> + page = (unsigned long *)ptr; >> + for (pos = 1; pos < PAGE_SIZE / sizeof(*page

Re: [PATCH] zswap: Same-filled pages handling

2017-11-17 Thread Dan Streetman
On Wed, Oct 18, 2017 at 6:48 AM, Srividya Desireddy wrote: > > From: Srividya Desireddy > Date: Wed, 18 Oct 2017 15:39:02 +0530 > Subject: [PATCH] zswap: Same-filled pages handling > > Zswap is a cache which compresses the pages that are being swapped out > and stores them into a dynamically allo

Re: [PATCH] zswap: Same-filled pages handling

2017-11-02 Thread Srividya Desireddy
On Wed, Oct 19, 2017 at 6:38 AM, Matthew Wilcox wrote: > On Thu, Oct 19, 2017 at 12:31:18AM +0300, Timofey Titovets wrote: >> > +static void zswap_fill_page(void *ptr, unsigned long value) >> > +{ >> > + unsigned int pos; >> > + unsigned long *page; >> > + >> > + page = (unsign

Re: [PATCH] zswap: Same-filled pages handling

2017-10-19 Thread Matthew Wilcox
On Wed, Oct 18, 2017 at 09:30:32PM -0700, Andi Kleen wrote: > > Yes. Every 64-bit repeating pattern is also a 32-bit repeating pattern. > > Supporting a 64-bit pattern on a 32-bit kernel is painful, but it makes > > no sense to *not* support a 64-bit pattern on a 64-bit kernel. > > But a 32bit

Re: [PATCH] zswap: Same-filled pages handling

2017-10-18 Thread Andi Kleen
> Yes. Every 64-bit repeating pattern is also a 32-bit repeating pattern. > Supporting a 64-bit pattern on a 32-bit kernel is painful, but it makes > no sense to *not* support a 64-bit pattern on a 64-bit kernel. But a 32bit repeating pattern is not necessarily a 64bit pattern. >This is the sa

Re: [PATCH] zswap: Same-filled pages handling

2017-10-18 Thread Matthew Wilcox
On Wed, Oct 18, 2017 at 01:43:10PM -0700, Andi Kleen wrote: > > +static int zswap_is_page_same_filled(void *ptr, unsigned long *value) > > +{ > > + unsigned int pos; > > + unsigned long *page; > > + > > + page = (unsigned long *)ptr; > > + for (pos = 1; pos < PAGE_SIZE / sizeof(*page); pos+

Re: [PATCH] zswap: Same-filled pages handling

2017-10-18 Thread Matthew Wilcox
On Thu, Oct 19, 2017 at 12:31:18AM +0300, Timofey Titovets wrote: > > +static void zswap_fill_page(void *ptr, unsigned long value) > > +{ > > + unsigned int pos; > > + unsigned long *page; > > + > > + page = (unsigned long *)ptr; > > + if (value == 0) > > + mem

Re: [PATCH] zswap: Same-filled pages handling

2017-10-18 Thread Timofey Titovets
> +static int zswap_is_page_same_filled(void *ptr, unsigned long *value) > +{ > + unsigned int pos; > + unsigned long *page; > + > + page = (unsigned long *)ptr; > + for (pos = 1; pos < PAGE_SIZE / sizeof(*page); pos++) { > + if (page[pos] != page[0]) > +

Re: [PATCH] zswap: Same-filled pages handling

2017-10-18 Thread Andi Kleen
Srividya Desireddy writes: > > On a ARM Quad Core 32-bit device with 1.5GB RAM by launching and > relaunching different applications, out of ~64000 pages stored in > zswap, ~11000 pages were same-value filled pages (including zero-filled > pages) and ~9000 pages were zero-filled pages. What are t

Re: [PATCH] zswap: Same-filled pages handling

2017-10-18 Thread Srividya Desireddy
On Wed, Oct 18, 2017 at 7:41 PM, Matthew Wilcox wrote: > On Wed, Oct 18, 2017 at 04:33:43PM +0300, Timofey Titovets wrote: >> 2017-10-18 15:34 GMT+03:00 Matthew Wilcox : >> > On Wed, Oct 18, 2017 at 10:48:32AM +, Srividya Desireddy wrote: >> >> +static void zswap_fill_page(void *ptr, unsigned

Re: [PATCH] zswap: Same-filled pages handling

2017-10-18 Thread Matthew Wilcox
On Wed, Oct 18, 2017 at 04:33:43PM +0300, Timofey Titovets wrote: > 2017-10-18 15:34 GMT+03:00 Matthew Wilcox : > > On Wed, Oct 18, 2017 at 10:48:32AM +, Srividya Desireddy wrote: > >> +static void zswap_fill_page(void *ptr, unsigned long value) > >> +{ > >> + unsigned int pos; > >> + u

Re: [PATCH] zswap: Same-filled pages handling

2017-10-18 Thread Timofey Titovets
2017-10-18 15:34 GMT+03:00 Matthew Wilcox : > On Wed, Oct 18, 2017 at 10:48:32AM +, Srividya Desireddy wrote: >> +static void zswap_fill_page(void *ptr, unsigned long value) >> +{ >> + unsigned int pos; >> + unsigned long *page; >> + >> + page = (unsigned long *)ptr; >> + if (va

Re: [PATCH] zswap: Same-filled pages handling

2017-10-18 Thread Matthew Wilcox
On Wed, Oct 18, 2017 at 10:48:32AM +, Srividya Desireddy wrote: > +static void zswap_fill_page(void *ptr, unsigned long value) > +{ > + unsigned int pos; > + unsigned long *page; > + > + page = (unsigned long *)ptr; > + if (value == 0) > + memset(page, 0, PAGE_SIZE);