diff options
author | Ingo Molnar <mingo@kernel.org> | 2017-11-07 04:32:44 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-11-07 04:32:44 -0500 |
commit | 8c5db92a705d9e2c986adec475980d1120fa07b4 (patch) | |
tree | 9f0eea56889819707c0a1a8eb5b1fb2db3cdaf3d /kernel | |
parent | ca5d376e17072c1b60c3fee66f3be58ef018952d (diff) | |
parent | e4880bc5dfb1f02b152e62a894b5c6f3e995b3cf (diff) |
Merge branch 'linus' into locking/core, to resolve conflicts
Conflicts:
include/linux/compiler-clang.h
include/linux/compiler-gcc.h
include/linux/compiler-intel.h
include/uapi/linux/stddef.h
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
139 files changed, 219 insertions, 42 deletions
diff --git a/kernel/Makefile b/kernel/Makefile index ed470aac53da..172d151d429c 100644 --- a/kernel/Makefile +++ b/kernel/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
1 | # | 2 | # |
2 | # Makefile for the linux kernel. | 3 | # Makefile for the linux kernel. |
3 | # | 4 | # |
diff --git a/kernel/acct.c b/kernel/acct.c index 21eedd0dd81a..d15c0ee4d955 100644 --- a/kernel/acct.c +++ b/kernel/acct.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * linux/kernel/acct.c | 3 | * linux/kernel/acct.c |
3 | * | 4 | * |
diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c index 011d46e5f73f..d4b050d9a66e 100644 --- a/kernel/audit_tree.c +++ b/kernel/audit_tree.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "audit.h" | 2 | #include "audit.h" |
2 | #include <linux/fsnotify_backend.h> | 3 | #include <linux/fsnotify_backend.h> |
3 | #include <linux/namei.h> | 4 | #include <linux/namei.h> |
diff --git a/kernel/bounds.c b/kernel/bounds.c index e1d1d1952bfa..c373e887c066 100644 --- a/kernel/bounds.c +++ b/kernel/bounds.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Generate definitions needed by the preprocessor. | 3 | * Generate definitions needed by the preprocessor. |
3 | * This code generates raw asm output which is post-processed | 4 | * This code generates raw asm output which is post-processed |
diff --git a/kernel/bpf/Makefile b/kernel/bpf/Makefile index 897daa005b23..af3ab6164ff5 100644 --- a/kernel/bpf/Makefile +++ b/kernel/bpf/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
1 | obj-y := core.o | 2 | obj-y := core.o |
2 | 3 | ||
3 | obj-$(CONFIG_BPF_SYSCALL) += syscall.o verifier.o inode.o helpers.o tnum.o | 4 | obj-$(CONFIG_BPF_SYSCALL) += syscall.o verifier.o inode.o helpers.o tnum.o |
diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c index 2b6eb35ae5d3..dbd7b322a86b 100644 --- a/kernel/bpf/sockmap.c +++ b/kernel/bpf/sockmap.c | |||
@@ -93,13 +93,27 @@ static inline struct smap_psock *smap_psock_sk(const struct sock *sk) | |||
93 | return rcu_dereference_sk_user_data(sk); | 93 | return rcu_dereference_sk_user_data(sk); |
94 | } | 94 | } |
95 | 95 | ||
96 | /* compute the linear packet data range [data, data_end) for skb when | ||
97 | * sk_skb type programs are in use. | ||
98 | */ | ||
99 | static inline void bpf_compute_data_end_sk_skb(struct sk_buff *skb) | ||
100 | { | ||
101 | TCP_SKB_CB(skb)->bpf.data_end = skb->data + skb_headlen(skb); | ||
102 | } | ||
103 | |||
104 | enum __sk_action { | ||
105 | __SK_DROP = 0, | ||
106 | __SK_PASS, | ||
107 | __SK_REDIRECT, | ||
108 | }; | ||
109 | |||
96 | static int smap_verdict_func(struct smap_psock *psock, struct sk_buff *skb) | 110 | static int smap_verdict_func(struct smap_psock *psock, struct sk_buff *skb) |
97 | { | 111 | { |
98 | struct bpf_prog *prog = READ_ONCE(psock->bpf_verdict); | 112 | struct bpf_prog *prog = READ_ONCE(psock->bpf_verdict); |
99 | int rc; | 113 | int rc; |
100 | 114 | ||
101 | if (unlikely(!prog)) | 115 | if (unlikely(!prog)) |
102 | return SK_DROP; | 116 | return __SK_DROP; |
103 | 117 | ||
104 | skb_orphan(skb); | 118 | skb_orphan(skb); |
105 | /* We need to ensure that BPF metadata for maps is also cleared | 119 | /* We need to ensure that BPF metadata for maps is also cleared |
@@ -108,13 +122,16 @@ static int smap_verdict_func(struct smap_psock *psock, struct sk_buff *skb) | |||
108 | */ | 122 | */ |
109 | TCP_SKB_CB(skb)->bpf.map = NULL; | 123 | TCP_SKB_CB(skb)->bpf.map = NULL; |
110 | skb->sk = psock->sock; | 124 | skb->sk = psock->sock; |
111 | bpf_compute_data_end(skb); | 125 | bpf_compute_data_end_sk_skb(skb); |
112 | preempt_disable(); | 126 | preempt_disable(); |
113 | rc = (*prog->bpf_func)(skb, prog->insnsi); | 127 | rc = (*prog->bpf_func)(skb, prog->insnsi); |
114 | preempt_enable(); | 128 | preempt_enable(); |
115 | skb->sk = NULL; | 129 | skb->sk = NULL; |
116 | 130 | ||
117 | return rc; | 131 | /* Moving return codes from UAPI namespace into internal namespace */ |
132 | return rc == SK_PASS ? | ||
133 | (TCP_SKB_CB(skb)->bpf.map ? __SK_REDIRECT : __SK_PASS) : | ||
134 | __SK_DROP; | ||
118 | } | 135 | } |
119 | 136 | ||
120 | static void smap_do_verdict(struct smap_psock *psock, struct sk_buff *skb) | 137 | static void smap_do_verdict(struct smap_psock *psock, struct sk_buff *skb) |
@@ -124,7 +141,7 @@ static void smap_do_verdict(struct smap_psock *psock, struct sk_buff *skb) | |||
124 | 141 | ||
125 | rc = smap_verdict_func(psock, skb); | 142 | rc = smap_verdict_func(psock, skb); |
126 | switch (rc) { | 143 | switch (rc) { |
127 | case SK_REDIRECT: | 144 | case __SK_REDIRECT: |
128 | sk = do_sk_redirect_map(skb); | 145 | sk = do_sk_redirect_map(skb); |
129 | if (likely(sk)) { | 146 | if (likely(sk)) { |
130 | struct smap_psock *peer = smap_psock_sk(sk); | 147 | struct smap_psock *peer = smap_psock_sk(sk); |
@@ -140,7 +157,7 @@ static void smap_do_verdict(struct smap_psock *psock, struct sk_buff *skb) | |||
140 | } | 157 | } |
141 | } | 158 | } |
142 | /* Fall through and free skb otherwise */ | 159 | /* Fall through and free skb otherwise */ |
143 | case SK_DROP: | 160 | case __SK_DROP: |
144 | default: | 161 | default: |
145 | kfree_skb(skb); | 162 | kfree_skb(skb); |
146 | } | 163 | } |
@@ -368,7 +385,7 @@ static int smap_parse_func_strparser(struct strparser *strp, | |||
368 | * any socket yet. | 385 | * any socket yet. |
369 | */ | 386 | */ |
370 | skb->sk = psock->sock; | 387 | skb->sk = psock->sock; |
371 | bpf_compute_data_end(skb); | 388 | bpf_compute_data_end_sk_skb(skb); |
372 | rc = (*prog->bpf_func)(skb, prog->insnsi); | 389 | rc = (*prog->bpf_func)(skb, prog->insnsi); |
373 | skb->sk = NULL; | 390 | skb->sk = NULL; |
374 | rcu_read_unlock(); | 391 | rcu_read_unlock(); |
diff --git a/kernel/capability.c b/kernel/capability.c index f97fe77ceb88..1e1c0236f55b 100644 --- a/kernel/capability.c +++ b/kernel/capability.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * linux/kernel/capability.c | 3 | * linux/kernel/capability.c |
3 | * | 4 | * |
diff --git a/kernel/cgroup/Makefile b/kernel/cgroup/Makefile index ce693ccb8c58..ae448f7632cc 100644 --- a/kernel/cgroup/Makefile +++ b/kernel/cgroup/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
1 | obj-y := cgroup.o namespace.o cgroup-v1.o | 2 | obj-y := cgroup.o namespace.o cgroup-v1.o |
2 | 3 | ||
3 | obj-$(CONFIG_CGROUP_FREEZER) += freezer.o | 4 | obj-$(CONFIG_CGROUP_FREEZER) += freezer.o |
diff --git a/kernel/cgroup/cgroup-internal.h b/kernel/cgroup/cgroup-internal.h index 5151ff256c29..bf54ade001be 100644 --- a/kernel/cgroup/cgroup-internal.h +++ b/kernel/cgroup/cgroup-internal.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __CGROUP_INTERNAL_H | 2 | #ifndef __CGROUP_INTERNAL_H |
2 | #define __CGROUP_INTERNAL_H | 3 | #define __CGROUP_INTERNAL_H |
3 | 4 | ||
diff --git a/kernel/cgroup/debug.c b/kernel/cgroup/debug.c index f661b4cc5efd..5f780d8f6a9d 100644 --- a/kernel/cgroup/debug.c +++ b/kernel/cgroup/debug.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Debug controller | 3 | * Debug controller |
3 | * | 4 | * |
diff --git a/kernel/cgroup/namespace.c b/kernel/cgroup/namespace.c index 66129eb4371d..b05f1dd58a62 100644 --- a/kernel/cgroup/namespace.c +++ b/kernel/cgroup/namespace.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "cgroup-internal.h" | 2 | #include "cgroup-internal.h" |
2 | 3 | ||
3 | #include <linux/sched/task.h> | 4 | #include <linux/sched/task.h> |
diff --git a/kernel/dma.c b/kernel/dma.c index 6c6262f86c17..3506fc34a712 100644 --- a/kernel/dma.c +++ b/kernel/dma.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * linux/kernel/dma.c: A DMA channel allocator. Inspired by linux/kernel/irq.c. | 3 | * linux/kernel/dma.c: A DMA channel allocator. Inspired by linux/kernel/irq.c. |
3 | * | 4 | * |
diff --git a/kernel/elfcore.c b/kernel/elfcore.c index e556751d15d9..fc482c8e0bd8 100644 --- a/kernel/elfcore.c +++ b/kernel/elfcore.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/elf.h> | 2 | #include <linux/elf.h> |
2 | #include <linux/fs.h> | 3 | #include <linux/fs.h> |
3 | #include <linux/mm.h> | 4 | #include <linux/mm.h> |
diff --git a/kernel/events/Makefile b/kernel/events/Makefile index 2925188f50ea..3c022e33c109 100644 --- a/kernel/events/Makefile +++ b/kernel/events/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
1 | ifdef CONFIG_FUNCTION_TRACER | 2 | ifdef CONFIG_FUNCTION_TRACER |
2 | CFLAGS_REMOVE_core.o = $(CC_FLAGS_FTRACE) | 3 | CFLAGS_REMOVE_core.o = $(CC_FLAGS_FTRACE) |
3 | endif | 4 | endif |
diff --git a/kernel/events/core.c b/kernel/events/core.c index 8fd2f2d1358a..b315aebbcc3f 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -901,9 +901,11 @@ list_update_cgroup_event(struct perf_event *event, | |||
901 | cpuctx_entry = &cpuctx->cgrp_cpuctx_entry; | 901 | cpuctx_entry = &cpuctx->cgrp_cpuctx_entry; |
902 | /* cpuctx->cgrp is NULL unless a cgroup event is active in this CPU .*/ | 902 | /* cpuctx->cgrp is NULL unless a cgroup event is active in this CPU .*/ |
903 | if (add) { | 903 | if (add) { |
904 | struct perf_cgroup *cgrp = perf_cgroup_from_task(current, ctx); | ||
905 | |||
904 | list_add(cpuctx_entry, this_cpu_ptr(&cgrp_cpuctx_list)); | 906 | list_add(cpuctx_entry, this_cpu_ptr(&cgrp_cpuctx_list)); |
905 | if (perf_cgroup_from_task(current, ctx) == event->cgrp) | 907 | if (cgroup_is_descendant(cgrp->css.cgroup, event->cgrp->css.cgroup)) |
906 | cpuctx->cgrp = event->cgrp; | 908 | cpuctx->cgrp = cgrp; |
907 | } else { | 909 | } else { |
908 | list_del(cpuctx_entry); | 910 | list_del(cpuctx_entry); |
909 | cpuctx->cgrp = NULL; | 911 | cpuctx->cgrp = NULL; |
diff --git a/kernel/events/internal.h b/kernel/events/internal.h index 843e97047335..09b1537ae06c 100644 --- a/kernel/events/internal.h +++ b/kernel/events/internal.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _KERNEL_EVENTS_INTERNAL_H | 2 | #ifndef _KERNEL_EVENTS_INTERNAL_H |
2 | #define _KERNEL_EVENTS_INTERNAL_H | 3 | #define _KERNEL_EVENTS_INTERNAL_H |
3 | 4 | ||
diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c index 6873bb3e6b7e..0975b0268545 100644 --- a/kernel/exec_domain.c +++ b/kernel/exec_domain.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Handling of different ABIs (personalities). | 3 | * Handling of different ABIs (personalities). |
3 | * | 4 | * |
diff --git a/kernel/futex.c b/kernel/futex.c index 0518a0bfc746..76ed5921117a 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -903,11 +903,27 @@ void exit_pi_state_list(struct task_struct *curr) | |||
903 | */ | 903 | */ |
904 | raw_spin_lock_irq(&curr->pi_lock); | 904 | raw_spin_lock_irq(&curr->pi_lock); |
905 | while (!list_empty(head)) { | 905 | while (!list_empty(head)) { |
906 | |||
907 | next = head->next; | 906 | next = head->next; |
908 | pi_state = list_entry(next, struct futex_pi_state, list); | 907 | pi_state = list_entry(next, struct futex_pi_state, list); |
909 | key = pi_state->key; | 908 | key = pi_state->key; |
910 | hb = hash_futex(&key); | 909 | hb = hash_futex(&key); |
910 | |||
911 | /* | ||
912 | * We can race against put_pi_state() removing itself from the | ||
913 | * list (a waiter going away). put_pi_state() will first | ||
914 | * decrement the reference count and then modify the list, so | ||
915 | * its possible to see the list entry but fail this reference | ||
916 | * acquire. | ||
917 | * | ||
918 | * In that case; drop the locks to let put_pi_state() make | ||
919 | * progress and retry the loop. | ||
920 | */ | ||
921 | if (!atomic_inc_not_zero(&pi_state->refcount)) { | ||
922 | raw_spin_unlock_irq(&curr->pi_lock); | ||
923 | cpu_relax(); | ||
924 | raw_spin_lock_irq(&curr->pi_lock); | ||
925 | continue; | ||
926 | } | ||
911 | raw_spin_unlock_irq(&curr->pi_lock); | 927 | raw_spin_unlock_irq(&curr->pi_lock); |
912 | 928 | ||
913 | spin_lock(&hb->lock); | 929 | spin_lock(&hb->lock); |
@@ -918,8 +934,10 @@ void exit_pi_state_list(struct task_struct *curr) | |||
918 | * task still owns the PI-state: | 934 | * task still owns the PI-state: |
919 | */ | 935 | */ |
920 | if (head->next != next) { | 936 | if (head->next != next) { |
937 | /* retain curr->pi_lock for the loop invariant */ | ||
921 | raw_spin_unlock(&pi_state->pi_mutex.wait_lock); | 938 | raw_spin_unlock(&pi_state->pi_mutex.wait_lock); |
922 | spin_unlock(&hb->lock); | 939 | spin_unlock(&hb->lock); |
940 | put_pi_state(pi_state); | ||
923 | continue; | 941 | continue; |
924 | } | 942 | } |
925 | 943 | ||
@@ -927,9 +945,8 @@ void exit_pi_state_list(struct task_struct *curr) | |||
927 | WARN_ON(list_empty(&pi_state->list)); | 945 | WARN_ON(list_empty(&pi_state->list)); |
928 | list_del_init(&pi_state->list); | 946 | list_del_init(&pi_state->list); |
929 | pi_state->owner = NULL; | 947 | pi_state->owner = NULL; |
930 | raw_spin_unlock(&curr->pi_lock); | ||
931 | 948 | ||
932 | get_pi_state(pi_state); | 949 | raw_spin_unlock(&curr->pi_lock); |
933 | raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock); | 950 | raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock); |
934 | spin_unlock(&hb->lock); | 951 | spin_unlock(&hb->lock); |
935 | 952 | ||
@@ -1570,8 +1587,16 @@ static int futex_atomic_op_inuser(unsigned int encoded_op, u32 __user *uaddr) | |||
1570 | int oldval, ret; | 1587 | int oldval, ret; |
1571 | 1588 | ||
1572 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) { | 1589 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) { |
1573 | if (oparg < 0 || oparg > 31) | 1590 | if (oparg < 0 || oparg > 31) { |
1574 | return -EINVAL; | 1591 | char comm[sizeof(current->comm)]; |
1592 | /* | ||
1593 | * kill this print and return -EINVAL when userspace | ||
1594 | * is sane again | ||
1595 | */ | ||
1596 | pr_info_ratelimited("futex_wake_op: %s tries to shift op by %d; fix this program\n", | ||
1597 | get_task_comm(comm, current), oparg); | ||
1598 | oparg &= 31; | ||
1599 | } | ||
1575 | oparg = 1 << oparg; | 1600 | oparg = 1 << oparg; |
1576 | } | 1601 | } |
1577 | 1602 | ||
diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c index 3f409968e466..83f830acbb5f 100644 --- a/kernel/futex_compat.c +++ b/kernel/futex_compat.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * linux/kernel/futex_compat.c | 3 | * linux/kernel/futex_compat.c |
3 | * | 4 | * |
diff --git a/kernel/gcov/Makefile b/kernel/gcov/Makefile index 752d6486b67e..c6c50e5c680e 100644 --- a/kernel/gcov/Makefile +++ b/kernel/gcov/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
1 | ccflags-y := -DSRCTREE='"$(srctree)"' -DOBJTREE='"$(objtree)"' | 2 | ccflags-y := -DSRCTREE='"$(srctree)"' -DOBJTREE='"$(objtree)"' |
2 | 3 | ||
3 | obj-y := base.o fs.o | 4 | obj-y := base.o fs.o |
diff --git a/kernel/gcov/base.c b/kernel/gcov/base.c index c51a49c9be70..9c7c8d5c18f2 100644 --- a/kernel/gcov/base.c +++ b/kernel/gcov/base.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * This code maintains a list of active profiling data structures. | 3 | * This code maintains a list of active profiling data structures. |
3 | * | 4 | * |
diff --git a/kernel/gcov/fs.c b/kernel/gcov/fs.c index edf67c493a8e..6e40ff6be083 100644 --- a/kernel/gcov/fs.c +++ b/kernel/gcov/fs.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * This code exports profiling data as debugfs files to userspace. | 3 | * This code exports profiling data as debugfs files to userspace. |
3 | * | 4 | * |
diff --git a/kernel/gcov/gcc_3_4.c b/kernel/gcov/gcc_3_4.c index 27bc88a35013..1e32e66c9563 100644 --- a/kernel/gcov/gcc_3_4.c +++ b/kernel/gcov/gcc_3_4.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * This code provides functions to handle gcc's profiling data format | 3 | * This code provides functions to handle gcc's profiling data format |
3 | * introduced with gcc 3.4. Future versions of gcc may change the gcov | 4 | * introduced with gcc 3.4. Future versions of gcc may change the gcov |
diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c index 46a18e72bce6..ca5e5c0ef853 100644 --- a/kernel/gcov/gcc_4_7.c +++ b/kernel/gcov/gcc_4_7.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * This code provides functions to handle gcc's profiling data format | 3 | * This code provides functions to handle gcc's profiling data format |
3 | * introduced with gcc 4.7. | 4 | * introduced with gcc 4.7. |
diff --git a/kernel/gcov/gcov.h b/kernel/gcov/gcov.h index 92c8e22a29ed..de118ad4a024 100644 --- a/kernel/gcov/gcov.h +++ b/kernel/gcov/gcov.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * Profiling infrastructure declarations. | 3 | * Profiling infrastructure declarations. |
3 | * | 4 | * |
diff --git a/kernel/groups.c b/kernel/groups.c index 434f6665f187..e357bc800111 100644 --- a/kernel/groups.c +++ b/kernel/groups.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Supplementary group IDs | 3 | * Supplementary group IDs |
3 | */ | 4 | */ |
diff --git a/kernel/irq/Makefile b/kernel/irq/Makefile index 1970cafe8f2a..ed15d142694b 100644 --- a/kernel/irq/Makefile +++ b/kernel/irq/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
1 | 2 | ||
2 | obj-y := irqdesc.o handle.o manage.o spurious.o resend.o chip.o dummychip.o devres.o | 3 | obj-y := irqdesc.o handle.o manage.o spurious.o resend.o chip.o dummychip.o devres.o |
3 | obj-$(CONFIG_IRQ_TIMINGS) += timings.o | 4 | obj-$(CONFIG_IRQ_TIMINGS) += timings.o |
diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index d69bd77252a7..e12d35108225 100644 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Copyright (C) 2016 Thomas Gleixner. | 3 | * Copyright (C) 2016 Thomas Gleixner. |
3 | * Copyright (C) 2016-2017 Christoph Hellwig. | 4 | * Copyright (C) 2016-2017 Christoph Hellwig. |
diff --git a/kernel/irq/autoprobe.c b/kernel/irq/autoprobe.c index d30a0dd5cc02..befa671fba64 100644 --- a/kernel/irq/autoprobe.c +++ b/kernel/irq/autoprobe.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * linux/kernel/irq/autoprobe.c | 3 | * linux/kernel/irq/autoprobe.c |
3 | * | 4 | * |
diff --git a/kernel/irq/debug.h b/kernel/irq/debug.h index e75e29e4434a..17f05ef8f575 100644 --- a/kernel/irq/debug.h +++ b/kernel/irq/debug.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * Debugging printout: | 3 | * Debugging printout: |
3 | */ | 4 | */ |
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h index a4aa39009f0d..44ed5f8c8759 100644 --- a/kernel/irq/internals.h +++ b/kernel/irq/internals.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * IRQ subsystem internal functions and variables: | 3 | * IRQ subsystem internal functions and variables: |
3 | * | 4 | * |
diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c index 6ca054a3f91d..86ae0eb80b53 100644 --- a/kernel/irq/migration.c +++ b/kernel/irq/migration.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | 2 | ||
2 | #include <linux/irq.h> | 3 | #include <linux/irq.h> |
3 | #include <linux/interrupt.h> | 4 | #include <linux/interrupt.h> |
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index 6376b4a598d3..c010cc0daf79 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * linux/kernel/irq/proc.c | 3 | * linux/kernel/irq/proc.c |
3 | * | 4 | * |
diff --git a/kernel/irq/resend.c b/kernel/irq/resend.c index b86886beee4f..1d08f45135c2 100644 --- a/kernel/irq/resend.c +++ b/kernel/irq/resend.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * linux/kernel/irq/resend.c | 3 | * linux/kernel/irq/resend.c |
3 | * | 4 | * |
diff --git a/kernel/irq/settings.h b/kernel/irq/settings.h index 320579d89091..e43795cd2ccf 100644 --- a/kernel/irq/settings.h +++ b/kernel/irq/settings.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * Internal header to deal with irq_desc->status which will be renamed | 3 | * Internal header to deal with irq_desc->status which will be renamed |
3 | * to irq_desc->settings. | 4 | * to irq_desc->settings. |
diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c index 061ba7eed4ed..987d7bca4864 100644 --- a/kernel/irq/spurious.c +++ b/kernel/irq/spurious.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * linux/kernel/irq/spurious.c | 3 | * linux/kernel/irq/spurious.c |
3 | * | 4 | * |
diff --git a/kernel/kcmp.c b/kernel/kcmp.c index 055bb2962a0b..a0e3d7a0e8b8 100644 --- a/kernel/kcmp.c +++ b/kernel/kcmp.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/kernel.h> | 2 | #include <linux/kernel.h> |
2 | #include <linux/syscalls.h> | 3 | #include <linux/syscalls.h> |
3 | #include <linux/fdtable.h> | 4 | #include <linux/fdtable.h> |
diff --git a/kernel/kcov.c b/kernel/kcov.c index 3f693a0f6f3e..fc6af9e1308b 100644 --- a/kernel/kcov.c +++ b/kernel/kcov.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #define pr_fmt(fmt) "kcov: " fmt | 2 | #define pr_fmt(fmt) "kcov: " fmt |
2 | 3 | ||
3 | #define DISABLE_BRANCH_PROFILING | 4 | #define DISABLE_BRANCH_PROFILING |
diff --git a/kernel/kexec_internal.h b/kernel/kexec_internal.h index 50dfcb039a41..48aaf2ac0d0d 100644 --- a/kernel/kexec_internal.h +++ b/kernel/kexec_internal.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef LINUX_KEXEC_INTERNAL_H | 2 | #ifndef LINUX_KEXEC_INTERNAL_H |
2 | #define LINUX_KEXEC_INTERNAL_H | 3 | #define LINUX_KEXEC_INTERNAL_H |
3 | 4 | ||
diff --git a/kernel/livepatch/core.h b/kernel/livepatch/core.h index c74f24c47837..a351601d7f76 100644 --- a/kernel/livepatch/core.h +++ b/kernel/livepatch/core.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _LIVEPATCH_CORE_H | 2 | #ifndef _LIVEPATCH_CORE_H |
2 | #define _LIVEPATCH_CORE_H | 3 | #define _LIVEPATCH_CORE_H |
3 | 4 | ||
diff --git a/kernel/livepatch/patch.h b/kernel/livepatch/patch.h index 0db227170c36..e72d8250d04b 100644 --- a/kernel/livepatch/patch.h +++ b/kernel/livepatch/patch.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _LIVEPATCH_PATCH_H | 2 | #ifndef _LIVEPATCH_PATCH_H |
2 | #define _LIVEPATCH_PATCH_H | 3 | #define _LIVEPATCH_PATCH_H |
3 | 4 | ||
diff --git a/kernel/livepatch/transition.h b/kernel/livepatch/transition.h index ce09b326546c..0f6e27c481f9 100644 --- a/kernel/livepatch/transition.h +++ b/kernel/livepatch/transition.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _LIVEPATCH_TRANSITION_H | 2 | #ifndef _LIVEPATCH_TRANSITION_H |
2 | #define _LIVEPATCH_TRANSITION_H | 3 | #define _LIVEPATCH_TRANSITION_H |
3 | 4 | ||
diff --git a/kernel/locking/Makefile b/kernel/locking/Makefile index 760158d9d98d..392c7f23af76 100644 --- a/kernel/locking/Makefile +++ b/kernel/locking/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
1 | # Any varying coverage in these files is non-deterministic | 2 | # Any varying coverage in these files is non-deterministic |
2 | # and is generally not a function of system call inputs. | 3 | # and is generally not a function of system call inputs. |
3 | KCOV_INSTRUMENT := n | 4 | KCOV_INSTRUMENT := n |
diff --git a/kernel/locking/lockdep_internals.h b/kernel/locking/lockdep_internals.h index 1da4669d57a7..d459d624ba2a 100644 --- a/kernel/locking/lockdep_internals.h +++ b/kernel/locking/lockdep_internals.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * kernel/lockdep_internals.h | 3 | * kernel/lockdep_internals.h |
3 | * | 4 | * |
diff --git a/kernel/locking/lockdep_proc.c b/kernel/locking/lockdep_proc.c index 68d9e267ccd4..ad69bbc9bd28 100644 --- a/kernel/locking/lockdep_proc.c +++ b/kernel/locking/lockdep_proc.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * kernel/lockdep_proc.c | 3 | * kernel/lockdep_proc.c |
3 | * | 4 | * |
diff --git a/kernel/locking/mcs_spinlock.h b/kernel/locking/mcs_spinlock.h index 6a385aabcce7..f046b7ce9dd6 100644 --- a/kernel/locking/mcs_spinlock.h +++ b/kernel/locking/mcs_spinlock.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * MCS lock defines | 3 | * MCS lock defines |
3 | * | 4 | * |
diff --git a/kernel/locking/mutex-debug.h b/kernel/locking/mutex-debug.h index 4174417d5309..1edd3f45a4ec 100644 --- a/kernel/locking/mutex-debug.h +++ b/kernel/locking/mutex-debug.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * Mutexes: blocking mutual exclusion locks | 3 | * Mutexes: blocking mutual exclusion locks |
3 | * | 4 | * |
diff --git a/kernel/locking/mutex.h b/kernel/locking/mutex.h index 6ebc1902f779..1c2287d3fa71 100644 --- a/kernel/locking/mutex.h +++ b/kernel/locking/mutex.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * Mutexes: blocking mutual exclusion locks | 3 | * Mutexes: blocking mutual exclusion locks |
3 | * | 4 | * |
diff --git a/kernel/locking/osq_lock.c b/kernel/locking/osq_lock.c index a74ee6abd039..6ef600aa0f47 100644 --- a/kernel/locking/osq_lock.c +++ b/kernel/locking/osq_lock.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/percpu.h> | 2 | #include <linux/percpu.h> |
2 | #include <linux/sched.h> | 3 | #include <linux/sched.h> |
3 | #include <linux/osq_lock.h> | 4 | #include <linux/osq_lock.h> |
diff --git a/kernel/locking/qspinlock_paravirt.h b/kernel/locking/qspinlock_paravirt.h index 43555681c40b..15b6a39366c6 100644 --- a/kernel/locking/qspinlock_paravirt.h +++ b/kernel/locking/qspinlock_paravirt.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _GEN_PV_LOCK_SLOWPATH | 2 | #ifndef _GEN_PV_LOCK_SLOWPATH |
2 | #error "do not include this file" | 3 | #error "do not include this file" |
3 | #endif | 4 | #endif |
diff --git a/kernel/locking/rtmutex-debug.c b/kernel/locking/rtmutex-debug.c index f4a74e78d467..fd4fe1f5b458 100644 --- a/kernel/locking/rtmutex-debug.c +++ b/kernel/locking/rtmutex-debug.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * RT-Mutexes: blocking mutual exclusion locks with PI support | 3 | * RT-Mutexes: blocking mutual exclusion locks with PI support |
3 | * | 4 | * |
diff --git a/kernel/locking/rtmutex-debug.h b/kernel/locking/rtmutex-debug.h index 5078c6ddf4a5..fc549713bba3 100644 --- a/kernel/locking/rtmutex-debug.h +++ b/kernel/locking/rtmutex-debug.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * RT-Mutexes: blocking mutual exclusion locks with PI support | 3 | * RT-Mutexes: blocking mutual exclusion locks with PI support |
3 | * | 4 | * |
diff --git a/kernel/locking/rtmutex.h b/kernel/locking/rtmutex.h index 5c253caffe91..732f96abf462 100644 --- a/kernel/locking/rtmutex.h +++ b/kernel/locking/rtmutex.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * RT-Mutexes: blocking mutual exclusion locks with PI support | 3 | * RT-Mutexes: blocking mutual exclusion locks with PI support |
3 | * | 4 | * |
diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h index 7453be0485a5..124e98ca0b17 100644 --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * RT Mutexes: blocking mutual exclusion locks with PI support | 3 | * RT Mutexes: blocking mutual exclusion locks with PI support |
3 | * | 4 | * |
diff --git a/kernel/locking/rwsem-spinlock.c b/kernel/locking/rwsem-spinlock.c index 0848634c5512..a7ffb2a96ede 100644 --- a/kernel/locking/rwsem-spinlock.c +++ b/kernel/locking/rwsem-spinlock.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* rwsem-spinlock.c: R/W semaphores: contention handling functions for | 2 | /* rwsem-spinlock.c: R/W semaphores: contention handling functions for |
2 | * generic spinlock implementation | 3 | * generic spinlock implementation |
3 | * | 4 | * |
diff --git a/kernel/locking/rwsem-xadd.c b/kernel/locking/rwsem-xadd.c index 1fefe6dcafd7..e795908f3607 100644 --- a/kernel/locking/rwsem-xadd.c +++ b/kernel/locking/rwsem-xadd.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* rwsem.c: R/W semaphores: contention handling functions | 2 | /* rwsem.c: R/W semaphores: contention handling functions |
2 | * | 3 | * |
3 | * Written by David Howells (dhowells@redhat.com). | 4 | * Written by David Howells (dhowells@redhat.com). |
diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c index e53f7746d9fd..f549c552dbf1 100644 --- a/kernel/locking/rwsem.c +++ b/kernel/locking/rwsem.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* kernel/rwsem.c: R/W semaphores, public implementation | 2 | /* kernel/rwsem.c: R/W semaphores, public implementation |
2 | * | 3 | * |
3 | * Written by David Howells (dhowells@redhat.com). | 4 | * Written by David Howells (dhowells@redhat.com). |
diff --git a/kernel/locking/rwsem.h b/kernel/locking/rwsem.h index a699f4048ba1..a883b8f1fdc6 100644 --- a/kernel/locking/rwsem.h +++ b/kernel/locking/rwsem.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * The owner field of the rw_semaphore structure will be set to | 3 | * The owner field of the rw_semaphore structure will be set to |
3 | * RWSEM_READ_OWNED when a reader grabs the lock. A writer will clear | 4 | * RWSEM_READ_OWNED when a reader grabs the lock. A writer will clear |
diff --git a/kernel/locking/spinlock.c b/kernel/locking/spinlock.c index 8fd48b5552a7..b96343374a87 100644 --- a/kernel/locking/spinlock.c +++ b/kernel/locking/spinlock.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Copyright (2004) Linus Torvalds | 3 | * Copyright (2004) Linus Torvalds |
3 | * | 4 | * |
diff --git a/kernel/power/Makefile b/kernel/power/Makefile index eb4f717705ba..a3f79f0eef36 100644 --- a/kernel/power/Makefile +++ b/kernel/power/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
1 | 2 | ||
2 | ccflags-$(CONFIG_PM_DEBUG) := -DDEBUG | 3 | ccflags-$(CONFIG_PM_DEBUG) := -DDEBUG |
3 | 4 | ||
diff --git a/kernel/power/autosleep.c b/kernel/power/autosleep.c index 9012ecf7b814..41e83a779e19 100644 --- a/kernel/power/autosleep.c +++ b/kernel/power/autosleep.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * kernel/power/autosleep.c | 3 | * kernel/power/autosleep.c |
3 | * | 4 | * |
diff --git a/kernel/power/console.c b/kernel/power/console.c index 0e781798b0b3..fcdf0e14a47d 100644 --- a/kernel/power/console.c +++ b/kernel/power/console.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Functions for saving/restoring console. | 3 | * Functions for saving/restoring console. |
3 | * | 4 | * |
diff --git a/kernel/power/power.h b/kernel/power/power.h index 1d2d761e3c25..f29cd178df90 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #include <linux/suspend.h> | 2 | #include <linux/suspend.h> |
2 | #include <linux/suspend_ioctls.h> | 3 | #include <linux/suspend_ioctls.h> |
3 | #include <linux/utsname.h> | 4 | #include <linux/utsname.h> |
diff --git a/kernel/power/process.c b/kernel/power/process.c index 50f25cb370c6..7381d49a44db 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * drivers/power/process.c - Functions for starting/stopping processes on | 3 | * drivers/power/process.c - Functions for starting/stopping processes on |
3 | * suspend transitions. | 4 | * suspend transitions. |
diff --git a/kernel/power/wakelock.c b/kernel/power/wakelock.c index 1896386e16bb..dfba59be190b 100644 --- a/kernel/power/wakelock.c +++ b/kernel/power/wakelock.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * kernel/power/wakelock.c | 3 | * kernel/power/wakelock.c |
3 | * | 4 | * |
diff --git a/kernel/printk/braille.c b/kernel/printk/braille.c index 61d41ca41844..1d21ebacfdb8 100644 --- a/kernel/printk/braille.c +++ b/kernel/printk/braille.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 2 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
2 | 3 | ||
3 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
diff --git a/kernel/printk/braille.h b/kernel/printk/braille.h index 749a6756843a..123154f86304 100644 --- a/kernel/printk/braille.h +++ b/kernel/printk/braille.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PRINTK_BRAILLE_H | 2 | #ifndef _PRINTK_BRAILLE_H |
2 | #define _PRINTK_BRAILLE_H | 3 | #define _PRINTK_BRAILLE_H |
3 | 4 | ||
diff --git a/kernel/printk/console_cmdline.h b/kernel/printk/console_cmdline.h index 2ca4a8b5fe57..11f19c466af5 100644 --- a/kernel/printk/console_cmdline.h +++ b/kernel/printk/console_cmdline.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _CONSOLE_CMDLINE_H | 2 | #ifndef _CONSOLE_CMDLINE_H |
2 | #define _CONSOLE_CMDLINE_H | 3 | #define _CONSOLE_CMDLINE_H |
3 | 4 | ||
diff --git a/kernel/range.c b/kernel/range.c index 82cfc285b046..d84de6766472 100644 --- a/kernel/range.c +++ b/kernel/range.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Range add and subtract | 3 | * Range add and subtract |
3 | */ | 4 | */ |
diff --git a/kernel/rcu/Makefile b/kernel/rcu/Makefile index 13c0fc852767..020e8b6a644b 100644 --- a/kernel/rcu/Makefile +++ b/kernel/rcu/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
1 | # Any varying coverage in these files is non-deterministic | 2 | # Any varying coverage in these files is non-deterministic |
2 | # and is generally not a function of system call inputs. | 3 | # and is generally not a function of system call inputs. |
3 | KCOV_INSTRUMENT := n | 4 | KCOV_INSTRUMENT := n |
diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile index 78f54932ea1d..a9ee16bbc693 100644 --- a/kernel/sched/Makefile +++ b/kernel/sched/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
1 | ifdef CONFIG_FUNCTION_TRACER | 2 | ifdef CONFIG_FUNCTION_TRACER |
2 | CFLAGS_REMOVE_clock.o = $(CC_FLAGS_FTRACE) | 3 | CFLAGS_REMOVE_clock.o = $(CC_FLAGS_FTRACE) |
3 | endif | 4 | endif |
diff --git a/kernel/sched/autogroup.c b/kernel/sched/autogroup.c index de6d7f4dfcb5..a43df5193538 100644 --- a/kernel/sched/autogroup.c +++ b/kernel/sched/autogroup.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "sched.h" | 2 | #include "sched.h" |
2 | 3 | ||
3 | #include <linux/proc_fs.h> | 4 | #include <linux/proc_fs.h> |
diff --git a/kernel/sched/autogroup.h b/kernel/sched/autogroup.h index ce40c810cd5c..27cd22b89824 100644 --- a/kernel/sched/autogroup.h +++ b/kernel/sched/autogroup.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifdef CONFIG_SCHED_AUTOGROUP | 2 | #ifdef CONFIG_SCHED_AUTOGROUP |
2 | 3 | ||
3 | #include <linux/kref.h> | 4 | #include <linux/kref.h> |
diff --git a/kernel/sched/completion.c b/kernel/sched/completion.c index cc873075c3bd..2ddaec40956f 100644 --- a/kernel/sched/completion.c +++ b/kernel/sched/completion.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Generic wait-for-completion handler; | 3 | * Generic wait-for-completion handler; |
3 | * | 4 | * |
diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c index f95ab29a45d0..44ab32a4fab6 100644 --- a/kernel/sched/cpuacct.c +++ b/kernel/sched/cpuacct.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/cgroup.h> | 2 | #include <linux/cgroup.h> |
2 | #include <linux/slab.h> | 3 | #include <linux/slab.h> |
3 | #include <linux/percpu.h> | 4 | #include <linux/percpu.h> |
diff --git a/kernel/sched/cpuacct.h b/kernel/sched/cpuacct.h index ba72807c73d4..a8358a57a316 100644 --- a/kernel/sched/cpuacct.h +++ b/kernel/sched/cpuacct.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifdef CONFIG_CGROUP_CPUACCT | 2 | #ifdef CONFIG_CGROUP_CPUACCT |
2 | 3 | ||
3 | extern void cpuacct_charge(struct task_struct *tsk, u64 cputime); | 4 | extern void cpuacct_charge(struct task_struct *tsk, u64 cputime); |
diff --git a/kernel/sched/cpudeadline.h b/kernel/sched/cpudeadline.h index f7da8c55bba0..b010d26e108e 100644 --- a/kernel/sched/cpudeadline.h +++ b/kernel/sched/cpudeadline.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _LINUX_CPUDL_H | 2 | #ifndef _LINUX_CPUDL_H |
2 | #define _LINUX_CPUDL_H | 3 | #define _LINUX_CPUDL_H |
3 | 4 | ||
diff --git a/kernel/sched/cpupri.h b/kernel/sched/cpupri.h index 63cbb9ca0496..bab050019071 100644 --- a/kernel/sched/cpupri.h +++ b/kernel/sched/cpupri.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _LINUX_CPUPRI_H | 2 | #ifndef _LINUX_CPUPRI_H |
2 | #define _LINUX_CPUPRI_H | 3 | #define _LINUX_CPUPRI_H |
3 | 4 | ||
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index 0191ec7667c3..4ae5c1ea90e2 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Deadline Scheduling Class (SCHED_DEADLINE) | 3 | * Deadline Scheduling Class (SCHED_DEADLINE) |
3 | * | 4 | * |
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index d3f3094856fe..5c09ddf8c832 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Completely Fair Scheduling (CFS) Class (SCHED_NORMAL/SCHED_BATCH) | 3 | * Completely Fair Scheduling (CFS) Class (SCHED_NORMAL/SCHED_BATCH) |
3 | * | 4 | * |
diff --git a/kernel/sched/features.h b/kernel/sched/features.h index 319ed0e8a347..9552fd5854bf 100644 --- a/kernel/sched/features.h +++ b/kernel/sched/features.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * Only give sleepers 50% of their service deficit. This allows | 3 | * Only give sleepers 50% of their service deficit. This allows |
3 | * them to run sooner, but does not allow tons of sleepers to | 4 | * them to run sooner, but does not allow tons of sleepers to |
diff --git a/kernel/sched/idle_task.c b/kernel/sched/idle_task.c index 0c00172db63e..d518664cce4f 100644 --- a/kernel/sched/idle_task.c +++ b/kernel/sched/idle_task.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "sched.h" | 2 | #include "sched.h" |
2 | 3 | ||
3 | /* | 4 | /* |
diff --git a/kernel/sched/loadavg.c b/kernel/sched/loadavg.c index f14716a3522f..89a989e4d758 100644 --- a/kernel/sched/loadavg.c +++ b/kernel/sched/loadavg.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * kernel/sched/loadavg.c | 3 | * kernel/sched/loadavg.c |
3 | * | 4 | * |
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 0af5ca9e3e3f..3c96c80e0992 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Real-Time Scheduling Class (mapped to the SCHED_FIFO and SCHED_RR | 3 | * Real-Time Scheduling Class (mapped to the SCHED_FIFO and SCHED_RR |
3 | * policies) | 4 | * policies) |
diff --git a/kernel/sched/sched-pelt.h b/kernel/sched/sched-pelt.h index cd200d16529e..a26473674fb7 100644 --- a/kernel/sched/sched-pelt.h +++ b/kernel/sched/sched-pelt.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* Generated by Documentation/scheduler/sched-pelt; do not modify. */ | 2 | /* Generated by Documentation/scheduler/sched-pelt; do not modify. */ |
2 | 3 | ||
3 | static const u32 runnable_avg_yN_inv[] = { | 4 | static const u32 runnable_avg_yN_inv[] = { |
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 14db76cd496f..3b448ba82225 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | 2 | ||
2 | #include <linux/sched.h> | 3 | #include <linux/sched.h> |
3 | #include <linux/sched/autogroup.h> | 4 | #include <linux/sched/autogroup.h> |
diff --git a/kernel/sched/stats.c b/kernel/sched/stats.c index 87e2c9f0c33e..940b1fa1d2ce 100644 --- a/kernel/sched/stats.c +++ b/kernel/sched/stats.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | 2 | ||
2 | #include <linux/slab.h> | 3 | #include <linux/slab.h> |
3 | #include <linux/fs.h> | 4 | #include <linux/fs.h> |
diff --git a/kernel/sched/stats.h b/kernel/sched/stats.h index d5710651043b..baf500d12b7c 100644 --- a/kernel/sched/stats.h +++ b/kernel/sched/stats.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | 2 | ||
2 | #ifdef CONFIG_SCHEDSTATS | 3 | #ifdef CONFIG_SCHEDSTATS |
3 | 4 | ||
diff --git a/kernel/sched/stop_task.c b/kernel/sched/stop_task.c index 9f69fb630853..45caf90b24cd 100644 --- a/kernel/sched/stop_task.c +++ b/kernel/sched/stop_task.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "sched.h" | 2 | #include "sched.h" |
2 | 3 | ||
3 | /* | 4 | /* |
diff --git a/kernel/sched/swait.c b/kernel/sched/swait.c index 2227e183e202..9ff1555341ed 100644 --- a/kernel/sched/swait.c +++ b/kernel/sched/swait.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/sched/signal.h> | 2 | #include <linux/sched/signal.h> |
2 | #include <linux/swait.h> | 3 | #include <linux/swait.h> |
3 | 4 | ||
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index f1cf4f306a82..6798276d29af 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Scheduler topology setup/handling methods | 3 | * Scheduler topology setup/handling methods |
3 | */ | 4 | */ |
diff --git a/kernel/seccomp.c b/kernel/seccomp.c index 8ac79355915b..5f0dfb2abb8d 100644 --- a/kernel/seccomp.c +++ b/kernel/seccomp.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * linux/kernel/seccomp.c | 3 | * linux/kernel/seccomp.c |
3 | * | 4 | * |
diff --git a/kernel/signal.c b/kernel/signal.c index 800a18f77732..8dcd8825b2de 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -2698,7 +2698,7 @@ enum siginfo_layout siginfo_layout(int sig, int si_code) | |||
2698 | [SIGSEGV] = { NSIGSEGV, SIL_FAULT }, | 2698 | [SIGSEGV] = { NSIGSEGV, SIL_FAULT }, |
2699 | [SIGBUS] = { NSIGBUS, SIL_FAULT }, | 2699 | [SIGBUS] = { NSIGBUS, SIL_FAULT }, |
2700 | [SIGTRAP] = { NSIGTRAP, SIL_FAULT }, | 2700 | [SIGTRAP] = { NSIGTRAP, SIL_FAULT }, |
2701 | #if defined(SIGMET) && defined(NSIGEMT) | 2701 | #if defined(SIGEMT) && defined(NSIGEMT) |
2702 | [SIGEMT] = { NSIGEMT, SIL_FAULT }, | 2702 | [SIGEMT] = { NSIGEMT, SIL_FAULT }, |
2703 | #endif | 2703 | #endif |
2704 | [SIGCHLD] = { NSIGCHLD, SIL_CHLD }, | 2704 | [SIGCHLD] = { NSIGCHLD, SIL_CHLD }, |
diff --git a/kernel/smpboot.h b/kernel/smpboot.h index 485b81cfab34..34dd3d7ba40b 100644 --- a/kernel/smpboot.h +++ b/kernel/smpboot.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef SMPBOOT_H | 2 | #ifndef SMPBOOT_H |
2 | #define SMPBOOT_H | 3 | #define SMPBOOT_H |
3 | 4 | ||
diff --git a/kernel/sys.c b/kernel/sys.c index 9aebc2935013..524a4cb9bbe2 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * linux/kernel/sys.c | 3 | * linux/kernel/sys.c |
3 | * | 4 | * |
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c index 8acef8576ce9..b5189762d275 100644 --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | 2 | ||
2 | #include <linux/linkage.h> | 3 | #include <linux/linkage.h> |
3 | #include <linux/errno.h> | 4 | #include <linux/errno.h> |
diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c index 58ea8c03662e..e8c0dab4fd65 100644 --- a/kernel/sysctl_binary.c +++ b/kernel/sysctl_binary.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/stat.h> | 2 | #include <linux/stat.h> |
2 | #include <linux/sysctl.h> | 3 | #include <linux/sysctl.h> |
3 | #include "../fs/xfs/xfs_sysctl.h" | 4 | #include "../fs/xfs/xfs_sysctl.h" |
diff --git a/kernel/task_work.c b/kernel/task_work.c index 9a9f262fc53d..0fef395662a6 100644 --- a/kernel/task_work.c +++ b/kernel/task_work.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/spinlock.h> | 2 | #include <linux/spinlock.h> |
2 | #include <linux/task_work.h> | 3 | #include <linux/task_work.h> |
3 | #include <linux/tracehook.h> | 4 | #include <linux/tracehook.h> |
diff --git a/kernel/time/Makefile b/kernel/time/Makefile index 938dbf33ef49..f1e46f338a9c 100644 --- a/kernel/time/Makefile +++ b/kernel/time/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
1 | obj-y += time.o timer.o hrtimer.o | 2 | obj-y += time.o timer.o hrtimer.o |
2 | obj-y += timekeeping.o ntp.o clocksource.o jiffies.o timer_list.o | 3 | obj-y += timekeeping.o ntp.o clocksource.o jiffies.o timer_list.o |
3 | obj-y += timeconv.o timecounter.o alarmtimer.o | 4 | obj-y += timeconv.o timecounter.o alarmtimer.o |
diff --git a/kernel/time/itimer.c b/kernel/time/itimer.c index 2ef98a02376a..f26acef5d7b4 100644 --- a/kernel/time/itimer.c +++ b/kernel/time/itimer.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * linux/kernel/itimer.c | 3 | * linux/kernel/itimer.c |
3 | * | 4 | * |
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index edf19cc53140..99e03bec68e4 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * NTP state machine interfaces and logic. | 3 | * NTP state machine interfaces and logic. |
3 | * | 4 | * |
diff --git a/kernel/time/ntp_internal.h b/kernel/time/ntp_internal.h index d8a7c11fa71a..0a53e6ea47b1 100644 --- a/kernel/time/ntp_internal.h +++ b/kernel/time/ntp_internal.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _LINUX_NTP_INTERNAL_H | 2 | #ifndef _LINUX_NTP_INTERNAL_H |
2 | #define _LINUX_NTP_INTERNAL_H | 3 | #define _LINUX_NTP_INTERNAL_H |
3 | 4 | ||
diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c index 8585ad6e472a..5b117110b55b 100644 --- a/kernel/time/posix-cpu-timers.c +++ b/kernel/time/posix-cpu-timers.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Implement CPU time clocks for the POSIX clock interface. | 3 | * Implement CPU time clocks for the POSIX clock interface. |
3 | */ | 4 | */ |
diff --git a/kernel/time/posix-timers.h b/kernel/time/posix-timers.h index fb303c3be4d3..151e28f5bf30 100644 --- a/kernel/time/posix-timers.h +++ b/kernel/time/posix-timers.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #define TIMER_RETRY 1 | 2 | #define TIMER_RETRY 1 |
2 | 3 | ||
3 | struct k_clock { | 4 | struct k_clock { |
diff --git a/kernel/time/tick-broadcast-hrtimer.c b/kernel/time/tick-broadcast-hrtimer.c index a7bb8f33ae07..58045eb976c3 100644 --- a/kernel/time/tick-broadcast-hrtimer.c +++ b/kernel/time/tick-broadcast-hrtimer.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * linux/kernel/time/tick-broadcast-hrtimer.c | 3 | * linux/kernel/time/tick-broadcast-hrtimer.c |
3 | * This file emulates a local clock event device | 4 | * This file emulates a local clock event device |
diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h index be0ac01f2e12..f8e1845aa464 100644 --- a/kernel/time/tick-internal.h +++ b/kernel/time/tick-internal.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * tick internal variable and functions used by low/high res code | 3 | * tick internal variable and functions used by low/high res code |
3 | */ | 4 | */ |
diff --git a/kernel/time/tick-sched.h b/kernel/time/tick-sched.h index 075444e3d48e..954b43dbf21c 100644 --- a/kernel/time/tick-sched.h +++ b/kernel/time/tick-sched.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _TICK_SCHED_H | 2 | #ifndef _TICK_SCHED_H |
2 | #define _TICK_SCHED_H | 3 | #define _TICK_SCHED_H |
3 | 4 | ||
diff --git a/kernel/time/timekeeping.h b/kernel/time/timekeeping.h index d0914676d4c5..c9f9af339914 100644 --- a/kernel/time/timekeeping.h +++ b/kernel/time/timekeeping.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _KERNEL_TIME_TIMEKEEPING_H | 2 | #ifndef _KERNEL_TIME_TIMEKEEPING_H |
2 | #define _KERNEL_TIME_TIMEKEEPING_H | 3 | #define _KERNEL_TIME_TIMEKEEPING_H |
3 | /* | 4 | /* |
diff --git a/kernel/time/timekeeping_internal.h b/kernel/time/timekeeping_internal.h index 9a18f121f399..fdbeeb02dde9 100644 --- a/kernel/time/timekeeping_internal.h +++ b/kernel/time/timekeeping_internal.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _TIMEKEEPING_INTERNAL_H | 2 | #ifndef _TIMEKEEPING_INTERNAL_H |
2 | #define _TIMEKEEPING_INTERNAL_H | 3 | #define _TIMEKEEPING_INTERNAL_H |
3 | /* | 4 | /* |
diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile index 90f2701d92a7..19a15b2f1190 100644 --- a/kernel/trace/Makefile +++ b/kernel/trace/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
1 | 2 | ||
2 | # Do not instrument the tracer itself: | 3 | # Do not instrument the tracer itself: |
3 | 4 | ||
diff --git a/kernel/trace/power-traces.c b/kernel/trace/power-traces.c index 0c7dee221dca..21bb161c2316 100644 --- a/kernel/trace/power-traces.c +++ b/kernel/trace/power-traces.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Power trace points | 3 | * Power trace points |
3 | * | 4 | * |
diff --git a/kernel/trace/rpm-traces.c b/kernel/trace/rpm-traces.c index 4b3b5eaf94d1..25dec0b00280 100644 --- a/kernel/trace/rpm-traces.c +++ b/kernel/trace/rpm-traces.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Power trace points | 3 | * Power trace points |
3 | * | 4 | * |
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 9050c8b3ccde..6b0b343a36a2 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | 2 | ||
2 | #ifndef _LINUX_KERNEL_TRACE_H | 3 | #ifndef _LINUX_KERNEL_TRACE_H |
3 | #define _LINUX_KERNEL_TRACE_H | 4 | #define _LINUX_KERNEL_TRACE_H |
diff --git a/kernel/trace/trace_benchmark.c b/kernel/trace/trace_benchmark.c index 16a8cf02eee9..79f838a75077 100644 --- a/kernel/trace/trace_benchmark.c +++ b/kernel/trace/trace_benchmark.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/delay.h> | 2 | #include <linux/delay.h> |
2 | #include <linux/module.h> | 3 | #include <linux/module.h> |
3 | #include <linux/kthread.h> | 4 | #include <linux/kthread.h> |
diff --git a/kernel/trace/trace_benchmark.h b/kernel/trace/trace_benchmark.h index ebdbfc2f2a64..be1d86ff753d 100644 --- a/kernel/trace/trace_benchmark.h +++ b/kernel/trace/trace_benchmark.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #undef TRACE_SYSTEM | 2 | #undef TRACE_SYSTEM |
2 | #define TRACE_SYSTEM benchmark | 3 | #define TRACE_SYSTEM benchmark |
3 | 4 | ||
diff --git a/kernel/trace/trace_branch.c b/kernel/trace/trace_branch.c index 4d8fdf3184dc..4ad967453b6f 100644 --- a/kernel/trace/trace_branch.c +++ b/kernel/trace/trace_branch.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * unlikely profiler | 3 | * unlikely profiler |
3 | * | 4 | * |
diff --git a/kernel/trace/trace_entries.h b/kernel/trace/trace_entries.h index adcdbbeae010..e954ae3d82c0 100644 --- a/kernel/trace/trace_entries.h +++ b/kernel/trace/trace_entries.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * This file defines the trace event structures that go into the ring | 3 | * This file defines the trace event structures that go into the ring |
3 | * buffer directly. They are created via macros so that changes for them | 4 | * buffer directly. They are created via macros so that changes for them |
diff --git a/kernel/trace/trace_events_filter_test.h b/kernel/trace/trace_events_filter_test.h index bfd4dba0d603..39d7ef4f57cb 100644 --- a/kernel/trace/trace_events_filter_test.h +++ b/kernel/trace/trace_events_filter_test.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #undef TRACE_SYSTEM | 2 | #undef TRACE_SYSTEM |
2 | #define TRACE_SYSTEM test | 3 | #define TRACE_SYSTEM test |
3 | 4 | ||
diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c index 39aa7aa66468..548e62eb5c46 100644 --- a/kernel/trace/trace_export.c +++ b/kernel/trace/trace_export.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * trace_export.c - export basic ftrace utilities to user space | 3 | * trace_export.c - export basic ftrace utilities to user space |
3 | * | 4 | * |
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c index a0910c0cdf2e..27f7ad12c4b1 100644 --- a/kernel/trace/trace_functions.c +++ b/kernel/trace/trace_functions.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * ring buffer based function tracer | 3 | * ring buffer based function tracer |
3 | * | 4 | * |
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index b8f1f54731af..23c0b0cb5fb9 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * | 3 | * |
3 | * Function graph tracer. | 4 | * Function graph tracer. |
diff --git a/kernel/trace/trace_kdb.c b/kernel/trace/trace_kdb.c index 57149bce6aad..d953c163a079 100644 --- a/kernel/trace/trace_kdb.c +++ b/kernel/trace/trace_kdb.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * kdb helper for dumping the ftrace buffer | 3 | * kdb helper for dumping the ftrace buffer |
3 | * | 4 | * |
diff --git a/kernel/trace/trace_mmiotrace.c b/kernel/trace/trace_mmiotrace.c index dca78fc48439..b0388016b687 100644 --- a/kernel/trace/trace_mmiotrace.c +++ b/kernel/trace/trace_mmiotrace.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Memory mapped I/O tracing | 3 | * Memory mapped I/O tracing |
3 | * | 4 | * |
diff --git a/kernel/trace/trace_nop.c b/kernel/trace/trace_nop.c index 49f61fe96a6b..50523f953a5d 100644 --- a/kernel/trace/trace_nop.c +++ b/kernel/trace/trace_nop.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * nop tracer | 3 | * nop tracer |
3 | * | 4 | * |
diff --git a/kernel/trace/trace_output.h b/kernel/trace/trace_output.h index fabc49bcd493..dbba03ed96de 100644 --- a/kernel/trace/trace_output.h +++ b/kernel/trace/trace_output.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __TRACE_EVENTS_H | 2 | #ifndef __TRACE_EVENTS_H |
2 | #define __TRACE_EVENTS_H | 3 | #define __TRACE_EVENTS_H |
3 | 4 | ||
diff --git a/kernel/trace/trace_sched_switch.c b/kernel/trace/trace_sched_switch.c index b341c02730be..e288168661e1 100644 --- a/kernel/trace/trace_sched_switch.c +++ b/kernel/trace/trace_sched_switch.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * trace context switch | 3 | * trace context switch |
3 | * | 4 | * |
diff --git a/kernel/trace/trace_sched_wakeup.c b/kernel/trace/trace_sched_wakeup.c index 0c331978b1a6..7d461dcd4831 100644 --- a/kernel/trace/trace_sched_wakeup.c +++ b/kernel/trace/trace_sched_wakeup.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * trace task wakeup timings | 3 | * trace task wakeup timings |
3 | * | 4 | * |
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c index b17ec642793b..cd70eb5df38e 100644 --- a/kernel/trace/trace_selftest.c +++ b/kernel/trace/trace_selftest.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* Include in trace.c */ | 2 | /* Include in trace.c */ |
2 | 3 | ||
3 | #include <uapi/linux/sched/types.h> | 4 | #include <uapi/linux/sched/types.h> |
diff --git a/kernel/trace/trace_selftest_dynamic.c b/kernel/trace/trace_selftest_dynamic.c index b4c475a0a48b..8cda06a10d66 100644 --- a/kernel/trace/trace_selftest_dynamic.c +++ b/kernel/trace/trace_selftest_dynamic.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "trace.h" | 2 | #include "trace.h" |
2 | 3 | ||
3 | int DYN_FTRACE_TEST_NAME(void) | 4 | int DYN_FTRACE_TEST_NAME(void) |
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c index 780262210c9a..734accc02418 100644 --- a/kernel/trace/trace_stack.c +++ b/kernel/trace/trace_stack.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Copyright (C) 2008 Steven Rostedt <srostedt@redhat.com> | 3 | * Copyright (C) 2008 Steven Rostedt <srostedt@redhat.com> |
3 | * | 4 | * |
diff --git a/kernel/trace/trace_stat.c b/kernel/trace/trace_stat.c index 413ff108fbd0..75bf1bcb4a8a 100644 --- a/kernel/trace/trace_stat.c +++ b/kernel/trace/trace_stat.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Infrastructure for statistic tracing (histogram output). | 3 | * Infrastructure for statistic tracing (histogram output). |
3 | * | 4 | * |
diff --git a/kernel/trace/trace_stat.h b/kernel/trace/trace_stat.h index 8f03914b9a6a..76d30b4ebe83 100644 --- a/kernel/trace/trace_stat.h +++ b/kernel/trace/trace_stat.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __TRACE_STAT_H | 2 | #ifndef __TRACE_STAT_H |
2 | #define __TRACE_STAT_H | 3 | #define __TRACE_STAT_H |
3 | 4 | ||
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index 696afe72d3b1..a2a642f2c64f 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <trace/syscall.h> | 2 | #include <trace/syscall.h> |
2 | #include <trace/events/syscalls.h> | 3 | #include <trace/events/syscalls.h> |
3 | #include <linux/syscalls.h> | 4 | #include <linux/syscalls.h> |
diff --git a/kernel/trace/tracing_map.h b/kernel/trace/tracing_map.h index 618838f5f30a..ab0ca77331d0 100644 --- a/kernel/trace/tracing_map.h +++ b/kernel/trace/tracing_map.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __TRACING_MAP_H | 2 | #ifndef __TRACING_MAP_H |
2 | #define __TRACING_MAP_H | 3 | #define __TRACING_MAP_H |
3 | 4 | ||
diff --git a/kernel/uid16.c b/kernel/uid16.c index 5c2dc5b2bf4f..ce74a4901d2b 100644 --- a/kernel/uid16.c +++ b/kernel/uid16.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Wrapper functions for 16bit uid back compatibility. All nicely tied | 3 | * Wrapper functions for 16bit uid back compatibility. All nicely tied |
3 | * together in the faint hope we can take the out in five years time. | 4 | * together in the faint hope we can take the out in five years time. |
diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 6bcb854909c0..c8e06703e44c 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Detect hard and soft lockups on a system | 3 | * Detect hard and soft lockups on a system |
3 | * | 4 | * |
diff --git a/kernel/watchdog_hld.c b/kernel/watchdog_hld.c index 71a62ceacdc8..e449a23e9d59 100644 --- a/kernel/watchdog_hld.c +++ b/kernel/watchdog_hld.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Detect hard lockups on a system | 3 | * Detect hard lockups on a system |
3 | * | 4 | * |
@@ -12,6 +13,7 @@ | |||
12 | #define pr_fmt(fmt) "NMI watchdog: " fmt | 13 | #define pr_fmt(fmt) "NMI watchdog: " fmt |
13 | 14 | ||
14 | #include <linux/nmi.h> | 15 | #include <linux/nmi.h> |
16 | #include <linux/atomic.h> | ||
15 | #include <linux/module.h> | 17 | #include <linux/module.h> |
16 | #include <linux/sched/debug.h> | 18 | #include <linux/sched/debug.h> |
17 | 19 | ||
@@ -21,10 +23,11 @@ | |||
21 | static DEFINE_PER_CPU(bool, hard_watchdog_warn); | 23 | static DEFINE_PER_CPU(bool, hard_watchdog_warn); |
22 | static DEFINE_PER_CPU(bool, watchdog_nmi_touch); | 24 | static DEFINE_PER_CPU(bool, watchdog_nmi_touch); |
23 | static DEFINE_PER_CPU(struct perf_event *, watchdog_ev); | 25 | static DEFINE_PER_CPU(struct perf_event *, watchdog_ev); |
26 | static DEFINE_PER_CPU(struct perf_event *, dead_event); | ||
24 | static struct cpumask dead_events_mask; | 27 | static struct cpumask dead_events_mask; |
25 | 28 | ||
26 | static unsigned long hardlockup_allcpu_dumped; | 29 | static unsigned long hardlockup_allcpu_dumped; |
27 | static unsigned int watchdog_cpus; | 30 | static atomic_t watchdog_cpus = ATOMIC_INIT(0); |
28 | 31 | ||
29 | void arch_touch_nmi_watchdog(void) | 32 | void arch_touch_nmi_watchdog(void) |
30 | { | 33 | { |
@@ -188,7 +191,8 @@ void hardlockup_detector_perf_enable(void) | |||
188 | if (hardlockup_detector_event_create()) | 191 | if (hardlockup_detector_event_create()) |
189 | return; | 192 | return; |
190 | 193 | ||
191 | if (!watchdog_cpus++) | 194 | /* use original value for check */ |
195 | if (!atomic_fetch_inc(&watchdog_cpus)) | ||
192 | pr_info("Enabled. Permanently consumes one hw-PMU counter.\n"); | 196 | pr_info("Enabled. Permanently consumes one hw-PMU counter.\n"); |
193 | 197 | ||
194 | perf_event_enable(this_cpu_read(watchdog_ev)); | 198 | perf_event_enable(this_cpu_read(watchdog_ev)); |
@@ -203,8 +207,10 @@ void hardlockup_detector_perf_disable(void) | |||
203 | 207 | ||
204 | if (event) { | 208 | if (event) { |
205 | perf_event_disable(event); | 209 | perf_event_disable(event); |
210 | this_cpu_write(watchdog_ev, NULL); | ||
211 | this_cpu_write(dead_event, event); | ||
206 | cpumask_set_cpu(smp_processor_id(), &dead_events_mask); | 212 | cpumask_set_cpu(smp_processor_id(), &dead_events_mask); |
207 | watchdog_cpus--; | 213 | atomic_dec(&watchdog_cpus); |
208 | } | 214 | } |
209 | } | 215 | } |
210 | 216 | ||
@@ -218,7 +224,7 @@ void hardlockup_detector_perf_cleanup(void) | |||
218 | int cpu; | 224 | int cpu; |
219 | 225 | ||
220 | for_each_cpu(cpu, &dead_events_mask) { | 226 | for_each_cpu(cpu, &dead_events_mask) { |
221 | struct perf_event *event = per_cpu(watchdog_ev, cpu); | 227 | struct perf_event *event = per_cpu(dead_event, cpu); |
222 | 228 | ||
223 | /* | 229 | /* |
224 | * Required because for_each_cpu() reports unconditionally | 230 | * Required because for_each_cpu() reports unconditionally |
@@ -226,7 +232,7 @@ void hardlockup_detector_perf_cleanup(void) | |||
226 | */ | 232 | */ |
227 | if (event) | 233 | if (event) |
228 | perf_event_release_kernel(event); | 234 | perf_event_release_kernel(event); |
229 | per_cpu(watchdog_ev, cpu) = NULL; | 235 | per_cpu(dead_event, cpu) = NULL; |
230 | } | 236 | } |
231 | cpumask_clear(&dead_events_mask); | 237 | cpumask_clear(&dead_events_mask); |
232 | } | 238 | } |
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 160fdc6e839a..1070b21ba4aa 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -68,6 +68,7 @@ enum { | |||
68 | * attach_mutex to avoid changing binding state while | 68 | * attach_mutex to avoid changing binding state while |
69 | * worker_attach_to_pool() is in progress. | 69 | * worker_attach_to_pool() is in progress. |
70 | */ | 70 | */ |
71 | POOL_MANAGER_ACTIVE = 1 << 0, /* being managed */ | ||
71 | POOL_DISASSOCIATED = 1 << 2, /* cpu can't serve workers */ | 72 | POOL_DISASSOCIATED = 1 << 2, /* cpu can't serve workers */ |
72 | 73 | ||
73 | /* worker flags */ | 74 | /* worker flags */ |
@@ -165,7 +166,6 @@ struct worker_pool { | |||
165 | /* L: hash of busy workers */ | 166 | /* L: hash of busy workers */ |
166 | 167 | ||
167 | /* see manage_workers() for details on the two manager mutexes */ | 168 | /* see manage_workers() for details on the two manager mutexes */ |
168 | struct mutex manager_arb; /* manager arbitration */ | ||
169 | struct worker *manager; /* L: purely informational */ | 169 | struct worker *manager; /* L: purely informational */ |
170 | struct mutex attach_mutex; /* attach/detach exclusion */ | 170 | struct mutex attach_mutex; /* attach/detach exclusion */ |
171 | struct list_head workers; /* A: attached workers */ | 171 | struct list_head workers; /* A: attached workers */ |
@@ -299,6 +299,7 @@ static struct workqueue_attrs *wq_update_unbound_numa_attrs_buf; | |||
299 | 299 | ||
300 | static DEFINE_MUTEX(wq_pool_mutex); /* protects pools and workqueues list */ | 300 | static DEFINE_MUTEX(wq_pool_mutex); /* protects pools and workqueues list */ |
301 | static DEFINE_SPINLOCK(wq_mayday_lock); /* protects wq->maydays list */ | 301 | static DEFINE_SPINLOCK(wq_mayday_lock); /* protects wq->maydays list */ |
302 | static DECLARE_WAIT_QUEUE_HEAD(wq_manager_wait); /* wait for manager to go away */ | ||
302 | 303 | ||
303 | static LIST_HEAD(workqueues); /* PR: list of all workqueues */ | 304 | static LIST_HEAD(workqueues); /* PR: list of all workqueues */ |
304 | static bool workqueue_freezing; /* PL: have wqs started freezing? */ | 305 | static bool workqueue_freezing; /* PL: have wqs started freezing? */ |
@@ -801,7 +802,7 @@ static bool need_to_create_worker(struct worker_pool *pool) | |||
801 | /* Do we have too many workers and should some go away? */ | 802 | /* Do we have too many workers and should some go away? */ |
802 | static bool too_many_workers(struct worker_pool *pool) | 803 | static bool too_many_workers(struct worker_pool *pool) |
803 | { | 804 | { |
804 | bool managing = mutex_is_locked(&pool->manager_arb); | 805 | bool managing = pool->flags & POOL_MANAGER_ACTIVE; |
805 | int nr_idle = pool->nr_idle + managing; /* manager is considered idle */ | 806 | int nr_idle = pool->nr_idle + managing; /* manager is considered idle */ |
806 | int nr_busy = pool->nr_workers - nr_idle; | 807 | int nr_busy = pool->nr_workers - nr_idle; |
807 | 808 | ||
@@ -1980,24 +1981,17 @@ static bool manage_workers(struct worker *worker) | |||
1980 | { | 1981 | { |
1981 | struct worker_pool *pool = worker->pool; | 1982 | struct worker_pool *pool = worker->pool; |
1982 | 1983 | ||
1983 | /* | 1984 | if (pool->flags & POOL_MANAGER_ACTIVE) |
1984 | * Anyone who successfully grabs manager_arb wins the arbitration | ||
1985 | * and becomes the manager. mutex_trylock() on pool->manager_arb | ||
1986 | * failure while holding pool->lock reliably indicates that someone | ||
1987 | * else is managing the pool and the worker which failed trylock | ||
1988 | * can proceed to executing work items. This means that anyone | ||
1989 | * grabbing manager_arb is responsible for actually performing | ||
1990 | * manager duties. If manager_arb is grabbed and released without | ||
1991 | * actual management, the pool may stall indefinitely. | ||
1992 | */ | ||
1993 | if (!mutex_trylock(&pool->manager_arb)) | ||
1994 | return false; | 1985 | return false; |
1986 | |||
1987 | pool->flags |= POOL_MANAGER_ACTIVE; | ||
1995 | pool->manager = worker; | 1988 | pool->manager = worker; |
1996 | 1989 | ||
1997 | maybe_create_worker(pool); | 1990 | maybe_create_worker(pool); |
1998 | 1991 | ||
1999 | pool->manager = NULL; | 1992 | pool->manager = NULL; |
2000 | mutex_unlock(&pool->manager_arb); | 1993 | pool->flags &= ~POOL_MANAGER_ACTIVE; |
1994 | wake_up(&wq_manager_wait); | ||
2001 | return true; | 1995 | return true; |
2002 | } | 1996 | } |
2003 | 1997 | ||
@@ -3235,7 +3229,6 @@ static int init_worker_pool(struct worker_pool *pool) | |||
3235 | setup_timer(&pool->mayday_timer, pool_mayday_timeout, | 3229 | setup_timer(&pool->mayday_timer, pool_mayday_timeout, |
3236 | (unsigned long)pool); | 3230 | (unsigned long)pool); |
3237 | 3231 | ||
3238 | mutex_init(&pool->manager_arb); | ||
3239 | mutex_init(&pool->attach_mutex); | 3232 | mutex_init(&pool->attach_mutex); |
3240 | INIT_LIST_HEAD(&pool->workers); | 3233 | INIT_LIST_HEAD(&pool->workers); |
3241 | 3234 | ||
@@ -3305,13 +3298,15 @@ static void put_unbound_pool(struct worker_pool *pool) | |||
3305 | hash_del(&pool->hash_node); | 3298 | hash_del(&pool->hash_node); |
3306 | 3299 | ||
3307 | /* | 3300 | /* |
3308 | * Become the manager and destroy all workers. Grabbing | 3301 | * Become the manager and destroy all workers. This prevents |
3309 | * manager_arb prevents @pool's workers from blocking on | 3302 | * @pool's workers from blocking on attach_mutex. We're the last |
3310 | * attach_mutex. | 3303 | * manager and @pool gets freed with the flag set. |
3311 | */ | 3304 | */ |
3312 | mutex_lock(&pool->manager_arb); | ||
3313 | |||
3314 | spin_lock_irq(&pool->lock); | 3305 | spin_lock_irq(&pool->lock); |
3306 | wait_event_lock_irq(wq_manager_wait, | ||
3307 | !(pool->flags & POOL_MANAGER_ACTIVE), pool->lock); | ||
3308 | pool->flags |= POOL_MANAGER_ACTIVE; | ||
3309 | |||
3315 | while ((worker = first_idle_worker(pool))) | 3310 | while ((worker = first_idle_worker(pool))) |
3316 | destroy_worker(worker); | 3311 | destroy_worker(worker); |
3317 | WARN_ON(pool->nr_workers || pool->nr_idle); | 3312 | WARN_ON(pool->nr_workers || pool->nr_idle); |
@@ -3325,8 +3320,6 @@ static void put_unbound_pool(struct worker_pool *pool) | |||
3325 | if (pool->detach_completion) | 3320 | if (pool->detach_completion) |
3326 | wait_for_completion(pool->detach_completion); | 3321 | wait_for_completion(pool->detach_completion); |
3327 | 3322 | ||
3328 | mutex_unlock(&pool->manager_arb); | ||
3329 | |||
3330 | /* shut down the timers */ | 3323 | /* shut down the timers */ |
3331 | del_timer_sync(&pool->idle_timer); | 3324 | del_timer_sync(&pool->idle_timer); |
3332 | del_timer_sync(&pool->mayday_timer); | 3325 | del_timer_sync(&pool->mayday_timer); |
diff --git a/kernel/workqueue_internal.h b/kernel/workqueue_internal.h index 8635417c587b..d390d1be3748 100644 --- a/kernel/workqueue_internal.h +++ b/kernel/workqueue_internal.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * kernel/workqueue_internal.h | 3 | * kernel/workqueue_internal.h |
3 | * | 4 | * |
@@ -9,6 +10,7 @@ | |||
9 | 10 | ||
10 | #include <linux/workqueue.h> | 11 | #include <linux/workqueue.h> |
11 | #include <linux/kthread.h> | 12 | #include <linux/kthread.h> |
13 | #include <linux/preempt.h> | ||
12 | 14 | ||
13 | struct worker_pool; | 15 | struct worker_pool; |
14 | 16 | ||
@@ -59,7 +61,7 @@ struct worker { | |||
59 | */ | 61 | */ |
60 | static inline struct worker *current_wq_worker(void) | 62 | static inline struct worker *current_wq_worker(void) |
61 | { | 63 | { |
62 | if (current->flags & PF_WQ_WORKER) | 64 | if (in_task() && (current->flags & PF_WQ_WORKER)) |
63 | return kthread_data(current); | 65 | return kthread_data(current); |
64 | return NULL; | 66 | return NULL; |
65 | } | 67 | } |