lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <80d9ecc9-77db-e355-0e95-50ee8698694b@suse.cz>
Date:   Wed, 22 Sep 2021 12:41:56 +0200
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Peter Xu <peterx@...hat.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Hugh Dickins <hughd@...gle.com>,
        Andrea Arcangeli <aarcange@...hat.com>,
        Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH 2/3] mm/smaps: Use vma->vm_pgoff directly when counting
 partial swap

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@...e.cz>
> Cc: Hugh Dickins <hughd@...gle.com>
> Signed-off-by: Peter Xu <peterx@...hat.com>

Reviewed-by: Vlastimil Babka <vbabka@...e.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));
>  }
>  
>  /*
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ