summaryrefslogtreecommitdiff
path: root/lib/zstd/common/compiler.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-11-18 17:09:05 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2021-11-18 17:09:05 -0800
commit4c388a8e740d3235a194f330c8ef327deef710f6 (patch)
treef49faba91437acab03c9f6190b8f1c228448a8dd /lib/zstd/common/compiler.h
parente26dd976580a6a427c69e6116508dd3d412742e5 (diff)
parent7416cdc9b9c10968c57b1f73be5d48b3ecdaf3c8 (diff)
Merge tag 'zstd-for-linus-5.16-rc1' of git://github.com/terrelln/linux
Pull zstd fixes from Nick Terrell: "Fix stack usage on parisc & improve code size bloat This contains three commits: 1. Fixes a minor unused variable warning reported by Kernel test robot [0]. 2. Improves the reported code bloat (-88KB / 374KB) [1] by outlining some functions that are unlikely to be used in performance sensitive workloads. 3. Fixes the reported excess stack usage on parisc [2] by removing -O3 from zstd's compilation flags. -O3 triggered bugs in the hppa-linux-gnu gcc-8 compiler. -O2 performance is acceptable: neutral compression, about -1% decompression speed. We also reduce code bloat (-105KB / 374KB). After this our code bloat is cut from 374KB to 105KB with gcc-11. If we wanted to cut the remaining 105KB we'd likely have to trade signicant performance, so I want to say that this is enough for now. We should be able to get further gains without sacrificing speed, but that will take some significant optimization effort, and isn't suitable for a quick fix. I've opened an upstream issue [3] to track the code size, and try to avoid future regressions, and improve it in the long term" Link: https://lore.kernel.org/linux-mm/202111120312.833wII4i-lkp@intel.com/T/ [0] Link: https://lkml.org/lkml/2021/11/15/710 [1] Link: https://lkml.org/lkml/2021/11/14/189 [2] Link: https://github.com/facebook/zstd/issues/2867 [3] Link: https://lore.kernel.org/r/20211117014949.1169186-1-nickrterrell@gmail.com/ Link: https://lore.kernel.org/r/20211117201459.1194876-1-nickrterrell@gmail.com/ * tag 'zstd-for-linus-5.16-rc1' of git://github.com/terrelln/linux: lib: zstd: Don't add -O3 to cflags lib: zstd: Don't inline functions in zstd_opt.c lib: zstd: Fix unused variable warning
Diffstat (limited to 'lib/zstd/common/compiler.h')
-rw-r--r--lib/zstd/common/compiler.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/zstd/common/compiler.h b/lib/zstd/common/compiler.h
index a1a051e4bce6..f5a9c70a228a 100644
--- a/lib/zstd/common/compiler.h
+++ b/lib/zstd/common/compiler.h
@@ -16,6 +16,7 @@
*********************************************************/
/* force inlining */
+#if !defined(ZSTD_NO_INLINE)
#if (defined(__GNUC__) && !defined(__STRICT_ANSI__)) || defined(__cplusplus) || defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */
# define INLINE_KEYWORD inline
#else
@@ -24,6 +25,12 @@
#define FORCE_INLINE_ATTR __attribute__((always_inline))
+#else
+
+#define INLINE_KEYWORD
+#define FORCE_INLINE_ATTR
+
+#endif
/*
On MSVC qsort requires that functions passed into it use the __cdecl calling conversion(CC).