1. 19 8月, 2018 1 次提交
  2. 18 8月, 2018 3 次提交
    • C
      tools/vm/page-types.c: add support for idle page tracking · 59ae96ff
      Christian Hansen 提交于
      Add a flag which causes page-types to use the kernels's idle page
      tracking to mark pages idle.  As the tool already prints the idle flag
      if set, subsequent runs will show which pages have been accessed since
      last run.
      
      [akpm@linux-foundation.org: simplify mark_page_idle()]
      [chansen3@cisco.com: reorganize mark_page_idle() logic, add docs]
        Link: http://lkml.kernel.org/r/20180706172237.21691-1-chansen3@cisco.com
      Link: http://lkml.kernel.org/r/20180612153223.13174-1-chansen3@cisco.comSigned-off-by: NChristian Hansen <chansen3@cisco.com>
      Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      59ae96ff
    • C
      tools/vm/page-types.c: include shared map counts · 7f1d23e6
      Christian Hansen 提交于
      Add a new flag that will read kpagecount for each PFN and print out the
      number of times the page is mapped along with the flags in the listing
      view.
      
      This information is useful in understanding and optimizing memory usage.
      Identifying pages which are not shared allows us to focus on adjusting
      the memory layout or access patterns for the sole owning process.
      Knowing the number of processes that share a page tells us how many
      other times we must make the same adjustments or how many processes to
      potentially disable.
      
      Truncated sample output:
      
        voffset map-cnt offset  len     flags
        561a3591e       1       15fe8   1       ___U_lA____Ma_b___________________________
        561a3591f       1       2b103   1       ___U_lA____Ma_b___________________________
        561a36ca4       1       2cc78   1       ___U_lA____Ma_b___________________________
        7f588bb4e       14      2273c   1       __RU_lA____M______________________________
      
      [akpm@linux-foundation.org: coding-style fixes]
      [chansen3@cisco.com: add documentation, tweak whitespace]
        Link: http://lkml.kernel.org/r/20180705181204.5529-1-chansen3@cisco.com
      Link: http://lkml.kernel.org/r/20180612153205.12879-1-chansen3@cisco.comSigned-off-by: NChristian Hansen <chansen3@cisco.com>
      Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7f1d23e6
    • N
      fs/seq_file.c: simplify seq_file iteration code and interface · 1f4aace6
      NeilBrown 提交于
      The documentation for seq_file suggests that it is necessary to be able
      to move the iterator to a given offset, however that is not the case.
      If the iterator is stored in the private data and is stable from one
      read() syscall to the next, it is only necessary to support first/next
      interactions.  Implementing this in a client is a little clumsy.
      
       - if ->start() is given a pos of zero, it should go to start of
         sequence.
      
       - if ->start() is given the name pos that was given to the most recent
         next() or start(), it should restore the iterator to state just
         before that last call
      
       - if ->start is given another number, it should set the iterator one
         beyond the start just before the last ->start or ->next call.
      
      Also, the documentation says that the implementation can interpret the
      pos however it likes (other than zero meaning start), but seq_file
      increments the pos sometimes which does impose on the implementation.
      
      This patch simplifies the interface for first/next iteration and
      simplifies the code, while maintaining complete backward compatability.
      Now:
      
       - if ->start() is given a pos of zero, it should return an iterator
         placed at the start of the sequence
      
       - if ->start() is given a non-zero pos, it should return the iterator
         in the same state it was after the last ->start or ->next.
      
      This is particularly useful for interators which walk the multiple
      chains in a hash table, e.g.  using rhashtable_walk*.  See
      fs/gfs2/glock.c and drivers/staging/lustre/lustre/llite/vvp_dev.c
      
      A large part of achieving this is to *always* call ->next after ->show
      has successfully stored all of an entry in the buffer.  Never just
      increment the index instead.  Also:
      
       - always pass &m->index to ->start() and ->next(), never a temp
         variable
      
       - don't clear ->from when ->count is zero, as ->from is dead when
         ->count is zero.
      
      Some ->next functions do not increment *pos when they return NULL.  To
      maintain compatability with this, we still need to increment m->index in
      one place, if ->next didn't increment it.  Note that such ->next
      functions are buggy and should be fixed.  A simple demonstration is
      
         dd if=/proc/swaps bs=1000 skip=1
      
      Choose any block size larger than the size of /proc/swaps.  This will
      always show the whole last line of /proc/swaps.
      
      This patch doesn't work around buggy next() functions for this case.
      
      [neilb@suse.com: ensure ->from is valid]
        Link: http://lkml.kernel.org/r/87601ryb8a.fsf@notabene.neil.brown.nameSigned-off-by: NNeilBrown <neilb@suse.com>
      Acked-by: Jonathan Corbet <corbet@lwn.net>	[docs]
      Tested-by: NJann Horn <jannh@google.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Kees Cook <keescook@chromium.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1f4aace6
  3. 15 8月, 2018 2 次提交
  4. 13 8月, 2018 2 次提交
  5. 11 8月, 2018 4 次提交
  6. 10 8月, 2018 5 次提交
  7. 08 8月, 2018 5 次提交
  8. 07 8月, 2018 2 次提交
  9. 06 8月, 2018 1 次提交
  10. 05 8月, 2018 2 次提交
  11. 03 8月, 2018 7 次提交
  12. 02 8月, 2018 6 次提交