All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: NeilBrown <neilb@suse.de>, Andrew Morton <akpm@linux-foundation.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Christoph Hellwig <hch@lst.de>, <linux-nfs@vger.kernel.org>,
	<linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
	Matthew Wilcox <willy@infradead.org>
Subject: Re: [PATCH v2] MM: handle THP in swap_*page_fs() - count_vm_events()
Date: Mon, 9 May 2022 16:54:50 +0800	[thread overview]
Message-ID: <37653eca-e82e-62aa-6829-7413cb844b75@huawei.com> (raw)
In-Reply-To: <165146948934.24404.5909750610552745025@noble.neil.brown.name>

On 2022/5/2 13:31, NeilBrown wrote:
> 
> We need to use count_swpout_vm_event() for sio_write_complete() to get
> correct counting.
> 
> Note that THP swap in (if it ever happens) is current accounted 1 for
> each page, whether HUGE or normal.  This is different from swap-out
> accounting.

Agree, there is no THP swap-in now.

> 
> This patch should be squashed into
>     MM: handle THP in swap_*page_fs()
> 

This patch looks good to me. Thanks!

Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>

> Reported-by: Miaohe Lin <linmiaohe@huawei.com>
> Signed-off-by: NeilBrown <neilb@suse.de>
> ---
>  mm/page_io.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/page_io.c b/mm/page_io.c
> index d636a3531cad..1b8075ef3418 100644
> --- a/mm/page_io.c
> +++ b/mm/page_io.c
> @@ -280,8 +280,10 @@ static void sio_write_complete(struct kiocb *iocb, long ret)
>  			set_page_dirty(page);
>  			ClearPageReclaim(page);
>  		}
> -	} else
> -		count_vm_events(PSWPOUT, sio->pages);
> +	} else {
> +		for (p = 0; p < sio->pages; p++)
> +			count_swpout_vm_event(sio->bvec[p].bv_page);
> +	}
>  
>  	for (p = 0; p < sio->pages; p++)
>  		end_page_writeback(sio->bvec[p].bv_page);
> 


      reply	other threads:[~2022-05-09  9:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-02  4:57 [PATCH] MM: handle THP in swap_*page_fs() - count_vm_events() NeilBrown
2022-05-02  5:16 ` Matthew Wilcox
2022-05-02  5:28   ` NeilBrown
2022-05-02  5:31     ` Matthew Wilcox
2022-05-06 17:26       ` Yang Shi
2022-05-09  8:56         ` Miaohe Lin
2022-05-02  5:31 ` [PATCH v2] " NeilBrown
2022-05-09  8:54   ` Miaohe Lin [this message]

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=37653eca-e82e-62aa-6829-7413cb844b75@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=geert+renesas@glider.be \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=willy@infradead.org \
    /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.