All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Peter Xu <peterx@redhat.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Hugh Dickins <hughd@google.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Matthew Wilcox <willy@infradead.org>
Subject: Re: [PATCH 2/3] mm/smaps: Use vma->vm_pgoff directly when counting partial swap
Date: Wed, 22 Sep 2021 12:41:56 +0200	[thread overview]
Message-ID: <80d9ecc9-77db-e355-0e95-50ee8698694b@suse.cz> (raw)
In-Reply-To: <20210917164756.8586-3-peterx@redhat.com>

On 9/17/21 18:47, Peter Xu wrote:
> As it's trying to cover the whole vma anyways, use direct vm_pgoff value and
> vma_pages() rather than linear_page_index.
> 
> Cc: Vlastimil Babka <vbabka@suse.cz>
> Cc: Hugh Dickins <hughd@google.com>
> Signed-off-by: Peter Xu <peterx@redhat.com>

Reviewed-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  mm/shmem.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/shmem.c b/mm/shmem.c
> index 96ccf6e941aa..d2620db8c938 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -856,9 +856,8 @@ unsigned long shmem_swap_usage(struct vm_area_struct *vma)
>  		return swapped << PAGE_SHIFT;
>  
>  	/* Here comes the more involved part */
> -	return shmem_partial_swap_usage(mapping,
> -			linear_page_index(vma, vma->vm_start),
> -			linear_page_index(vma, vma->vm_end));
> +	return shmem_partial_swap_usage(mapping, vma->vm_pgoff,
> +					vma->vm_pgoff + vma_pages(vma));
>  }
>  
>  /*
> 


  reply	other threads:[~2021-09-22 10:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17 16:47 [PATCH 0/3] mm/smaps: Fixes and optimizations on shmem swap handling Peter Xu
2021-09-17 16:47 ` [PATCH 1/3] mm/smaps: Fix shmem pte hole swap calculation Peter Xu
2021-09-22 10:40   ` Vlastimil Babka
2021-09-17 16:47 ` [PATCH 2/3] mm/smaps: Use vma->vm_pgoff directly when counting partial swap Peter Xu
2021-09-22 10:41   ` Vlastimil Babka [this message]
2021-09-17 16:47 ` [PATCH 3/3] mm/smaps: Simplify shmem handling of pte holes Peter Xu
2021-10-05 11:15   ` Vlastimil Babka
2021-10-05 14:40     ` Peter Xu

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=80d9ecc9-77db-e355-0e95-50ee8698694b@suse.cz \
    --to=vbabka@suse.cz \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peterx@redhat.com \
    --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.