lkml.org 
[lkml]   [2020]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] zram: do not set ZRAM_IDLE bit for idlepage writeback in writeback_store()
On Thu, Jan 23, 2020 at 10:39:36AM +0800, Yue Hu wrote:
> On Wed, 22 Jan 2020 18:23:05 -0800
> Minchan Kim <minchan@kernel.org> wrote:
>
> > On Tue, Jan 21, 2020 at 07:35:57PM +0800, Yue Hu wrote:
> > > From: Yue Hu <huyue2@yulong.com>
> > >
> > > Currently, we will call zram_set_flag() to set ZRAM_IDLE bit even for
> > > idlepage writeback. That is pointless. Let's set it only for hugepage mode.
> >
> > Could you be more specific? What do you see the problem with that?
>
> If current writeback mode is idle, ZRAM_IDLE bit will be check firstly for this
> slot. Then go to call zram_set_flag(, , ZRAM_IDLE) if it's marked as ZRAM_IDLE.
> So, it's duplicated setting, am i right?

As I wrote down in the description, it aims for the race with hugepage writeback.
Without it, there is no way to detect the slot is reallocated and marked
with huge again but it's new data so zram could free the page
unintentionally.

\
 
 \ /
  Last update: 2020-01-24 00:25    [W:0.106 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site