1. 02 9月, 2020 1 次提交
    • Y
      alinux: sched: Add cpu_stress to show system-wide task waiting · ab81d2d9
      Yihao Wu 提交于
      to #28739709
      
      /proc/loadavg can reflex the waiting tasks over a period of time
      to some extent. But to become a SLI requires better precision and
      quicker response. Furthermore, I/O block is not concerned here,
      and bandwidth control is excluded from cpu_stress.
      
      This patch adds a new interface /proc/cpu_stress. It's based on
      task runtime tracking so we don't need to deal with complex state
      transition. And because task runtime tracking is done in most
      scheduler events, the precision is quite enough.
      
      Like loadavg, cpu_stress has 3 average windows too (1,5,15 min)
      Signed-off-by: NYihao Wu <wuyihao@linux.alibaba.com>
      Reviewed-by: NXunlei Pang <xlpang@linux.alibaba.com>
      ab81d2d9
  2. 27 12月, 2019 1 次提交
  3. 16 5月, 2018 1 次提交
  4. 21 4月, 2018 1 次提交
  5. 18 11月, 2017 1 次提交
    • G
      pid: replace pid bitmap implementation with IDR API · 95846ecf
      Gargi Sharma 提交于
      Patch series "Replacing PID bitmap implementation with IDR API", v4.
      
      This series replaces kernel bitmap implementation of PID allocation with
      IDR API.  These patches are written to simplify the kernel by replacing
      custom code with calls to generic code.
      
      The following are the stats for pid and pid_namespace object files
      before and after the replacement.  There is a noteworthy change between
      the IDR and bitmap implementation.
      
      Before
         text       data        bss        dec        hex    filename
         8447       3894         64      12405       3075    kernel/pid.o
      After
         text       data        bss        dec        hex    filename
         3397        304          0       3701        e75    kernel/pid.o
      
      Before
         text       data        bss        dec        hex    filename
         5692       1842        192       7726       1e2e    kernel/pid_namespace.o
      After
         text       data        bss        dec        hex    filename
         2854        216         16       3086        c0e    kernel/pid_namespace.o
      
      The following are the stats for ps, pstree and calling readdir on /proc
      for 10,000 processes.
      
      ps:
              With IDR API    With bitmap
      real    0m1.479s        0m2.319s
      user    0m0.070s        0m0.060s
      sys     0m0.289s        0m0.516s
      
      pstree:
              With IDR API    With bitmap
      real    0m1.024s        0m1.794s
      user    0m0.348s        0m0.612s
      sys     0m0.184s        0m0.264s
      
      proc:
              With IDR API    With bitmap
      real    0m0.059s        0m0.074s
      user    0m0.000s        0m0.004s
      sys     0m0.016s        0m0.016s
      
      This patch (of 2):
      
      Replace the current bitmap implementation for Process ID allocation.
      Functions that are no longer required, for example, free_pidmap(),
      alloc_pidmap(), etc.  are removed.  The rest of the functions are
      modified to use the IDR API.  The change was made to make the PID
      allocation less complex by replacing custom code with calls to generic
      API.
      
      [gs051095@gmail.com: v6]
        Link: http://lkml.kernel.org/r/1507760379-21662-2-git-send-email-gs051095@gmail.com
      [avagin@openvz.org: restore the old behaviour of the ns_last_pid sysctl]
        Link: http://lkml.kernel.org/r/20171106183144.16368-1-avagin@openvz.org
      Link: http://lkml.kernel.org/r/1507583624-22146-2-git-send-email-gs051095@gmail.comSigned-off-by: NGargi Sharma <gs051095@gmail.com>
      Reviewed-by: NRik van Riel <riel@redhat.com>
      Acked-by: NOleg Nesterov <oleg@redhat.com>
      Cc: Julia Lawall <julia.lawall@lip6.fr>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
      Cc: Kirill Tkhai <ktkhai@virtuozzo.com>
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      95846ecf
  6. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      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: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  7. 02 3月, 2017 2 次提交
  8. 24 1月, 2014 1 次提交
    • P
      fs/proc: don't use module_init for non-modular core code · abaf3787
      Paul Gortmaker 提交于
      PROC_FS is a bool, so this code is either present or absent.  It will
      never be modular, so using module_init as an alias for __initcall is
      rather misleading.
      
      Fix this up now, so that we can relocate module_init from init.h into
      module.h in the future.  If we don't do this, we'd have to add module.h to
      obviously non-modular code, and that would be ugly at best.
      
      Note that direct use of __initcall is discouraged, vs.  one of the
      priority categorized subgroups.  As __initcall gets mapped onto
      device_initcall, our use of fs_initcall (which makes sense for fs code)
      will thus change these registrations from level 6-device to level 5-fs
      (i.e.  slightly earlier).  However no observable impact of that small
      difference has been observed during testing, or is expected.
      
      Also note that this change uncovers a missing semicolon bug in the
      registration of vmcore_init as an initcall.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      abaf3787
  9. 15 5月, 2009 1 次提交
  10. 23 10月, 2008 1 次提交