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


Groups > linux.kernel > #1546119

Re: [PATCH v4 3/3] zram: support BDI_CAP_STABLE_WRITES

From Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 3/3] zram: support BDI_CAP_STABLE_WRITES
Date 2016-12-22 02:40 +0100
Message-ID <sR0wp-2DI-9@gated-at.bofh.it> (permalink)
References <sQZAl-23J-5@gated-at.bofh.it> <sQZAl-23J-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On (12/22/16 09:36), Minchan Kim wrote:
> zram has used per-cpu stream feature from v4.7.
> It aims for increasing cache hit ratio of scratch buffer for
> compressing. Downside of that approach is that zram should ask
> memory space for compressed page in per-cpu context which requires
> stricted gfp flag which could be failed. If so, it retries to
> allocate memory space out of per-cpu context so it could get memory
> this time and compress the data again, copies it to the memory space.
> 
> In this scenario, zram assumes the data should never be changed
> but it is not true without stable page support. So, If the data is
> changed under us, zram can make buffer overrun so that zsmalloc
> free object chain is broken so system goes crash like below
> https://bugzilla.suse.com/show_bug.cgi?id=997574
> 
> This patch adds BDI_CAP_STABLE_WRITES to zram for declaring
> "I am block device needing *stable write*".
> 
> Fixes: da9556a2367c ("zram: user per-cpu compression streams")
> Cc: <stable@vger.kernel.org> [4.7+]
> Signed-off-by: Minchan Kim <minchan@kernel.org>

Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

	-ss

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


Thread

[PATCH v4 0/3] Fix zsmalloc crash problem Minchan Kim <minchan@kernel.org> - 2016-12-22 01:40 +0100
  [PATCH v4 3/3] zram: support BDI_CAP_STABLE_WRITES Minchan Kim <minchan@kernel.org> - 2016-12-22 01:40 +0100
    Re: [PATCH v4 3/3] zram: support BDI_CAP_STABLE_WRITES Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-12-22 02:40 +0100

csiph-web