1. 15 Apr, 2016 1 commit
  2. 10 Sep, 2015 2 commits
    • Vladimir Davydov's avatar
      proc: export idle flag via kpageflags · f074a8f4
      Vladimir Davydov authored
      As noted by Minchan, a benefit of reading idle flag from /proc/kpageflags
      is that one can easily filter dirty and/or unevictable pages while
      estimating the size of unused memory.
      
      Note that idle flag read from /proc/kpageflags may be stale in case the
      page was accessed via a PTE, because it would be too costly to iterate
      over all page mappings on each /proc/kpageflags read to provide an
      up-to-date value.  To make sure the flag is up-to-date one has to read
      /sys/kernel/mm/page_idle/bitmap first.
      Signed-off-by: default avatarVladimir Davydov <vdavydov@parallels.com>
      Reviewed-by: default avatarAndres Lagar-Cavilla <andreslc@google.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: Greg Thelen <gthelen@google.com>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f074a8f4
    • Vladimir Davydov's avatar
      proc: add kpagecgroup file · 80ae2fdc
      Vladimir Davydov authored
      /proc/kpagecgroup contains a 64-bit inode number of the memory cgroup each
      page is charged to, indexed by PFN.  Having this information is useful for
      estimating a cgroup working set size.
      
      The file is present if CONFIG_PROC_PAGE_MONITOR && CONFIG_MEMCG.
      Signed-off-by: default avatarVladimir Davydov <vdavydov@parallels.com>
      Reviewed-by: default avatarAndres Lagar-Cavilla <andreslc@google.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: Greg Thelen <gthelen@google.com>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      80ae2fdc
  3. 08 Sep, 2015 2 commits
  4. 11 Apr, 2015 1 commit
  5. 12 Feb, 2015 1 commit
  6. 03 Jul, 2013 1 commit
    • Pavel Emelyanov's avatar
      pagemap: prepare to reuse constant bits with page-shift · 541c237c
      Pavel Emelyanov authored
      In order to reuse bits from pagemap entries gracefully, we leave the
      entries as is but on pagemap open emit a warning in dmesg, that bits
      55-60 are about to change in a couple of releases.  Next, if a user
      issues soft-dirty clear command via the clear_refs file (it was disabled
      before v3.9) we assume that he's aware of the new pagemap format, note
      that fact and report the bits in pagemap in the new manner.
      
      The "migration strategy" looks like this then:
      
      1. existing users are not affected -- they don't touch soft-dirty feature, thus
         see old bits in pagemap, but are warned and have time to fix themselves
      2. those who use soft-dirty know about new pagemap format
      3. some time soon we get rid of any signs of page-shift in pagemap as well as
         this trick with clear-soft-dirty affecting pagemap format.
      Signed-off-by: default avatarPavel Emelyanov <xemul@parallels.com>
      Cc: Matt Mackall <mpm@selenic.com>
      Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
      Cc: Glauber Costa <glommer@parallels.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      541c237c
  7. 28 May, 2013 1 commit
  8. 01 Jun, 2012 1 commit
    • Konstantin Khlebnikov's avatar
      proc: report file/anon bit in /proc/pid/pagemap · 052fb0d6
      Konstantin Khlebnikov authored
      This is an implementation of Andrew's proposal to extend the pagemap file
      bits to report what is missing about tasks' working set.
      
      The problem with the working set detection is multilateral.  In the criu
      (checkpoint/restore) project we dump the tasks' memory into image files
      and to do it properly we need to detect which pages inside mappings are
      really in use.  The mincore syscall I though could help with this did not.
       First, it doesn't report swapped pages, thus we cannot find out which
      parts of anonymous mappings to dump.  Next, it does report pages from page
      cache as present even if they are not mapped, and it doesn't make that has
      not been cow-ed.
      
      Note, that issue with swap pages is critical -- we must dump swap pages to
      image file.  But the issues with file pages are optimization -- we can
      take all file pages to image, this would be correct, but if we know that a
      page is not mapped or not cow-ed, we can remove them from dump file.  The
      dump would still be self-consistent, though significantly smaller in size
      (up to 10 times smaller on real apps).
      
      Andrew noticed, that the proc pagemap file solved 2 of 3 above issues --
      it reports whether a page is present or swapped and it doesn't report not
      mapped page cache pages.  But, it doesn't distinguish cow-ed file pages
      from not cow-ed.
      
      I would like to make the last unused bit in this file to report whether the
      page mapped into respective pte is PageAnon or not.
      
      [comment stolen from Pavel Emelyanov's v1 patch]
      Signed-off-by: default avatarKonstantin Khlebnikov <khlebnikov@openvz.org>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Cc: Matt Mackall <mpm@selenic.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Rik van Riel <riel@redhat.com>
      Acked-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      052fb0d6
  9. 22 Mar, 2012 1 commit
  10. 08 Oct, 2009 2 commits
  11. 17 Jun, 2009 2 commits
  12. 06 Jun, 2008 1 commit