diff options
| author | Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | 2014-04-07 15:38:03 -0700 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2016-12-11 13:00:41 +0100 |
| commit | 6591c4ab99af3fc3d84c74b2ce46d4d64e80c819 (patch) | |
| tree | 2e0557cca760652e61b4654612b06e48601b668b /include/linux/zram_drv.h | |
| parent | a802ac5ae7131b3f2450062b1f1e3fd72c202a9d (diff) | |
zram: use atomic64_t for all zram stats
This is a preparation patch for stats code duplication removal.
1) use atomic64_t for `pages_zero' and `pages_stored' zram stats.
2) `compr_size' and `pages_zero' struct zram_stats members did not
follow the existing device attr naming scheme: zram_stats.ATTR has
ATTR_show() function. rename them:
-- compr_size -> compr_data_size
-- pages_zero -> zero_pages
Minchan Kim's note:
If we really have trouble with atomic stat operation, we could
change it with percpu_counter so that it could solve atomic overhead and
unnecessary memory space by introducing unsigned long instead of 64bit
atomic_t.
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Acked-by: Jerome Marchand <jmarchan@redhat.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/zram_drv.h')
| -rw-r--r-- | include/linux/zram_drv.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/zram_drv.h b/include/linux/zram_drv.h index 0305bc559..cfb0e04d9 100644 --- a/include/linux/zram_drv.h +++ b/include/linux/zram_drv.h @@ -69,15 +69,15 @@ struct table { } __aligned(4); struct zram_stats { - atomic64_t compr_size; /* compressed size of pages stored */ + atomic64_t compr_data_size; /* compressed size of pages stored */ atomic64_t num_reads; /* failed + successful */ atomic64_t num_writes; /* --do-- */ atomic64_t failed_reads; /* should NEVER! happen */ atomic64_t failed_writes; /* can happen when memory is too low */ atomic64_t invalid_io; /* non-page-aligned I/O requests */ atomic64_t notify_free; /* no. of swap slot free notifications */ - atomic_t pages_zero; /* no. of zero filled pages */ - atomic_t pages_stored; /* no. of pages currently stored */ + atomic64_t zero_pages; /* no. of zero filled pages */ + atomic64_t pages_stored; /* no. of pages currently stored */ }; struct zram_meta { |
