@@ -10,6 +10,13 @@
extern int sysctl_stat_interval;
+enum writeback_stat_item {
+ NR_DIRTY_THRESHOLD,
+ NR_DIRTY_BG_THRESHOLD,
+ NR_VM_WRITEBACK_STAT_ITEMS,
+};
+
+
#ifdef CONFIG_VM_EVENT_COUNTERS
/*
* Light weight per cpu counter implementation.
@@ -313,7 +313,8 @@ static int bc_ioacct_notify(struct vnotifier_block *self,
bout >>= 10;
bin >>= 10;
- vm_events = ((unsigned long *)arg) + NR_VM_ZONE_STAT_ITEMS;
+ vm_events = ((unsigned long *)arg) + NR_VM_ZONE_STAT_ITEMS +
+ NR_VM_WRITEBACK_STAT_ITEMS;
vm_events[PGPGOUT] = (unsigned long)bout;
vm_events[PGPGIN] = (unsigned long)bin;
return NOTIFY_OK;
@@ -1157,12 +1157,6 @@ static const struct file_operations proc_zoneinfo_file_operations = {
.release = seq_release,
};
-enum writeback_stat_item {
- NR_DIRTY_THRESHOLD,
- NR_DIRTY_BG_THRESHOLD,
- NR_VM_WRITEBACK_STAT_ITEMS,
-};
-
static void *vmstat_start(struct seq_file *m, loff_t *pos)
{
unsigned long *v;
In container the pgpgin/pgpgout in /proc/vmstat were incorrectly printed in nr_dirty_threshold, and nr_dirty_background_threshold fields, because offset of the vm_events events array calculated incorrectly. We didn't take into account array of writeback_stat_item which comes before the vm_events. Fix up the offset. https://jira.sw.ru/browse/PSBM-88323 Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com> --- include/linux/vmstat.h | 7 +++++++ kernel/bc/io_acct.c | 3 ++- mm/vmstat.c | 6 ------ 3 files changed, 9 insertions(+), 7 deletions(-)