diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-09-01 21:23:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-09-01 21:23:22 -0400 |
commit | b9677faf45bcf4c63431b62758bfd895404f0f3f (patch) | |
tree | 2eca2120d15f22c809a6f7faaf4fd63a4bb33e55 /kernel | |
parent | 511a8cdb650544b7efd1bbccf7967d3153aee5f6 (diff) | |
parent | b30069291dc7f9b9a073c33d619818fe4a8e50de (diff) |
Merge branch 'akpm' (patches from Andrew)
Merge fixes from Andrew Morton:
"14 fixes"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
rapidio/tsi721: fix incorrect detection of address translation condition
rapidio/documentation/mport_cdev: add missing parameter description
kernel/fork: fix CLONE_CHILD_CLEARTID regression in nscd
MAINTAINERS: Vladimir has moved
mm, mempolicy: task->mempolicy must be NULL before dropping final reference
printk/nmi: avoid direct printk()-s from __printk_nmi_flush()
treewide: remove references to the now unnecessary DEFINE_PCI_DEVICE_TABLE
drivers/scsi/wd719x.c: remove last declaration using DEFINE_PCI_DEVICE_TABLE
mm, vmscan: only allocate and reclaim from zones with pages managed by the buddy allocator
lib/test_hash.c: fix warning in preprocessor symbol evaluation
lib/test_hash.c: fix warning in two-dimensional array init
kconfig: tinyconfig: provide whole choice blocks to avoid warnings
kexec: fix double-free when failing to relocate the purgatory
mm, oom: prevent premature OOM killer invocation for high order request
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/configs/tiny.config | 8 | ||||
-rw-r--r-- | kernel/exit.c | 7 | ||||
-rw-r--r-- | kernel/fork.c | 10 | ||||
-rw-r--r-- | kernel/kexec_file.c | 3 | ||||
-rw-r--r-- | kernel/printk/nmi.c | 38 |
5 files changed, 39 insertions, 27 deletions
diff --git a/kernel/configs/tiny.config b/kernel/configs/tiny.config index c2de56ab0fce..7fa0c4ae6394 100644 --- a/kernel/configs/tiny.config +++ b/kernel/configs/tiny.config | |||
@@ -1,4 +1,12 @@ | |||
1 | # CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set | ||
1 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | 2 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y |
3 | # CONFIG_KERNEL_GZIP is not set | ||
4 | # CONFIG_KERNEL_BZIP2 is not set | ||
5 | # CONFIG_KERNEL_LZMA is not set | ||
2 | CONFIG_KERNEL_XZ=y | 6 | CONFIG_KERNEL_XZ=y |
7 | # CONFIG_KERNEL_LZO is not set | ||
8 | # CONFIG_KERNEL_LZ4 is not set | ||
3 | CONFIG_OPTIMIZE_INLINING=y | 9 | CONFIG_OPTIMIZE_INLINING=y |
10 | # CONFIG_SLAB is not set | ||
11 | # CONFIG_SLUB is not set | ||
4 | CONFIG_SLOB=y | 12 | CONFIG_SLOB=y |
diff --git a/kernel/exit.c b/kernel/exit.c index 2f974ae042a6..091a78be3b09 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -848,12 +848,7 @@ void do_exit(long code) | |||
848 | TASKS_RCU(preempt_enable()); | 848 | TASKS_RCU(preempt_enable()); |
849 | exit_notify(tsk, group_dead); | 849 | exit_notify(tsk, group_dead); |
850 | proc_exit_connector(tsk); | 850 | proc_exit_connector(tsk); |
851 | #ifdef CONFIG_NUMA | 851 | mpol_put_task_policy(tsk); |
852 | task_lock(tsk); | ||
853 | mpol_put(tsk->mempolicy); | ||
854 | tsk->mempolicy = NULL; | ||
855 | task_unlock(tsk); | ||
856 | #endif | ||
857 | #ifdef CONFIG_FUTEX | 852 | #ifdef CONFIG_FUTEX |
858 | if (unlikely(current->pi_state_cache)) | 853 | if (unlikely(current->pi_state_cache)) |
859 | kfree(current->pi_state_cache); | 854 | kfree(current->pi_state_cache); |
diff --git a/kernel/fork.c b/kernel/fork.c index 36c0daa03c60..beb31725f7e2 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -936,14 +936,12 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm) | |||
936 | deactivate_mm(tsk, mm); | 936 | deactivate_mm(tsk, mm); |
937 | 937 | ||
938 | /* | 938 | /* |
939 | * If we're exiting normally, clear a user-space tid field if | 939 | * Signal userspace if we're not exiting with a core dump |
940 | * requested. We leave this alone when dying by signal, to leave | 940 | * because we want to leave the value intact for debugging |
941 | * the value intact in a core dump, and to save the unnecessary | 941 | * purposes. |
942 | * trouble, say, a killed vfork parent shouldn't touch this mm. | ||
943 | * Userland only wants this done for a sys_exit. | ||
944 | */ | 942 | */ |
945 | if (tsk->clear_child_tid) { | 943 | if (tsk->clear_child_tid) { |
946 | if (!(tsk->flags & PF_SIGNALED) && | 944 | if (!(tsk->signal->flags & SIGNAL_GROUP_COREDUMP) && |
947 | atomic_read(&mm->mm_users) > 1) { | 945 | atomic_read(&mm->mm_users) > 1) { |
948 | /* | 946 | /* |
949 | * We don't check the error code - if userspace has | 947 | * We don't check the error code - if userspace has |
diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index 503bc2d348e5..037c321c5618 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c | |||
@@ -887,7 +887,10 @@ int kexec_load_purgatory(struct kimage *image, unsigned long min, | |||
887 | return 0; | 887 | return 0; |
888 | out: | 888 | out: |
889 | vfree(pi->sechdrs); | 889 | vfree(pi->sechdrs); |
890 | pi->sechdrs = NULL; | ||
891 | |||
890 | vfree(pi->purgatory_buf); | 892 | vfree(pi->purgatory_buf); |
893 | pi->purgatory_buf = NULL; | ||
891 | return ret; | 894 | return ret; |
892 | } | 895 | } |
893 | 896 | ||
diff --git a/kernel/printk/nmi.c b/kernel/printk/nmi.c index b69eb8a2876f..16bab471c7e2 100644 --- a/kernel/printk/nmi.c +++ b/kernel/printk/nmi.c | |||
@@ -99,27 +99,33 @@ again: | |||
99 | return add; | 99 | return add; |
100 | } | 100 | } |
101 | 101 | ||
102 | /* | 102 | static void printk_nmi_flush_line(const char *text, int len) |
103 | * printk one line from the temporary buffer from @start index until | ||
104 | * and including the @end index. | ||
105 | */ | ||
106 | static void print_nmi_seq_line(struct nmi_seq_buf *s, int start, int end) | ||
107 | { | 103 | { |
108 | const char *buf = s->buffer + start; | ||
109 | |||
110 | /* | 104 | /* |
111 | * The buffers are flushed in NMI only on panic. The messages must | 105 | * The buffers are flushed in NMI only on panic. The messages must |
112 | * go only into the ring buffer at this stage. Consoles will get | 106 | * go only into the ring buffer at this stage. Consoles will get |
113 | * explicitly called later when a crashdump is not generated. | 107 | * explicitly called later when a crashdump is not generated. |
114 | */ | 108 | */ |
115 | if (in_nmi()) | 109 | if (in_nmi()) |
116 | printk_deferred("%.*s", (end - start) + 1, buf); | 110 | printk_deferred("%.*s", len, text); |
117 | else | 111 | else |
118 | printk("%.*s", (end - start) + 1, buf); | 112 | printk("%.*s", len, text); |
119 | 113 | ||
120 | } | 114 | } |
121 | 115 | ||
122 | /* | 116 | /* |
117 | * printk one line from the temporary buffer from @start index until | ||
118 | * and including the @end index. | ||
119 | */ | ||
120 | static void printk_nmi_flush_seq_line(struct nmi_seq_buf *s, | ||
121 | int start, int end) | ||
122 | { | ||
123 | const char *buf = s->buffer + start; | ||
124 | |||
125 | printk_nmi_flush_line(buf, (end - start) + 1); | ||
126 | } | ||
127 | |||
128 | /* | ||
123 | * Flush data from the associated per_CPU buffer. The function | 129 | * Flush data from the associated per_CPU buffer. The function |
124 | * can be called either via IRQ work or independently. | 130 | * can be called either via IRQ work or independently. |
125 | */ | 131 | */ |
@@ -150,9 +156,11 @@ more: | |||
150 | * the buffer an unexpected way. If we printed something then | 156 | * the buffer an unexpected way. If we printed something then |
151 | * @len must only increase. | 157 | * @len must only increase. |
152 | */ | 158 | */ |
153 | if (i && i >= len) | 159 | if (i && i >= len) { |
154 | pr_err("printk_nmi_flush: internal error: i=%d >= len=%zu\n", | 160 | const char *msg = "printk_nmi_flush: internal error\n"; |
155 | i, len); | 161 | |
162 | printk_nmi_flush_line(msg, strlen(msg)); | ||
163 | } | ||
156 | 164 | ||
157 | if (!len) | 165 | if (!len) |
158 | goto out; /* Someone else has already flushed the buffer. */ | 166 | goto out; /* Someone else has already flushed the buffer. */ |
@@ -166,14 +174,14 @@ more: | |||
166 | /* Print line by line. */ | 174 | /* Print line by line. */ |
167 | for (; i < size; i++) { | 175 | for (; i < size; i++) { |
168 | if (s->buffer[i] == '\n') { | 176 | if (s->buffer[i] == '\n') { |
169 | print_nmi_seq_line(s, last_i, i); | 177 | printk_nmi_flush_seq_line(s, last_i, i); |
170 | last_i = i + 1; | 178 | last_i = i + 1; |
171 | } | 179 | } |
172 | } | 180 | } |
173 | /* Check if there was a partial line. */ | 181 | /* Check if there was a partial line. */ |
174 | if (last_i < size) { | 182 | if (last_i < size) { |
175 | print_nmi_seq_line(s, last_i, size - 1); | 183 | printk_nmi_flush_seq_line(s, last_i, size - 1); |
176 | pr_cont("\n"); | 184 | printk_nmi_flush_line("\n", strlen("\n")); |
177 | } | 185 | } |
178 | 186 | ||
179 | /* | 187 | /* |