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: <CALYGNiPZFPMTuS_Obe9Ax9i2isS5ucY86JRF6JjGgKuTPuwEvA@mail.gmail.com>
Date:	Wed, 11 Mar 2015 23:03:37 +0300
From:	Konstantin Khlebnikov <koct9i@...il.com>
To:	Vlastimil Babka <vbabka@...e.cz>
Cc:	"linux-mm@...ck.org" <linux-mm@...ck.org>,
	Jerome Marchand <jmarchan@...hat.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-doc@...r.kernel.org, Hugh Dickins <hughd@...gle.com>,
	Michal Hocko <mhocko@...e.cz>,
	"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
	Cyrill Gorcunov <gorcunov@...nvz.org>,
	Randy Dunlap <rdunlap@...radead.org>,
	linux-s390@...r.kernel.org,
	Martin Schwidefsky <schwidefsky@...ibm.com>,
	Heiko Carstens <heiko.carstens@...ibm.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Paul Mackerras <paulus@...ba.org>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Oleg Nesterov <oleg@...hat.com>
Subject: Re: [PATCH 2/4] mm, procfs: account for shmem swap in /proc/pid/smaps

On Wed, Mar 11, 2015 at 10:10 PM, Vlastimil Babka <vbabka@...e.cz> wrote:
> On 03/11/2015 01:30 PM, Konstantin Khlebnikov wrote:
>>
>> On Thu, Feb 26, 2015 at 4:51 PM, Vlastimil Babka <vbabka@...e.cz> wrote:
>>>
>>> Currently, /proc/pid/smaps will always show "Swap: 0 kB" for shmem-backed
>>> mappings, even if the mapped portion does contain pages that were swapped
>>> out.
>>> This is because unlike private anonymous mappings, shmem does not change
>>> pte
>>> to swap entry, but pte_none when swapping the page out. In the smaps page
>>> walk, such page thus looks like it was never faulted in.
>>
>>
>> Maybe just add count of swap entries allocated by mapped shmem into
>> swap usage of this vma? That's isn't exactly correct for partially
>> mapped shmem but this is something weird anyway.
>
>
> Yeah for next version I want to add a patch optimizing for the (hopefully)
> common cases:
>
> 1. SHMEM_I(inode)->swapped is 0 - no need to consult radix tree
> 2. shmem inode is mapped fully (I hope it's ok to just compare its size and
> mapping size) - just use the value of SHMEM_I(inode)->swapped like you
> suggest
>

BTW using radix tree iterator you can count swap entries without
touching page->count.

Also long time ago I've suggested to mark swap entries in shmem with
one of radix tree tag -- tagged iterator is much faster for sparse trees.
(just for this case it's overkill but these tags can speedup swapoff)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ