linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Stanley Chu <stanley.chu@mediatek.com>
To: <linux-mtd@lists.infradead.org>, <richard@nod.at>,
	<dedekind1@gmail.com>,  <adrian.hunter@intel.com>,
	<matthias.bgg@gmail.com>
Cc: linger.lee@mediatek.com, chienwei.chang@mediatek.com,
	kuohong.wang@mediatek.com, linux-mediatek@lists.infradead.org,
	Stanley Chu <stanley.chu@mediatek.com>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH v1] ubifs: support page statistics in vmstat
Date: Thu, 18 Jul 2019 20:03:57 +0800	[thread overview]
Message-ID: <1563451437-15725-1-git-send-email-stanley.chu@mediatek.com> (raw)

Currently PGPGIN and PGPGOUT statistics in vmstat is only
hooked in submit_bio() for block device I/O path.

This patch adds this feature for ubifs as well.

Change-Id: I8505bd2a7aa9eadc6abcd68b7d8b870752e71339
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
---
 fs/ubifs/file.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index 512e7d9c60cd..ffe7ce77f389 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -902,6 +902,8 @@ static int ubifs_bulk_read(struct page *page)
 
 static int ubifs_readpage(struct file *file, struct page *page)
 {
+	count_vm_events(PGPGIN, PAGE_CACHE_SIZE >> 9);
+
 	if (ubifs_bulk_read(page))
 		return 0;
 	do_readpage(page);
@@ -1032,6 +1034,8 @@ static int ubifs_writepage(struct page *page, struct writeback_control *wbc)
 		goto out_unlock;
 	}
 
+	count_vm_events(PGPGOUT, PAGE_CACHE_SIZE >> 9);
+
 	spin_lock(&ui->ui_lock);
 	synced_i_size = ui->synced_i_size;
 	spin_unlock(&ui->ui_lock);
-- 
2.18.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

             reply	other threads:[~2019-07-18 12:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-18 12:03 Stanley Chu [this message]
2019-07-21 20:15 ` [PATCH v1] ubifs: support page statistics in vmstat Richard Weinberger
2019-09-15 22:05   ` Richard Weinberger

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=1563451437-15725-1-git-send-email-stanley.chu@mediatek.com \
    --to=stanley.chu@mediatek.com \
    --cc=adrian.hunter@intel.com \
    --cc=chienwei.chang@mediatek.com \
    --cc=dedekind1@gmail.com \
    --cc=kuohong.wang@mediatek.com \
    --cc=linger.lee@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=richard@nod.at \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).