1. 09 Jan, 2019 1 commit
  2. 28 Dec, 2018 1 commit
  3. 04 Sep, 2018 2 commits
  4. 17 Aug, 2018 2 commits
  5. 08 Jun, 2018 1 commit
  6. 21 Feb, 2018 1 commit
    • Martin Kelly's avatar
      tools: fix cross-compile var clobbering · 7ed1c190
      Martin Kelly authored
      Currently a number of Makefiles break when used with toolchains that
      pass extra flags in CC and other cross-compile related variables (such
      as --sysroot).
      
      Thus we get this error when we use a toolchain that puts --sysroot in
      the CC var:
      
        ~/src/linux/tools$ make iio
        [snip]
        iio_event_monitor.c:18:10: fatal error: unistd.h: No such file or directory
          #include <unistd.h>
                   ^~~~~~~~~~
      
      This occurs because we clobber several env vars related to
      cross-compiling with lines like this:
      
        CC = $(CROSS_COMPILE)gcc
      
      Although this will point to a valid cross-compiler, we lose any extra
      flags that might exist in the CC variable, which can break toolchains
      that rely on them (for example, those that use --sysroot).
      
      This easily shows up using a Yocto SDK:
      
        $ . [snip]/sdk/environment-setup-cortexa8hf-neon-poky-linux-gnueabi
      
        $ echo $CC
        arm-poky-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard
        -mcpu=cortex-a8
        --sysroot=[snip]/sdk/sysroots/cortexa8hf-neon-poky-linux-gnueabi
      
        $ echo $CROSS_COMPILE
        arm-poky-linux-gnueabi-
      
        $ echo ${CROSS_COMPILE}gcc
        krm-poky-linux-gnueabi-gcc
      
      Although arm-poky-linux-gnueabi-gcc is a cross-compiler, we've lost the
      --sysroot and other flags that enable us to find the right libraries to
      link against, so we can't find unistd.h and other libraries and headers.
      Normally with the --sysroot flag we would find unistd.h in the sdk
      directory in the sysroot:
      
        $ find [snip]/sdk/sysroots -path '*/usr/include/unistd.h'
        [snip]/sdk/sysroots/cortexa8hf-neon-poky-linux-gnueabi/usr/include/unistd.h
      
      The perf Makefile adds CC = $(CROSS_COMPILE)gcc if and only if CC is not
      already set, and it compiles correctly with the above toolchain.
      
      So, generalize the logic that perf uses in the common Makefile and
      remove the manual CC = $(CROSS_COMPILE)gcc lines from each Makefile.
      
      Note that this patch does not fix cross-compile for all the tools (some
      have other bugs), but it does fix it for all except usb and acpi, which
      still have other unrelated issues.
      
      I tested both with and without the patch on native and cross-build and
      there appear to be no regressions.
      
      Link: http://lkml.kernel.org/r/20180107214028.23771-1-martin@martingkelly.comSigned-off-by: 's avatarMartin Kelly <martin@martingkelly.com>
      Acked-by: 's avatarMark Brown <broonie@kernel.org>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Li Zefan <lizefan@huawei.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Jonathan Cameron <jic23@kernel.org>
      Cc: Pali Rohar <pali.rohar@gmail.com>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Robert Moore <robert.moore@intel.com>
      Cc: Lv Zheng <lv.zheng@intel.com>
      Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Valentina Manea <valentina.manea.m@gmail.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Mario Limonciello <mario.limonciello@dell.com>
      Signed-off-by: 's avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: 's avatarLinus Torvalds <torvalds@linux-foundation.org>
      7ed1c190
  7. 01 Feb, 2018 1 commit
  8. 15 Dec, 2017 1 commit
  9. 16 Nov, 2017 1 commit
  10. 02 Nov, 2017 1 commit
    • Greg Kroah-Hartman's avatar
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman authored
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: 's avatarKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: 's avatarPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: 's avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  11. 23 Feb, 2017 1 commit
  12. 26 Jul, 2016 1 commit
  13. 23 Jul, 2016 1 commit
  14. 25 Jun, 2016 1 commit
  15. 17 Mar, 2016 3 commits
  16. 15 Mar, 2016 1 commit
  17. 21 Nov, 2015 1 commit
  18. 06 Nov, 2015 8 commits
    • Sergey Senozhatsky's avatar
      tools/vm/slabinfo: gnuplot slabifo extended stat · 4a981abd
      Sergey Senozhatsky authored
      GNUplot `slabinfo -X' stats, collected, for example, using the
      following command:
        while [ 1 ]; do slabinfo -X >> stats; sleep 1; done
      
      `slabinfo-gnuplot.sh stats' pre-processes collected records
      and generate graphs (totals, slabs sorted by size, slabs
      sorted by size).
      
      Graphs can be [individually] regenerate with different samples
      range and graph width-heigh (-r %d,%d and -s %d,%d options).
      
      To visually compare N `totals' graphs:
        slabinfo-gnuplot.sh -t FILE1-totals FILE2-totals ... FILEN-totals
      Signed-off-by: 's avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: 's avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: 's avatarLinus Torvalds <torvalds@linux-foundation.org>
      4a981abd
    • Sergey Senozhatsky's avatar
      tools/vm/slabinfo: cosmetic globals cleanup · 2cee611a
      Sergey Senozhatsky authored
      checkpatch.pl complains about globals being explicitly zeroed
      out: "ERROR: do not initialise globals to 0 or NULL".
      
      New globals, introduced in this patch set, have no explicit 0
      initialization; clean up the old ones to make it less hairy.
      Signed-off-by: 's avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: 's avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: 's avatarLinus Torvalds <torvalds@linux-foundation.org>
      2cee611a
    • Sergey Senozhatsky's avatar
      tools/vm/slabinfo: output sizes in bytes · a8ea0bf1
      Sergey Senozhatsky authored
      Introduce "-B|--Bytes" opt to disable store_size() dynamic
      size scaling and report size in bytes instead.
      
      This `expands' the interface a bit, it's impossible to use
      printf("%6s") anymore to output sizes.
      
      Example:
      
      slabinfo -X -N 2
       Slabcache Totals
       ----------------
       Slabcaches :              91   Aliases  :         119->69   Active:     63
       Memory used:       199798784   # Loss   :        10689376   MRatio:     5%
       # Objects  :          324301   # PartObj:           18151   ORatio:     5%
      
       Per Cache         Average              Min              Max            Total
       ----------------------------------------------------------------------------
       #Objects             5147                1            89068           324301
       #Slabs                199                1             3886            12537
       #PartSlab              12                0              240              778
       %PartSlab             32%               0%             100%               6%
       PartObjs                5                0             4569            18151
       % PartObj             26%               0%             100%               5%
       Memory            3171409             8192        127336448        199798784
       Used              3001736              160        121429728        189109408
       Loss               169672                0          5906720         10689376
      
       Per Object        Average              Min              Max
       -----------------------------------------------------------
       Memory                585                8             8192
       User                  583                8             8192
       Loss                    2                0               64
      
       Slabs sorted by size
       --------------------
       Name                   Objects Objsize           Space Slabs/Part/Cpu  O/S O %Fr %Ef Flg
       ext4_inode_cache         69948    1736       127336448      3871/0/15   18 3   0  95 a
       dentry                   89068     288        26058752      3164/0/17   28 1   0  98 a
      
       Slabs sorted by loss
       --------------------
       Name                   Objects Objsize            Loss Slabs/Part/Cpu  O/S O %Fr %Ef Flg
       ext4_inode_cache         69948    1736         5906720      3871/0/15   18 3   0  95 a
       inode_cache              11628     864          537472        642/0/4   18 2   0  94 a
      
      Besides, store_size() does not use powers of two for G/M/K
      
          if (value > 1000000000UL) {
                  divisor = 100000000UL;
                  trailer = 'G';
          } else if (value > 1000000UL) {
                  divisor = 100000UL;
                  trailer = 'M';
          } else if (value > 1000UL) {
                  divisor = 100;
                  trailer = 'K';
          }
      Signed-off-by: 's avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: 's avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: 's avatarLinus Torvalds <torvalds@linux-foundation.org>
      a8ea0bf1
    • Sergey Senozhatsky's avatar
      tools/vm/slabinfo: introduce extended totals mode · 016c6cdf
      Sergey Senozhatsky authored
      Add "-X|--Xtotals" opt to output extended totals summary,
      which includes:
      -- totals summary
      -- slabs sorted by size
      -- slabs sorted by loss (waste)
      
      Example:
      =======
      
      slabinfo --X -N 1
        Slabcache Totals
        ----------------
        Slabcaches :  91      Aliases  : 120->69  Active:  65
        Memory used: 568.3M   # Loss   :  30.4M   MRatio:     5%
        # Objects  : 920.1K   # PartObj: 161.2K   ORatio:    17%
      
        Per Cache    Average         Min         Max       Total
        ---------------------------------------------------------
        #Objects       14.1K           1      227.8K      920.1K
        #Slabs           533           1       11.7K       34.7K
        #PartSlab         86           0        4.3K        5.6K
        %PartSlab        24%          0%        100%         16%
        PartObjs          17           0      129.3K      161.2K
        % PartObj        17%          0%        100%         17%
        Memory          8.7M        8.1K      384.7M      568.3M
        Used            8.2M         160      366.5M      537.9M
        Loss          468.8K           0       18.2M       30.4M
      
        Per Object   Average         Min         Max
        ---------------------------------------------
        Memory           587           8        8.1K
        User             584           8        8.1K
        Loss               2           0          64
      
        Slabs sorted by size
        ----------------------
        Name                   Objects Objsize    Space Slabs/Part/Cpu  O/S O %Fr %Ef Flg
        ext4_inode_cache        211142    1736   384.7M    11732/40/10   18 3   0  95 a
      
        Slabs sorted by loss
        ----------------------
        Name                   Objects Objsize    Loss Slabs/Part/Cpu  O/S O %Fr %Ef Flg
        ext4_inode_cache        211142    1736    18.2M    11732/40/10   18 3   0  95 a
      Signed-off-by: 's avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: 's avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: 's avatarLinus Torvalds <torvalds@linux-foundation.org>
      016c6cdf
    • Sergey Senozhatsky's avatar
      tools/vm/slabinfo: fix alternate opts names · 0d00bf58
      Sergey Senozhatsky authored
      Fix mismatches between usage() output and real opts[] options.  Add
      missing alternative opt names, e.g., '-S' had no '--Size' opts[] entry,
      etc.
      Signed-off-by: 's avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: 's avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: 's avatarLinus Torvalds <torvalds@linux-foundation.org>
      0d00bf58
    • Sergey Senozhatsky's avatar
      tools/vm/slabinfo: sort slabs by loss · 2651f6e7
      Sergey Senozhatsky authored
      Introduce opt "-L|--sort-loss" to sort and output slabs by
      loss (waste) in slabcache().
      Signed-off-by: 's avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: 's avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: 's avatarLinus Torvalds <torvalds@linux-foundation.org>
      2651f6e7
    • Sergey Senozhatsky's avatar
      tools/vm/slabinfo: limit the number of reported slabs · 4980a963
      Sergey Senozhatsky authored
      Introduce opt "-N|--lines=K" to limit the number of slabs
      being reported in output_slabs().
      Signed-off-by: 's avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: 's avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: 's avatarLinus Torvalds <torvalds@linux-foundation.org>
      4980a963
    • Sergey Senozhatsky's avatar
      tools/vm/slabinfo: use getopt no_argument/optional_argument · 2b100755
      Sergey Senozhatsky authored
      This patchset adds 'extended' slabinfo mode that provides additional
      information:
      
       -- totals summary
       -- slabs sorted by size
       -- slabs sorted by loss (waste)
      
      The patches also introduces several new slabinfo options to limit the
      number of slabs reported, sort slabs by loss (waste); and some fixes.
      
      Extended output example (slabinfo -X -N 2):
      
       Slabcache Totals
       ----------------
       Slabcaches :              91   Aliases  :         119->69   Active:     63
       Memory used:       199798784   # Loss   :        10689376   MRatio:     5%
       # Objects  :          324301   # PartObj:           18151   ORatio:     5%
      
       Per Cache         Average              Min              Max            Total
       ----------------------------------------------------------------------------
       #Objects             5147                1            89068           324301
       #Slabs                199                1             3886            12537
       #PartSlab              12                0              240              778
       %PartSlab             32%               0%             100%               6%
       PartObjs                5                0             4569            18151
       % PartObj             26%               0%             100%               5%
       Memory            3171409             8192        127336448        199798784
       Used              3001736              160        121429728        189109408
       Loss               169672                0          5906720         10689376
      
       Per Object        Average              Min              Max
       -----------------------------------------------------------
       Memory                585                8             8192
       User                  583                8             8192
       Loss                    2                0               64
      
       Slabs sorted by size
       --------------------
       Name                   Objects Objsize           Space Slabs/Part/Cpu  O/S O %Fr %Ef Flg
       ext4_inode_cache         69948    1736       127336448      3871/0/15   18 3   0  95 a
       dentry                   89068     288        26058752      3164/0/17   28 1   0  98 a
      
       Slabs sorted by loss
       --------------------
       Name                   Objects Objsize            Loss Slabs/Part/Cpu  O/S O %Fr %Ef Flg
       ext4_inode_cache         69948    1736         5906720      3871/0/15   18 3   0  95 a
       inode_cache              11628     864          537472        642/0/4   18 2   0  94 a
      
      The last patch in the series addresses Linus' comment from
      http://marc.info/?l=linux-mm&m=144148518703321&w=2
      
      (well, it's been some time. sorry.)
      
      gnuplot script takes the slabinfo records file, where every record is a `slabinfo -X'
      output. So the basic workflow is, for example, as follows:
      
              while [ 1 ]; do slabinfo -X -N 2 >> stats; sleep 1; done
              ^C
              slabinfo-gnuplot.sh stats
      
      The last command will produce 3 png files (and 3 stats files)
      -- graph of slabinfo totals
      -- graph of slabs by size
      -- graph of slabs by loss
      
      It's also possible to select a range of records for plotting (a range of collected
      slabinfo outputs) via `-r 10,100` (for example); and compare totals from several
      measurements (to visially compare slabs behaviour (10,50 range)) using
      pre-parsed totals files:
              slabinfo-gnuplot.sh -r 10,50 -t stats-totals1 .. stats-totals2
      
      This also, technically, supports ktest. Upload new slabinfo to target,
      collect the stats and give the resulting stats file to slabinfo-gnuplot
      
      This patch (of 8):
      
      Use getopt constants in `struct option' ->has_arg instead of numerical
      representations.
      Signed-off-by: 's avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: 's avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: 's avatarLinus Torvalds <torvalds@linux-foundation.org>
      2b100755
  19. 23 Sep, 2015 1 commit
    • Arnaldo Carvalho de Melo's avatar
      tools vm: Fix build due to removal of tools/lib/api/fs/debugfs.h · f6489bc2
      Arnaldo Carvalho de Melo authored
      There were some changes in how this debugfs mounting helper is
      implemented/exported and we forgot to check if there were other users
      besides perf, fix it.
      
      Need to do a make -C tools/ everytime we do changes to
      tools/{lib,include} and other places where we're moving things from
      tools/perf/ to be used by other tools/ living code.
      
      Fixed:
      
        $ make -C tools/vm
        make: Entering directory '/home/git/linux/tools/vm'
        make -C ../lib/api
        make[1]: Entering directory '/home/git/linux/tools/lib/api'
          CC       fd/array.o
          LD       fd/libapi-in.o
          CC       fs/fs.o
          CC       fs/tracing_path.o
          LD       fs/libapi-in.o
          CC       cpu.o
          LD       libapi-in.o
          AR       libapi.a
        make[1]: Leaving directory '/home/git/linux/tools/lib/api'
        gcc -Wall -Wextra -I../lib/ -o page-types page-types.c ../lib/api/libapi.a
        make: Leaving directory '/home/git/linux/tools/vm'
        $
      Reported-by: 's avatarVinson Lee <vlee@twopensource.com>
      Tested-by: 's avatarVinson Lee <vlee@twopensource.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Matt Fleming <matt@codeblueprint.co.uk>
      Cc: Raphael Beamonte <raphael.beamonte@gmail.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Fixes: 60a1133a ("tools lib api fs: Remove debugfs, tracefs and findfs objects")
      Signed-off-by: 's avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f6489bc2
  20. 08 Sep, 2015 2 commits
  21. 15 May, 2015 1 commit
  22. 12 May, 2015 1 commit
  23. 12 Feb, 2015 1 commit
  24. 13 Dec, 2014 1 commit
    • Joonsoo Kim's avatar
      mm/page_owner: keep track of page owners · 48c96a36
      Joonsoo Kim authored
      This is the page owner tracking code which is introduced so far ago.  It
      is resident on Andrew's tree, though, nobody tried to upstream so it
      remain as is.  Our company uses this feature actively to debug memory leak
      or to find a memory hogger so I decide to upstream this feature.
      
      This functionality help us to know who allocates the page.  When
      allocating a page, we store some information about allocation in extra
      memory.  Later, if we need to know status of all pages, we can get and
      analyze it from this stored information.
      
      In previous version of this feature, extra memory is statically defined in
      struct page, but, in this version, extra memory is allocated outside of
      struct page.  It enables us to turn on/off this feature at boottime
      without considerable memory waste.
      
      Although we already have tracepoint for tracing page allocation/free,
      using it to analyze page owner is rather complex.  We need to enlarge the
      trace buffer for preventing overlapping until userspace program launched.
      And, launched program continually dump out the trace buffer for later
      analysis and it would change system behaviour with more possibility rather
      than just keeping it in memory, so bad for debug.
      
      Moreover, we can use page_owner feature further for various purposes.  For
      example, we can use it for fragmentation statistics implemented in this
      patch.  And, I also plan to implement some CMA failure debugging feature
      using this interface.
      
      I'd like to give the credit for all developers contributed this feature,
      but, it's not easy because I don't know exact history.  Sorry about that.
      Below is people who has "Signed-off-by" in the patches in Andrew's tree.
      
      Contributor:
      Alexander Nyberg <alexn@dsv.su.se>
      Mel Gorman <mgorman@suse.de>
      Dave Hansen <dave@linux.vnet.ibm.com>
      Minchan Kim <minchan@kernel.org>
      Michal Nazarewicz <mina86@mina86.com>
      Andrew Morton <akpm@linux-foundation.org>
      Jungsoo Son <jungsoo.son@lge.com>
      Signed-off-by: 's avatarJoonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Dave Hansen <dave@sr71.net>
      Cc: Michal Nazarewicz <mina86@mina86.com>
      Cc: Jungsoo Son <jungsoo.son@lge.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: 's avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: 's avatarLinus Torvalds <torvalds@linux-foundation.org>
      48c96a36
  25. 10 Oct, 2014 1 commit
  26. 04 Jun, 2014 1 commit
  27. 07 Apr, 2014 1 commit
    • Konstantin Khlebnikov's avatar
      tools/vm/page-types.c: page-cache sniffing feature · 65a6a410
      Konstantin Khlebnikov authored
      After this patch 'page-types' can walk over a file's mappings and
      analyze populated page cache pages mostly without disturbing its state.
      
      It maps chunk of file, marks VMA as MADV_RANDOM to turn off readahead,
      pokes VMA via mincore() to determine cached pages, triggers page-fault
      only for them, and finally gathers information via pagemap/kpageflags.
      Before unmap it marks VMA as MADV_SEQUENTIAL for ignoring reference
      bits.
      
      usage: page-types -f <path>
      
      If <path> is directory it will analyse all files in all subdirectories.
      
      Symlinks are not followed as well as mount points.  Hardlinks aren't
      handled, they'll be dumped as many times as they are found.  Recursive
      walk brings all dentries into dcache and populates page cache of
      block-devices aka 'Buffers'.
      
      Probably it's worth to add ioctl for dumping file page cache as array of
      PFNs as a replacement for this hackish juggling with
      mmap/madvise/mincore/pagemap.  Also recursive walk could be replaced
      with dumping cached inodes via some ioctl or debugfs interface followed
      by openning them via open_by_handle_at, this would fix hardlinks
      handling and unneeded population of dcache and buffers.  This interface
      might be used as data source for constructing readahead plans and for
      background optimizations of actively used files.
      
      collateral changes:
      + fix 64-bit LFS: define _FILE_OFFSET_BITS instead of _LARGEFILE64_SOURCE
      + replace lseek + read with single pread
      + make show_page_range() reusable after flush
      
      usage example:
      
        ~/src/linux/tools/vm$ sudo ./page-types -L -f page-types
        foffset offset    flags
        page-types       Inode: 2229277       Size: 89065 (22 pages)
        Modify: Tue Feb 25 12:00:59 2014 (162 seconds ago)
        Access: Tue Feb 25 12:01:00 2014 (161 seconds ago)
        0       3cbf3b     __RU_lA____M________________________
        1       38946a     __RU_lA____M________________________
        2       1a3cec     __RU_lA____M________________________
        3       1a8321     __RU_lA____M________________________
        4       3af7cc     __RU_lA____M________________________
        5       1ed532     __RU_lA_____________________________
        6       2e436a     __RU_lA_____________________________
        7       29a35e     ___U_lA_____________________________
        8       2de86e     ___U_lA_____________________________
        9       3bdfb4     ___U_lA_____________________________
        10      3cd8a3     ___U_lA_____________________________
        11      2afa50     ___U_lA_____________________________
        12      2534c2     ___U_lA_____________________________
        13      1b7a40     ___U_lA_____________________________
        14      17b0be     ___U_lA_____________________________
        15      392b0c     ___U_lA_____________________________
        16      3ba46a     __RU_lA_____________________________
        17      397dc8     ___U_lA_____________________________
        18      1f2a36     ___U_lA_____________________________
        19      21fd30     __RU_lA_____________________________
        20      2c35ba     __RU_l______________________________
        21      20f181     __RU_l______________________________
      
                     flags page-count   MB  symbolic-flags                        long-symbolic-flags
        0x000000000000002c          2    0  __RU_l______________________________  referenced,uptodate,lru
        0x0000000000000068         11    0  ___U_lA_____________________________  uptodate,lru,active
        0x000000000000006c          4    0  __RU_lA_____________________________  referenced,uptodate,lru,active
        0x000000000000086c          5    0  __RU_lA____M________________________  referenced,uptodate,lru,active,mmap
                     total         22    0
      
        ~/src/linux/tools/vm$ sudo ./page-types -f /
                     flags page-count     MB  symbolic-flags                        long-symbolic-flags
        0x0000000000000028      21761     85  ___U_l______________________________  uptodate,lru
        0x000000000000002c     127279    497  __RU_l______________________________  referenced,uptodate,lru
        0x0000000000000068      74160    289  ___U_lA_____________________________  uptodate,lru,active
        0x000000000000006c      84469    329  __RU_lA_____________________________  referenced,uptodate,lru,active
        0x000000000000007c          1      0  __RUDlA_____________________________  referenced,uptodate,dirty,lru,active
        0x0000000000000228        370      1  ___U_l___I__________________________  uptodate,lru,reclaim
        0x0000000000000828         49      0  ___U_l_____M________________________  uptodate,lru,mmap
        0x000000000000082c        126      0  __RU_l_____M________________________  referenced,uptodate,lru,mmap
        0x0000000000000868        137      0  ___U_lA____M________________________  uptodate,lru,active,mmap
        0x000000000000086c      12890     50  __RU_lA____M________________________  referenced,uptodate,lru,active,mmap
                     total     321242   1254
      Signed-off-by: 's avatarKonstantin Khlebnikov <koct9i@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Signed-off-by: 's avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: 's avatarLinus Torvalds <torvalds@linux-foundation.org>
      65a6a410
  28. 16 Dec, 2013 1 commit
    • Borislav Petkov's avatar
      tools/: Convert to new topic libraries · 553873e1
      Borislav Petkov authored
      Move debugfs.* to api/fs/. We have a common tools/lib/api/ place where
      the Makefile lives and then we place the headers in subdirs.
      
      For example, all the fs-related stuff goes to tools/lib/api/fs/ from
      which we get libapikfs.a (acme got almost the naming he wanted :-)) and
      we link it into the tools which need it - in this case perf and
      tools/vm/page-types.
      
      acme:
      
      "Looking at the implementation, I think some tools can even link
      directly to the .o files, avoiding the .a file altogether.
      
      But that is just an optimization/finer granularity tools/lib/
      cherrypicking that toolers can make use of."
      
      Fixup documentation cleaning target while at it.
      Signed-off-by: 's avatarBorislav Petkov <bp@suse.de>
      Acked-by: 's avatarIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <rric@kernel.org>
      Cc: Stanislav Fomichev <stfomichev@yandex-team.ru>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1386605664-24041-2-git-send-email-bp@alien8.deSigned-off-by: 's avatarArnaldo Carvalho de Melo <acme@redhat.com>
      553873e1