mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
UPSTREAM: zram: clear disk io accounting when reset zram device
(cherry-pick from commit d7ad41a1c498729b7584c257710b1b437a0c1470) Clear zram disk io accounting when resetting the zram device. Otherwise the residual io accounting stat will affect the diskstat in the next zram active cycle. Bug: 25951511 Change-Id: I0afc7ba11fb65fad352e3e195944d8887b348bef Signed-off-by: Weijie Yang <weijie.yang@samsung.com> Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Acked-by: Minchan Kim <minchan@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
05d8ae0a21
commit
2e20e8b40c
1 changed files with 2 additions and 0 deletions
|
@ -800,7 +800,9 @@ static void zram_reset_device(struct zram *zram)
|
||||||
memset(&zram->stats, 0, sizeof(zram->stats));
|
memset(&zram->stats, 0, sizeof(zram->stats));
|
||||||
zram->disksize = 0;
|
zram->disksize = 0;
|
||||||
zram->max_comp_streams = 1;
|
zram->max_comp_streams = 1;
|
||||||
|
|
||||||
set_capacity(zram->disk, 0);
|
set_capacity(zram->disk, 0);
|
||||||
|
part_stat_set_all(&zram->disk->part0, 0);
|
||||||
|
|
||||||
up_write(&zram->init_lock);
|
up_write(&zram->init_lock);
|
||||||
/* I/O operation under all of CPU are done so let's free */
|
/* I/O operation under all of CPU are done so let's free */
|
||||||
|
|
Loading…
Reference in a new issue