linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Hugh Dickins <hughd@google.com>
Subject: Re: [PATCH] mm/smaps: Use vma->vm_pgoff directly when counting partial swap
Date: Thu, 16 Sep 2021 20:29:57 -0400	[thread overview]
Message-ID: <YUPhhXPGlizmd4dj@t490s> (raw)
In-Reply-To: <738511ae-b253-9927-eca1-97d621d9f149@suse.cz>

On Fri, Sep 17, 2021 at 12:17:32AM +0200, Vlastimil Babka wrote:
> On 9/16/21 11:58 PM, Peter Xu wrote:
> > linear_page_index(vma, vma->vm_start) of a shmem vma is exactly vm_pgoff.
> 
> Could you use "vma->vm_pgoff + vma_pages(vma)" instead of the other
> linear_page_index() then?

Sure.

> 
> But now I wonder, is smaps_pte_hole() broken? it calls
> shmem_partial_swap_usage with addresses, not pgoffs?

Hmm, that seems true..  I guess it still gets the right number when start==0
and when the vma covers the whole file (which could be the simplest scenario),
but not otherwise.

I'll add a new patch.

Thanks,

-- 
Peter Xu



      reply	other threads:[~2021-09-17  0:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16 21:58 Peter Xu
2021-09-16 22:17 ` Vlastimil Babka
2021-09-17  0:29   ` Peter Xu [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=YUPhhXPGlizmd4dj@t490s \
    --to=peterx@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=vbabka@suse.cz \
    /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