Skip to content
Snippets Groups Projects
  1. Jan 04, 2024
  2. May 29, 2023
  3. May 25, 2023
    • Noah Goldstein's avatar
      x86/csum: Improve performance of `csum_partial` · 688eb819
      Noah Goldstein authored
      1) Add special case for len == 40 as that is the hottest value. The
         nets a ~8-9% latency improvement and a ~30% throughput improvement
         in the len == 40 case.
      
      2) Use multiple accumulators in the 64-byte loop. This dramatically
         improves ILP and results in up to a 40% latency/throughput
         improvement (better for more iterations).
      
      Results from benchmarking on Icelake. Times measured with rdtsc()
       len   lat_new   lat_old      r    tput_new  tput_old      r
         8      3.58      3.47  1.032        3.58      3.51  1.021
        16      4.14      4.02  1.028        3.96      3.78  1.046
        24      4.99      5.03  0.992        4.23      4.03  1.050
        32      5.09      5.08  1.001        4.68      4.47  1.048
        40      5.57      6.08  0.916        3.05      4.43  0.690
        48      6.65      6.63  1.003        4.97      4.69  1.059
        56      7.74      7.72  1.003        5.22      4.95  1.055
        64      6.65      7.22  0.921        6.38      6.42  0.994
        96      9.43      9.96  0.946        7.46      7.54  0.990
       128      9.39     12.15  0.773        8.90      8.79  1.012
       200     12.65     18.08  0.699       11.63     11.60  1.002
       272     15.82     23.37  0.677       14.43     14.35  1.005
       440     24.12     36.43  0.662       21.57     22.69  0.951
       952     46.20     74.01  0.624       42.98     53.12  0.809
      1024     47.12     78.24  0.602       46.36     58.83  0.788
      1552     72.01    117.30  0.614       71.92     96.78  0.743
      2048     93.07    153.25  0.607       93.28    137.20  0.680
      2600    114.73    194.30  0.590      114.28    179.32  0.637
      3608    156.34    268.41  0.582      154.97    254.02  0.610
      4096    175.01    304.03  0.576      175.89    292.08  0.602
      
      There is no such thing as a free lunch, however, and the special case
      for len == 40 does add overhead to the len != 40 cases. This seems to
      amount to be ~5% throughput and slightly less in terms of latency.
      
      Testing:
      Part of this change is a new kunit test. The tests check all
      alignment X length pairs in [0, 64) X [0, 512).
      There are three cases.
          1) Precomputed random inputs/seed. The expected results where
             generated use the generic implementation (which is assumed to be
             non-buggy).
          2) An input of all 1s. The goal of this test is to catch any case
             a carry is missing.
          3) An input that never carries. The goal of this test si to catch
             any case of incorrectly carrying.
      
      More exhaustive tests that test all alignment X length pairs in
      [0, 8192) X [0, 8192] on random data are also available here:
      https://github.com/goldsteinn/csum-reproduction
      
      
      
      The reposity also has the code for reproducing the above benchmark
      numbers.
      
      Signed-off-by: default avatarNoah Goldstein <goldstein.w.n@gmail.com>
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Link: https://lore.kernel.org/all/20230511011002.935690-1-goldstein.w.n%40gmail.com
      688eb819
  4. Jan 31, 2022
  5. Dec 08, 2021
  6. Mar 21, 2019
  7. Nov 02, 2017
    • 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: default avatarKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: default avatarPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  8. Aug 08, 2016
  9. Jul 14, 2016
    • Paul Gortmaker's avatar
      x86/lib: Audit and remove any unnecessary uses of module.h · e683014c
      Paul Gortmaker authored
      
      Historically a lot of these existed because we did not have
      a distinction between what was modular code and what was providing
      support to modules via EXPORT_SYMBOL and friends.  That changed
      when we forked out support for the latter into the export.h file.
      
      This means we should be able to reduce the usage of module.h
      in code that is obj-y Makefile or bool Kconfig.  The advantage
      in doing so is that module.h itself sources about 15 other headers;
      adding significantly to what we feed cpp, and it can obscure what
      headers we are effectively using.
      
      Since module.h was the source for init.h (for __init) and for
      export.h (for EXPORT_SYMBOL) we consider each obj-y/bool instance
      for the presence of either and replace as needed.  Build testing
      revealed a couple implicit header usage issues that were fixed.
      
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20160714001901.31603-5-paul.gortmaker@windriver.com
      
      
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      e683014c
  10. Mar 18, 2011
  11. May 13, 2008
    • Ingo Molnar's avatar
      x86: fix csum_partial() export · 89804c02
      Ingo Molnar authored
      
      Fix this symbol export problem:
      
          Building modules, stage 2.
          MODPOST 193 modules
          ERROR: "csum_partial" [fs/reiserfs/reiserfs.ko] undefined!
          make[1]: *** [__modpost] Error 1
          make: *** [modules] Error 2
      
      This is due to a known weakness of symbol exports: if a symbol's
      only in-core user is an EXPORT_SYMBOL from a lib-y section, the
      symbol is not linked in.
      
      The solution is to move the export to x8664_ksyms_64.c - but the real
      solution would be to fix kbuild.
      
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      89804c02
  12. Oct 11, 2007
  13. Dec 07, 2006
  14. Dec 03, 2006
  15. Jun 26, 2006
  16. Apr 16, 2005
    • Linus Torvalds's avatar
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds authored
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      v2.6.12-rc2
      1da177e4
Loading