lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yx63e2lxNmEB3UhE@google.com>
Date:   Mon, 12 Sep 2022 13:37:15 +0900
From:   Sergey Senozhatsky <senozhatsky@...omium.org>
To:     Brian Geffon <bgeffon@...gle.com>, Minchan Kim <minchan@...nel.org>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Nitin Gupta <ngupta@...are.org>, linux-kernel@...r.kernel.org,
        Suleiman Souhlal <suleiman@...gle.com>,
        Rom Lemarchand <romlem@...gle.com>, linux-mm@...ck.org,
        Sergey Senozhatsky <senozhatsky@...omium.org>
Subject: Re: [RESEND RFC] zram: Allow rw_page when page isn't written back.

On (22/09/09 17:30), Sergey Senozhatsky wrote:
> > +++ b/drivers/block/zram/zram_drv.h
> > @@ -50,6 +50,7 @@ enum zram_pageflags {
> >  	ZRAM_UNDER_WB,	/* page is under writeback */
> >  	ZRAM_HUGE,	/* Incompressible page */
> >  	ZRAM_IDLE,	/* not accessed page since last idle marking */
> > +	ZRAM_NO_WB,	/* Do not allow page to be written back */
> >  
> >  	__NR_ZRAM_PAGEFLAGS,
> >  };
> 
> Unrelated but somehow related.
> 
> I wonder if it's time for us to introduce a dedicated, say u16,
> flags member to struct zram_table_entry. Unless my calculations
> are extremely wrong, we are about to run out of spare bits in
> zram_table_entry::flags on 32-bit systems.

Looking at it more - I wonder why do we define ZRAM_FLAG_SHIFT
as 24? This is far more than maximum zram object size. Our max
size needs PAGE_SHIFT bits (which is normally 12 bits, can be up
to 16 (for 64k arm64 pages)). So we probably can start defining
ZRAM_FLAG_SHIFT as (PAGE_SHIFT + 1).

Or am I missing something?

---

diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h
index b4eecef2a11f..cb8f1f644baf 100644
--- a/drivers/block/zram/zram_drv.h
+++ b/drivers/block/zram/zram_drv.h
@@ -39,7 +39,7 @@
  * The lower ZRAM_FLAG_SHIFT bits is for object size (excluding header),
  * the higher bits is for zram_pageflags.
  */
-#define ZRAM_FLAG_SHIFT 24
+#define ZRAM_FLAG_SHIFT (PAGE_SHIFT + 1)

 /* Flags for zram pages (table[page_no].flags) */
 enum zram_pageflags {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ