Hello,
We were trying to build 4.14 kernel with GCC 8, but perf failed to
compile. The upstream tree seems to have necessary commits to support
GCC 8, but they were not ported to 4.14 branch. With backporting the
following commits we were able to restore perf compilation and compile
a working 4.14 kernel with GCC 8.2:
6810158d526e483868e519befff407b91e76b3db: perf annotate: Use asprintf
when formatting objdump command
b7a313d84e853049062011d78cb04b6decd12f5c: perf tools: Fix python
extension build for gcc 8
77f18153c080855e1c3fb520ca31a4e61530121d: perf tools: Fix snprint
warnings for gcc 8
06c3f2aa9fc68e7f3fe3d83e7569d2a2801d9f99: perf utils: Move
is_directory() to path.h
Propose to apply the above commits to 4.14 to be able to compile it
with GCC 8 (mostly to properly support CONFIG_RETPOLINE)
Commit 6810158d526e483868e519befff407b91e76b3db might need adjustment
to cleanly apply on 4.14 branch.
Regards,
Ignat
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hi Greg,
Pleae pull commits for Linux 3.18 .
I've sent a review request for all commits over a week ago and all
comments were addressed.
Thanks,
Sasha
=====
The following changes since commit 0d63979c1bc9c85578be4c589768a13dc0a7c5eb:
Linux 3.18.124 (2018-10-13 09:09:32 +0200)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git tags/for-greg-3.18-16102018
for you to fetch changes up to 8103cbfd1edd20d4de51defa9d6914e33b043f91:
powerpc/tm: Avoid possible userspace r1 corruption on reclaim (2018-10-15 18:02:23 -0400)
- ----------------------------------------------------------------
for-greg-3.18-16102018
- ----------------------------------------------------------------
James Cowgill (1):
RISC-V: include linux/ftrace.h in asm-prototypes.h
Jozef Balga (1):
media: af9035: prevent buffer overflow on write
Michael Neuling (2):
powerpc/tm: Fix userspace r13 corruption
powerpc/tm: Avoid possible userspace r1 corruption on reclaim
arch/powerpc/kernel/tm.S | 20 +++++++++++++++++---
arch/riscv/include/asm/asm-prototypes.h | 7 +++++++
drivers/media/usb/dvb-usb-v2/af9035.c | 6 ++++--
3 files changed, 28 insertions(+), 5 deletions(-)
create mode 100644 arch/riscv/include/asm/asm-prototypes.h
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEE4n5dijQDou9mhzu83qZv95d3LNwFAlvGFIkACgkQ3qZv95d3
LNz4Kw//VdIsXsVwvtQ3NCLX5PUgxqzP+oJO7JpOP53HpbmkUbpq2tqs4BxIsc5e
4/1HXQjkP4of+y82mLmX6lsH0QMPusrmzWMv5+fcUL3hA2pN9/6a5EVEFdiwCrhy
siVoXIEXCFIzw+bKOziSW3Zeggmju0pCjP7dNn2td3Fj+f/vBF9Yd7WUsKSbrWrY
2/U4HRbySBQEtphElk5HjpEJ4zdy6z2OZs+oPXjEjL0akoDo3JSHmYySrZiUj0Gr
ZcRqm1aPp0+5AgSTrmxpznSoUlj3Aivc9XuqRo2/wxbasaNVmF7CsYoj9ErUB7YR
NKXM7xhgd1zwTr3pW1n/p2Gwf5qTrOt1oOM22hLqOp/KgoUXNGMWrM3nyEAC9cvH
ysaVBcj1wDz6Si4wUMyaMrWqNZl/gBRxYQW9UvS7Zi7i+qdAZ1MpdXR9LIKWv1uN
f490e1HHuid3qWa2QtRR4LGxIves74uHORUs0xnEsXtoqHy51ozTY9y+6NIfikDQ
TDk7+a5JV/9XKRnNTl3flwEmQIkWJ6mpZ1JPM/XeSpmoEFQYAaKJg6DC6V8kgdHM
INYbCY8DOqxhdCTN6+qDEkOVwuClpEpWntQF8rxg/W/NdiiXnzCUlOQBmjok8kXW
ajgcPZ2n9SzjpbqiXvBPNsXGs5Akt9Vyo6Kyosq+YEY/Jn0HQcM=
=j/HW
-----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hi Greg,
Pleae pull commits for Linux 4.4 .
I've sent a review request for all commits over a week ago and all
comments were addressed.
Thanks,
Sasha
=====
The following changes since commit b001adea66f0e0a7803adfbf9128a2d7969daa4e:
Linux 4.4.161 (2018-10-13 09:11:36 +0200)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git tags/for-greg-4.4-16102018
for you to fetch changes up to 0d850290d80e46758e82d87904cec458113f923e:
powerpc/tm: Avoid possible userspace r1 corruption on reclaim (2018-10-15 18:02:16 -0400)
- ----------------------------------------------------------------
for-greg-4.4-16102018
- ----------------------------------------------------------------
Andreas Schwab (1):
Input: atakbd - fix Atari keymap
James Cowgill (1):
RISC-V: include linux/ftrace.h in asm-prototypes.h
Jozef Balga (1):
media: af9035: prevent buffer overflow on write
Keerthy (1):
clocksource/drivers/ti-32k: Add CLOCK_SOURCE_SUSPEND_NONSTOP flag for non-am43 SoCs
Michael Neuling (2):
powerpc/tm: Fix userspace r13 corruption
powerpc/tm: Avoid possible userspace r1 corruption on reclaim
Michael Schmitz (1):
Input: atakbd - fix Atari CapsLock behaviour
Nathan Chancellor (1):
net/mlx4: Use cpumask_available for eq->affinity_mask
arch/powerpc/kernel/tm.S | 20 +++++++--
arch/riscv/include/asm/asm-prototypes.h | 7 ++++
drivers/clocksource/timer-ti-32k.c | 3 ++
drivers/input/keyboard/atakbd.c | 74 +++++++++++++--------------------
drivers/media/usb/dvb-usb-v2/af9035.c | 6 ++-
drivers/net/ethernet/mellanox/mlx4/eq.c | 3 +-
6 files changed, 61 insertions(+), 52 deletions(-)
create mode 100644 arch/riscv/include/asm/asm-prototypes.h
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEE4n5dijQDou9mhzu83qZv95d3LNwFAlvGFIEACgkQ3qZv95d3
LNxv3g//ZDlmu6pfxVo4C+l0pRa+uZvBorGmr+6hHlTYe19kbttuAGykjm+QCCb5
QXvUAft6YJaclXPXWi6NtEEG0TYrEtz7f7GWJyAr9FQ4kHHck2cUZrMq/marpK7i
nkFD8ERCqixSV6VWk3PFQGv1oaEJnEi4ygEQXaSwSgVi47GZUS3MxkzUn1T9JAL0
eDR/DhoMOg9IXD8KVlg6yrkOoiSEbUIaYdXoa2JYGalJbAMvsPB4KqOnVe/Ry+/j
RAGOzAok3Y8yvpmFSiz/gpkjSL3jQpdlsfvZFZcnnTks3Q6MlHuWt+SNRbRgtmdG
VN2ijzyyhdvewj78KIz5V6uewSaw8TauWq6HqLdnTadisA9mvicDuHNkhn8dm54/
irawJcLsVn+KNA6m8fFRgpfRNMP92DvVz25tTbF08QeKGtr/aF/XelPEj2B3YD/R
CFE0f5n/vkv6KSs8GSjqvJD8w4vpP1P8TqJwNAdU7yF+aisNWJqaueKdQ8FA8q54
TDPSFUWqqLuDkDyLwfidMJl0R60PhmkVuAFLBqPkIo7m05AFm3Ab71nq7+U45g3C
ELw1z/hFSlmj8z9l8VwlxqAdTa/ppKVHnK9eYAnCItpO5G26FNcbpeAZF3lT74XK
mzutvuFZznNX6cxxc5fsan5r7c5+oENNMlNlgPplY97mTyUs2/w=
=uvan
-----END PGP SIGNATURE-----
The patch below does not apply to the 4.16-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From d79f7aa496fc94d763f67b833a1f36f4c171176f Mon Sep 17 00:00:00 2001
From: Roman Gushchin <guro(a)fb.com>
Date: Tue, 10 Apr 2018 16:27:47 -0700
Subject: [PATCH] mm: treat indirectly reclaimable memory as free in overcommit
logic
Indirectly reclaimable memory can consume a significant part of total
memory and it's actually reclaimable (it will be released under actual
memory pressure).
So, the overcommit logic should treat it as free.
Otherwise, it's possible to cause random system-wide memory allocation
failures by consuming a significant amount of memory by indirectly
reclaimable memory, e.g. dentry external names.
If overcommit policy GUESS is used, it might be used for denial of
service attack under some conditions.
The following program illustrates the approach. It causes the kernel to
allocate an unreclaimable kmalloc-256 chunk for each stat() call, so
that at some point the overcommit logic may start blocking large
allocation system-wide.
int main()
{
char buf[256];
unsigned long i;
struct stat statbuf;
buf[0] = '/';
for (i = 1; i < sizeof(buf); i++)
buf[i] = '_';
for (i = 0; 1; i++) {
sprintf(&buf[248], "%8lu", i);
stat(buf, &statbuf);
}
return 0;
}
This patch in combination with related indirectly reclaimable memory
patches closes this issue.
Link: http://lkml.kernel.org/r/20180313130041.8078-1-guro@fb.com
Signed-off-by: Roman Gushchin <guro(a)fb.com>
Reviewed-by: Andrew Morton <akpm(a)linux-foundation.org>
Cc: Alexander Viro <viro(a)zeniv.linux.org.uk>
Cc: Michal Hocko <mhocko(a)suse.com>
Cc: Johannes Weiner <hannes(a)cmpxchg.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds(a)linux-foundation.org>
diff --git a/mm/util.c b/mm/util.c
index 029fc2f3b395..73676f0f1b43 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -667,6 +667,13 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin)
*/
free += global_node_page_state(NR_SLAB_RECLAIMABLE);
+ /*
+ * Part of the kernel memory, which can be released
+ * under memory pressure.
+ */
+ free += global_node_page_state(
+ NR_INDIRECTLY_RECLAIMABLE_BYTES) >> PAGE_SHIFT;
+
/*
* Leave reserved pages. The pages are not for anonymous pages.
*/