Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1564707

Re: [PATCH] mm: extend zero pages to same element pages for zram

From Joonsoo Kim <iamjoonsoo.kim@lge.com>
Newsgroups linux.kernel
Subject Re: [PATCH] mm: extend zero pages to same element pages for zram
Date 2017-01-23 07:30 +0100
Message-ID <t2GiB-2W5-9@gated-at.bofh.it> (permalink)
References (1 earlier) <sZ5yW-72H-25@gated-at.bofh.it> <t1ZwZ-1Ri-1@gated-at.bofh.it> <t2gHw-3D7-11@gated-at.bofh.it> <t2D1o-CT-7@gated-at.bofh.it> <t2E78-1B0-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Jan 23, 2017 at 01:03:47PM +0900, Sergey Senozhatsky wrote:
> On (01/23/17 11:58), Joonsoo Kim wrote:
> > Hello,
> > 
> > On Sun, Jan 22, 2017 at 10:58:38AM +0800, zhouxianrong wrote:
> > > 1. memset is just set a int value but i want to set a long value.
> > 
> > Sorry for late review.
> > 
> > Do we really need to set a long value? I cannot believe that
> > long value is repeated in the page. Value repeatition is
> > usually done by value 0 or 1 and it's enough to use int. And, I heard
> > that value 0 or 1 is repeated in Android. Could you check the distribution
> > of the value in the same page?
> 
> Hello Joonsoo,
> 
> thanks for taking a look and for bringing this question up.
> so I kinda wanted to propose union of `ulong handle' with `uint element'
> and switching to memset(), but I couldn't figure out if that change would
> break detection of some patterns.
> 
>  /* Allocated for each disk page */
>  struct zram_table_entry {
> -       unsigned long handle;
> +       union {
> +               unsigned long handle;
> +               unsigned int element;
> +       };
>         unsigned long value;
>  };

Hello,

Think about following case in 64 bits kernel.

If value pattern in the page is like as following, we cannot detect
the same page with 'unsigned int' element.

AAAAAAAABBBBBBBBAAAAAAAABBBBBBBB...

4 bytes is 0xAAAAAAAA and next 4 bytes is 0xBBBBBBBB and so on.

However, as I said before, I think that it is uncommon case.

Thanks.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] mm: extend zero pages to same element pages for zram Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-01-21 09:50 +0100
  Re: [PATCH] mm: extend zero pages to same element pages for zram zhouxianrong <zhouxianrong@huawei.com> - 2017-01-22 04:10 +0100
    Re: [PATCH] mm: extend zero pages to same element pages for zram Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2017-01-22 06:00 +0100
    Re: [PATCH] mm: extend zero pages to same element pages for zram Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2017-01-23 04:00 +0100
      Re: [PATCH] mm: extend zero pages to same element pages for zram zhouxianrong <zhouxianrong@huawei.com> - 2017-01-23 04:40 +0100
      Re: [PATCH] mm: extend zero pages to same element pages for zram Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-01-23 05:10 +0100
        Re: [PATCH] mm: extend zero pages to same element pages for zram Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2017-01-23 07:30 +0100
          Re: [PATCH] mm: extend zero pages to same element pages for zram Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-01-23 08:20 +0100
            Re: [PATCH] mm: extend zero pages to same element pages for zram Minchan Kim <minchan@kernel.org> - 2017-01-23 08:50 +0100
              Re: [PATCH] mm: extend zero pages to same element pages for zram zhouxianrong <zhouxianrong@huawei.com> - 2017-01-24 09:30 +0100
                Re: [PATCH] mm: extend zero pages to same element pages for zram Minchan Kim <minchan@kernel.org> - 2017-01-25 02:30 +0100
                Re: [PATCH] mm: extend zero pages to same element pages for zram Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-01-25 02:40 +0100
                Re: [PATCH] mm: extend zero pages to same element pages for zram Matthew Wilcox <willy@infradead.org> - 2017-01-25 03:50 +0100
                Re: [PATCH] mm: extend zero pages to same element pages for zram Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-01-25 05:20 +0100
                Re: [PATCH] mm: extend zero pages to same element pages for zram Minchan Kim <minchan@kernel.org> - 2017-01-25 06:00 +0100
                Re: [PATCH] mm: extend zero pages to same element pages for zram Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-01-25 06:40 +0100
                Re: [PATCH] mm: extend zero pages to same element pages for zram Minchan Kim <minchan@kernel.org> - 2017-01-25 06:50 +0100
    Re: [PATCH] mm: extend zero pages to same element pages for zram Matthew Wilcox <willy@infradead.org> - 2017-01-23 07:30 +0100
      答复: [PATCH] mm: extend zero pages to same element pages for zram zhouxianrong <zhouxianrong@huawei.com> - 2017-01-23 07:50 +0100

csiph-web