diff options
author | Martin Borg <martin.borg@enea.com> | 2018-05-09 15:29:03 +0200 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2018-05-14 09:39:34 +0200 |
commit | b1abf1299c2f635db21370f989ac9dc2ecbe4189 (patch) | |
tree | fb00d3239d07fdbe6de827149560ecc0f0ecd964 /patches/boot_time_opt_guest/0102-sysrq-skip-synchronize_rcu-if-there-is-no-old-op.patch | |
parent | 5ee606c13d87fb454c6755b8bf55fa984428d87f (diff) | |
download | enea-kernel-cache-b1abf1299c2f635db21370f989ac9dc2ecbe4189.tar.gz |
boot_time_opt_guest: update guest boot time optimization patches for 4.14
The new patches are based on:
https://github.com/clearlinux-pkgs/linux-kvm
commit 5a0a30430116735fecb22b269e4ca10a08147d8d
Signed-off-by: Martin Borg <martin.borg@enea.com>
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'patches/boot_time_opt_guest/0102-sysrq-skip-synchronize_rcu-if-there-is-no-old-op.patch')
-rw-r--r-- | patches/boot_time_opt_guest/0102-sysrq-skip-synchronize_rcu-if-there-is-no-old-op.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/patches/boot_time_opt_guest/0102-sysrq-skip-synchronize_rcu-if-there-is-no-old-op.patch b/patches/boot_time_opt_guest/0102-sysrq-skip-synchronize_rcu-if-there-is-no-old-op.patch new file mode 100644 index 0000000..9cc08f3 --- /dev/null +++ b/patches/boot_time_opt_guest/0102-sysrq-skip-synchronize_rcu-if-there-is-no-old-op.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From 092250008c4240d58086102bd63baf56ad400feb Mon Sep 17 00:00:00 2001 | ||
2 | From: Arjan van de Ven <arjan@linux.intel.com> | ||
3 | Date: Wed, 11 Feb 2015 16:25:16 -0600 | ||
4 | Subject: [PATCH 102/114] sysrq: skip synchronize_rcu() if there is no old op | ||
5 | |||
6 | synchronize_rcu() is expensive. Currently it is called as part of the sysrq | ||
7 | registration/unregistration, which happens during boot several times. | ||
8 | Now, the reason for the synchronize_rcu() is to allow an old registered | ||
9 | operation to expire properly... which is pointless if the old operation | ||
10 | is NULL... | ||
11 | So we can save the common case of the old operation being NULL a lot of time | ||
12 | by just checking for non-NULL prior to the synchronize_rcu() | ||
13 | |||
14 | Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> | ||
15 | Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> | ||
16 | --- | ||
17 | drivers/tty/sysrq.c | 4 +++- | ||
18 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
19 | |||
20 | diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c | ||
21 | index 3ffc1ce29023..5a1d87b99e62 100644 | ||
22 | --- a/drivers/tty/sysrq.c | ||
23 | +++ b/drivers/tty/sysrq.c | ||
24 | @@ -1067,8 +1067,10 @@ static int __sysrq_swap_key_ops(int key, struct sysrq_key_op *insert_op_p, | ||
25 | * A concurrent __handle_sysrq either got the old op or the new op. | ||
26 | * Wait for it to go away before returning, so the code for an old | ||
27 | * op is not freed (eg. on module unload) while it is in use. | ||
28 | + * This is only relevant if the old op is not NULL of course. | ||
29 | */ | ||
30 | - synchronize_rcu(); | ||
31 | + if (remove_op_p) | ||
32 | + synchronize_rcu(); | ||
33 | |||
34 | return retval; | ||
35 | } | ||
36 | -- | ||
37 | 2.13.2 | ||
38 | |||