mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-11-03 10:09:30 +00:00
kernel: Update kernel to 4.4.45/4.9.17/4.10.5
In 4.10.5 and 4.9.17 include a fix for the VMBus memory leak, cherry-picked from char-misc: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git/commit/?h=char-misc-linus&id=5e030d5ce9d99a899b648413139ff65bab12b038 This patch was tested with the 4.10.5 kernel and the Hyper-V Socket stress test. It was forwarded to stable@vger to be included in one of the next stable releases. Also remove the CPU ACCT revert as 17.03.1-rc1 is out and has a fix Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From 41cf7c7ea77a3c51b023aefa912f96654c293bfd Mon Sep 17 00:00:00 2001
|
||||
From 6ebb6fc113b41112479233a32ba7845bf0765fef Mon Sep 17 00:00:00 2001
|
||||
From: Dexuan Cui <decui@microsoft.com>
|
||||
Date: Sat, 23 Jul 2016 01:35:51 +0000
|
||||
Subject: [PATCH 1/8] hv_sock: introduce Hyper-V Sockets
|
||||
@@ -56,10 +56,10 @@ index 63cefa62324c..e64920219d88 100644
|
||||
F: Documentation/ABI/stable/sysfs-bus-vmbus
|
||||
|
||||
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
|
||||
index 192eef2fd766..4148c98dba24 100644
|
||||
index d596a076da11..489ad74c1e6e 100644
|
||||
--- a/include/linux/hyperv.h
|
||||
+++ b/include/linux/hyperv.h
|
||||
@@ -1623,5 +1623,18 @@ static inline void commit_rd_index(struct vmbus_channel *channel)
|
||||
@@ -1613,5 +1613,18 @@ static inline void commit_rd_index(struct vmbus_channel *channel)
|
||||
hv_signal_on_read(channel);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 4d10e16196f7c219540a96a486447c7c8eee0d3c Mon Sep 17 00:00:00 2001
|
||||
From 81ffd549906270aec7cf38aa098f8f0296c4fe92 Mon Sep 17 00:00:00 2001
|
||||
From: Rolf Neugebauer <rolf.neugebauer@gmail.com>
|
||||
Date: Mon, 23 May 2016 18:55:45 +0100
|
||||
Subject: [PATCH 2/8] vmbus: Don't spam the logs with unknown GUIDs
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From e6fc7be9a7d041de632c5306d4872e27b26bd74f Mon Sep 17 00:00:00 2001
|
||||
From f9946a9224a088c80e6340696b0f9cdc4da5847c Mon Sep 17 00:00:00 2001
|
||||
From: Alex Ng <alexng@messages.microsoft.com>
|
||||
Date: Sun, 6 Nov 2016 13:14:07 -0800
|
||||
Subject: [PATCH 3/8] Drivers: hv: utils: Fix the mapping between host version
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 286360c75fcfdfdaa9da2016d61ac41f23a39546 Mon Sep 17 00:00:00 2001
|
||||
From 5a3d8779d9a335409e9343b6255f0ec76eed11cd Mon Sep 17 00:00:00 2001
|
||||
From: Alex Ng <alexng@messages.microsoft.com>
|
||||
Date: Sun, 6 Nov 2016 13:14:10 -0800
|
||||
Subject: [PATCH 4/8] Drivers: hv: vss: Improve log messages.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 6ddf71aef1f50115da8f54e296e6cfdd84e998a3 Mon Sep 17 00:00:00 2001
|
||||
From 0b2d379f07a067e1ce673658273cbd61cf2fea20 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Ng <alexng@messages.microsoft.com>
|
||||
Date: Sun, 6 Nov 2016 13:14:11 -0800
|
||||
Subject: [PATCH 5/8] Drivers: hv: vss: Operation timeouts should match host
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From ca8e4da18726bb6263ff4ed22e2f8d106ae0f29e Mon Sep 17 00:00:00 2001
|
||||
From 526abebd5a31f44b7819f2e9fc92073297b8b59c Mon Sep 17 00:00:00 2001
|
||||
From: Alex Ng <alexng@messages.microsoft.com>
|
||||
Date: Sat, 28 Jan 2017 12:37:17 -0700
|
||||
Subject: [PATCH 6/8] Drivers: hv: vmbus: Use all supported IC versions to
|
||||
@@ -469,7 +469,7 @@ index e7707747f56d..f3797c07be10 100644
|
||||
srv->util_cb, dev->channel);
|
||||
if (ret)
|
||||
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
|
||||
index 4148c98dba24..514cdf390370 100644
|
||||
index 489ad74c1e6e..956acfc93487 100644
|
||||
--- a/include/linux/hyperv.h
|
||||
+++ b/include/linux/hyperv.h
|
||||
@@ -1453,9 +1453,10 @@ struct hyperv_service_callback {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 918e18d6946733e1391fc5cec714d51febe59e8e Mon Sep 17 00:00:00 2001
|
||||
From f124575a9f1bfe890a2307211afc433ec9d6bd38 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Ng <alexng@messages.microsoft.com>
|
||||
Date: Sat, 28 Jan 2017 12:37:18 -0700
|
||||
Subject: [PATCH 7/8] Drivers: hv: Log the negotiated IC versions.
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
From ba6078e0069da20c0aebcab38a6d76e371d61da6 Mon Sep 17 00:00:00 2001
|
||||
From: "K. Y. Srinivasan" <kys@microsoft.com>
|
||||
Date: Sun, 12 Mar 2017 20:00:30 -0700
|
||||
Subject: [PATCH 8/8] Drivers: hv: vmbus: Don't leak memory when a channel is
|
||||
rescinded
|
||||
|
||||
When we close a channel that has been rescinded, we will leak memory since
|
||||
vmbus_teardown_gpadl() returns an error. Fix this so that we can properly
|
||||
cleanup the memory allocated to the ring buffers.
|
||||
|
||||
Fixes: ccb61f8a99e6 ("Drivers: hv: vmbus: Fix a rescind handling bug")
|
||||
|
||||
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
(cherry picked from commit 5e030d5ce9d99a899b648413139ff65bab12b038)
|
||||
---
|
||||
drivers/hv/channel.c | 13 ++++++++-----
|
||||
1 file changed, 8 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
|
||||
index be34547cdb68..1606e7f08f4b 100644
|
||||
--- a/drivers/hv/channel.c
|
||||
+++ b/drivers/hv/channel.c
|
||||
@@ -506,12 +506,15 @@ int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle)
|
||||
|
||||
wait_for_completion(&info->waitevent);
|
||||
|
||||
- if (channel->rescind) {
|
||||
- ret = -ENODEV;
|
||||
- goto post_msg_err;
|
||||
- }
|
||||
-
|
||||
post_msg_err:
|
||||
+ /*
|
||||
+ * If the channel has been rescinded;
|
||||
+ * we will be awakened by the rescind
|
||||
+ * handler; set the error code to zero so we don't leak memory.
|
||||
+ */
|
||||
+ if (channel->rescind)
|
||||
+ ret = 0;
|
||||
+
|
||||
spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
|
||||
list_del(&info->msglistentry);
|
||||
spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
From 52b289d7080701cd0d67e8070888c0f8e0649c92 Mon Sep 17 00:00:00 2001
|
||||
From: Ian Campbell <ian.campbell@docker.com>
|
||||
Date: Fri, 17 Feb 2017 11:45:31 +0000
|
||||
Subject: [PATCH 8/8] Revert "sched/cpuacct: Show all possible CPUs in cpuacct
|
||||
output"
|
||||
|
||||
This reverts commit 5ca3726af7f66a8cc71ce4414cfeb86deb784491.
|
||||
|
||||
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
|
||||
---
|
||||
kernel/sched/cpuacct.c | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c
|
||||
index bc0b309c3f19..64d2115f3564 100644
|
||||
--- a/kernel/sched/cpuacct.c
|
||||
+++ b/kernel/sched/cpuacct.c
|
||||
@@ -169,7 +169,7 @@ static u64 __cpuusage_read(struct cgroup_subsys_state *css,
|
||||
u64 totalcpuusage = 0;
|
||||
int i;
|
||||
|
||||
- for_each_possible_cpu(i)
|
||||
+ for_each_present_cpu(i)
|
||||
totalcpuusage += cpuacct_cpuusage_read(ca, i, index);
|
||||
|
||||
return totalcpuusage;
|
||||
@@ -204,7 +204,7 @@ static int cpuusage_write(struct cgroup_subsys_state *css, struct cftype *cft,
|
||||
if (val)
|
||||
return -EINVAL;
|
||||
|
||||
- for_each_possible_cpu(cpu)
|
||||
+ for_each_present_cpu(cpu)
|
||||
cpuacct_cpuusage_write(ca, cpu, 0);
|
||||
|
||||
return 0;
|
||||
@@ -217,7 +217,7 @@ static int __cpuacct_percpu_seq_show(struct seq_file *m,
|
||||
u64 percpu;
|
||||
int i;
|
||||
|
||||
- for_each_possible_cpu(i) {
|
||||
+ for_each_present_cpu(i) {
|
||||
percpu = cpuacct_cpuusage_read(ca, i, index);
|
||||
seq_printf(m, "%llu ", (unsigned long long) percpu);
|
||||
}
|
||||
@@ -251,7 +251,7 @@ static int cpuacct_all_seq_show(struct seq_file *m, void *V)
|
||||
seq_printf(m, " %s", cpuacct_stat_desc[index]);
|
||||
seq_puts(m, "\n");
|
||||
|
||||
- for_each_possible_cpu(cpu) {
|
||||
+ for_each_online_cpu(cpu) {
|
||||
struct cpuacct_usage *cpuusage = per_cpu_ptr(ca->cpuusage, cpu);
|
||||
|
||||
seq_printf(m, "%d", cpu);
|
||||
@@ -284,7 +284,7 @@ static int cpuacct_stats_show(struct seq_file *sf, void *v)
|
||||
int stat;
|
||||
|
||||
memset(val, 0, sizeof(val));
|
||||
- for_each_possible_cpu(cpu) {
|
||||
+ for_each_online_cpu(cpu) {
|
||||
u64 *cpustat = per_cpu_ptr(ca->cpustat, cpu)->cpustat;
|
||||
|
||||
val[CPUACCT_STAT_USER] += cpustat[CPUTIME_USER];
|
||||
--
|
||||
2.11.0
|
||||
|
||||
Reference in New Issue
Block a user