From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
kernel-team <kernel-team@lge.com>,
linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org,
hch@infradead.org, viro@zeniv.linux.org.uk, axboe@kernel.dk,
jlayton@redhat.com, tytso@mit.edu
Subject: Re: [PATCH 2/2] zram: do not count duplicated pages as compressed
Date: Wed, 17 May 2017 18:14:23 +0900 [thread overview]
Message-ID: <20170517091423.GA14662@jagdpanzerIV.localdomain> (raw)
In-Reply-To: <20170517083212.GA25750@bbox>
Hello Minchan,
On (05/17/17 17:32), Minchan Kim wrote:
[..]
> > what we can return now is a `partially updated' data, with some new
> > and some stale pages. this is quite unlikely to end up anywhere good.
> > am I wrong?
> >
> > why does `rd block 4' in your case causes Oops? as a worst case scenario?
> > application does not expect page to be 'all A' at this point. pages are
> > likely to belong to some mappings/files/etc., and there is likely a data
> > dependency between them, dunno C++ objects that span across pages or
> > JPEG images, etc. so returning "new data new data stale data" is a bit
> > fishy.
>
> I thought more about it and start to confuse. :/
sorry, I'm not sure I see what's the source of your confusion :)
my point is - we should not let READ succeed if we know that WRITE
failed. assume JPEG image example,
over-write block 1 aaa->xxx OK
over-write block 2 bbb->yyy OK
over-write block 3 ccc->zzz error
reading that JPEG file
read block 1 xxx OK
read block 2 yyy OK
read block 3 ccc OK << we should not return OK here. because
"xxxyyyccc" is not the correct JPEG file
anyway.
do you agree that telling application that read() succeeded and at
the same returning corrupted "xxxyyyccc" instead of "xxxyyyzzz" is
not correct?
so how about this,
- if we fail to compress page (S/W or H/W compressor error, depending
on particular setup) let's store it uncompressed (page_size-d zspool
object).
?
this should do the trick. at least we will have correct data:
xxx - compressed
yyy - compressed
zzz - uncompressed, because compressing back-end returned an error.
thoughts?
-ss
next prev parent reply other threads:[~2017-05-17 9:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-15 7:41 [PATCH 1/2] zram: count same page write as page_stored Minchan Kim
2017-05-15 7:41 ` [PATCH 2/2] zram: do not count duplicated pages as compressed Minchan Kim
2017-05-16 1:30 ` Sergey Senozhatsky
2017-05-16 1:59 ` Minchan Kim
2017-05-16 2:36 ` Sergey Senozhatsky
2017-05-16 5:26 ` Minchan Kim
2017-05-16 5:45 ` Sergey Senozhatsky
2017-05-16 7:16 ` Minchan Kim
2017-05-16 7:36 ` Sergey Senozhatsky
2017-05-17 8:32 ` Minchan Kim
2017-05-17 9:14 ` Sergey Senozhatsky [this message]
2017-05-18 4:53 ` Minchan Kim
2017-05-21 7:04 ` Christoph Hellwig
2017-05-21 7:15 ` Minchan Kim
2017-05-16 1:11 ` [PATCH 1/2] zram: count same page write as page_stored Sergey Senozhatsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170517091423.GA14662@jagdpanzerIV.localdomain \
--to=sergey.senozhatsky.work@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=hch@infradead.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=jlayton@redhat.com \
--cc=kernel-team@lge.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=minchan@kernel.org \
--cc=sergey.senozhatsky@gmail.com \
--cc=tytso@mit.edu \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.