Skip to content

Commit 08615d7

Browse files
committed
Merge branch 'akpm' (Andrew's patch-bomb)
Merge misc patches from Andrew Morton: - the "misc" tree - stuff from all over the map - checkpatch updates - fatfs - kmod changes - procfs - cpumask - UML - kexec - mqueue - rapidio - pidns - some checkpoint-restore feature work. Reluctantly. Most of it delayed a release. I'm still rather worried that we don't have a clear roadmap to completion for this work. * emailed from Andrew Morton <akpm@linux-foundation.org>: (78 patches) kconfig: update compression algorithm info c/r: prctl: add ability to set new mm_struct::exe_file c/r: prctl: extend PR_SET_MM to set up more mm_struct entries c/r: procfs: add arg_start/end, env_start/end and exit_code members to /proc/$pid/stat syscalls, x86: add __NR_kcmp syscall fs, proc: introduce /proc/<pid>/task/<tid>/children entry sysctl: make kernel.ns_last_pid control dependent on CHECKPOINT_RESTORE aio/vfs: cleanup of rw_copy_check_uvector() and compat_rw_copy_check_uvector() eventfd: change int to __u64 in eventfd_signal() fs/nls: add Apple NLS pidns: make killed children autoreap pidns: use task_active_pid_ns in do_notify_parent rapidio/tsi721: add DMA engine support rapidio: add DMA engine support for RIO data transfers ipc/mqueue: add rbtree node caching support tools/selftests: add mq_perf_tests ipc/mqueue: strengthen checks on mqueue creation ipc/mqueue: correct mq_attr_ok test ipc/mqueue: improve performance of send/recv selftests: add mq_open_tests ...
2 parents 9fdadb2 + 0a4dd35 commit 08615d7

108 files changed

Lines changed: 10620 additions & 699 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.mailmap‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,5 @@ Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
113113
Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
114114
Takashi YOSHII <takashi.yoshii.zj@renesas.com>
115115
Yusuke Goda <goda.yusuke@renesas.com>
116+
Gustavo Padovan <gustavo@las.ic.unicamp.br>
117+
Gustavo Padovan <padovan@profusion.mobi>

‎Documentation/CodingStyle‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,8 +671,9 @@ ones already enabled by DEBUG.
671671
Chapter 14: Allocating memory
672672

673673
The kernel provides the following general purpose memory allocators:
674-
kmalloc(), kzalloc(), kcalloc(), vmalloc(), and vzalloc(). Please refer to
675-
the API documentation for further information about them.
674+
kmalloc(), kzalloc(), kmalloc_array(), kcalloc(), vmalloc(), and
675+
vzalloc(). Please refer to the API documentation for further information
676+
about them.
676677

677678
The preferred form for passing a size of a struct is the following:
678679

@@ -686,6 +687,17 @@ Casting the return value which is a void pointer is redundant. The conversion
686687
from void pointer to any other pointer type is guaranteed by the C programming
687688
language.
688689

690+
The preferred form for allocating an array is the following:
691+
692+
p = kmalloc_array(n, sizeof(...), ...);
693+
694+
The preferred form for allocating a zeroed array is the following:
695+
696+
p = kcalloc(n, sizeof(...), ...);
697+
698+
Both forms check for overflow on the allocation size n * sizeof(...),
699+
and return NULL if that occurred.
700+
689701

690702
Chapter 15: The inline disease
691703

‎Documentation/filesystems/proc.txt‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Table of Contents
4040
3.4 /proc/<pid>/coredump_filter - Core dump filtering settings
4141
3.5 /proc/<pid>/mountinfo - Information about mounts
4242
3.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm
43+
3.7 /proc/<pid>/task/<tid>/children - Information about task children
4344

4445
4 Configuring procfs
4546
4.1 Mount options
@@ -310,6 +311,11 @@ Table 1-4: Contents of the stat files (as of 2.6.30-rc7)
310311
start_data address above which program data+bss is placed
311312
end_data address below which program data+bss is placed
312313
start_brk address above which program heap can be expanded with brk()
314+
arg_start address above which program command line is placed
315+
arg_end address below which program command line is placed
316+
env_start address above which program environment is placed
317+
env_end address below which program environment is placed
318+
exit_code the thread's exit_code in the form reported by the waitpid system call
313319
..............................................................................
314320

315321
The /proc/PID/maps file containing the currently mapped memory regions and
@@ -1578,6 +1584,23 @@ then the kernel's TASK_COMM_LEN (currently 16 chars) will result in a truncated
15781584
comm value.
15791585

15801586

1587+
3.7 /proc/<pid>/task/<tid>/children - Information about task children
1588+
-------------------------------------------------------------------------
1589+
This file provides a fast way to retrieve first level children pids
1590+
of a task pointed by <pid>/<tid> pair. The format is a space separated
1591+
stream of pids.
1592+
1593+
Note the "first level" here -- if a child has own children they will
1594+
not be listed here, one needs to read /proc/<children-pid>/task/<tid>/children
1595+
to obtain the descendants.
1596+
1597+
Since this interface is intended to be fast and cheap it doesn't
1598+
guarantee to provide precise results and some children might be
1599+
skipped, especially if they've exited right after we printed their
1600+
pids, so one need to either stop or freeze processes being inspected
1601+
if precise results are needed.
1602+
1603+
15811604
------------------------------------------------------------------------------
15821605
Configuring procfs
15831606
------------------------------------------------------------------------------

‎Documentation/sysctl/fs.txt‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,13 @@ a queue must be less or equal then msg_max.
225225
maximum message size value (it is every message queue's attribute set during
226226
its creation).
227227

228+
/proc/sys/fs/mqueue/msg_default is a read/write file for setting/getting the
229+
default number of messages in a queue value if attr parameter of mq_open(2) is
230+
NULL. If it exceed msg_max, the default value is initialized msg_max.
231+
232+
/proc/sys/fs/mqueue/msgsize_default is a read/write file for setting/getting
233+
the default message size value if attr parameter of mq_open(2) is NULL. If it
234+
exceed msgsize_max, the default value is initialized msgsize_max.
228235

229236
4. /proc/sys/fs/epoll - Configuration options for the epoll interface
230237
--------------------------------------------------------

‎Documentation/vm/pagemap.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ There are three components to pagemap:
1616
* Bits 0-4 swap type if swapped
1717
* Bits 5-54 swap offset if swapped
1818
* Bits 55-60 page shift (page size = 1<<page shift)
19-
* Bit 61 reserved for future use
19+
* Bit 61 page is file-page or shared-anon
2020
* Bit 62 page swapped
2121
* Bit 63 page present
2222

‎arch/arm/kernel/smp.c‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ static void percpu_timer_stop(void);
109109
int __cpu_disable(void)
110110
{
111111
unsigned int cpu = smp_processor_id();
112-
struct task_struct *p;
113112
int ret;
114113

115114
ret = platform_cpu_disable(cpu);
@@ -139,12 +138,7 @@ int __cpu_disable(void)
139138
flush_cache_all();
140139
local_flush_tlb_all();
141140

142-
read_lock(&tasklist_lock);
143-
for_each_process(p) {
144-
if (p->mm)
145-
cpumask_clear_cpu(cpu, mm_cpumask(p->mm));
146-
}
147-
read_unlock(&tasklist_lock);
141+
clear_tasks_mm_cpumask(cpu);
148142

149143
return 0;
150144
}

‎arch/blackfin/kernel/trace.c‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include <linux/hardirq.h>
1111
#include <linux/thread_info.h>
1212
#include <linux/mm.h>
13+
#include <linux/oom.h>
14+
#include <linux/sched.h>
1315
#include <linux/uaccess.h>
1416
#include <linux/module.h>
1517
#include <linux/kallsyms.h>
@@ -27,8 +29,7 @@ void decode_address(char *buf, unsigned long address)
2729
{
2830
struct task_struct *p;
2931
struct mm_struct *mm;
30-
unsigned long flags, offset;
31-
unsigned char in_atomic = (bfin_read_IPEND() & 0x10) || in_atomic();
32+
unsigned long offset;
3233
struct rb_node *n;
3334

3435
#ifdef CONFIG_KALLSYMS
@@ -112,17 +113,17 @@ void decode_address(char *buf, unsigned long address)
112113
* mappings of all our processes and see if we can't be a whee
113114
* bit more specific
114115
*/
115-
write_lock_irqsave(&tasklist_lock, flags);
116+
read_lock(&tasklist_lock);
116117
for_each_process(p) {
117-
mm = (in_atomic ? p->mm : get_task_mm(p));
118-
if (!mm)
119-
continue;
118+
struct task_struct *t;
120119

121-
if (!down_read_trylock(&mm->mmap_sem)) {
122-
if (!in_atomic)
123-
mmput(mm);
120+
t = find_lock_task_mm(p);
121+
if (!t)
124122
continue;
125-
}
123+
124+
mm = t->mm;
125+
if (!down_read_trylock(&mm->mmap_sem))
126+
goto __continue;
126127

127128
for (n = rb_first(&mm->mm_rb); n; n = rb_next(n)) {
128129
struct vm_area_struct *vma;
@@ -131,7 +132,7 @@ void decode_address(char *buf, unsigned long address)
131132

132133
if (address >= vma->vm_start && address < vma->vm_end) {
133134
char _tmpbuf[256];
134-
char *name = p->comm;
135+
char *name = t->comm;
135136
struct file *file = vma->vm_file;
136137

137138
if (file) {
@@ -164,8 +165,7 @@ void decode_address(char *buf, unsigned long address)
164165
name, vma->vm_start, vma->vm_end);
165166

166167
up_read(&mm->mmap_sem);
167-
if (!in_atomic)
168-
mmput(mm);
168+
task_unlock(t);
169169

170170
if (buf[0] == '\0')
171171
sprintf(buf, "[ %s ] dynamic memory", name);
@@ -175,8 +175,8 @@ void decode_address(char *buf, unsigned long address)
175175
}
176176

177177
up_read(&mm->mmap_sem);
178-
if (!in_atomic)
179-
mmput(mm);
178+
__continue:
179+
task_unlock(t);
180180
}
181181

182182
/*
@@ -186,7 +186,7 @@ void decode_address(char *buf, unsigned long address)
186186
sprintf(buf, "/* kernel dynamic memory */");
187187

188188
done:
189-
write_unlock_irqrestore(&tasklist_lock, flags);
189+
read_unlock(&tasklist_lock);
190190
}
191191

192192
#define EXPAND_LEN ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN) * 256 - 1)

‎arch/powerpc/mm/mmu_context_nohash.c‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,7 @@ static int __cpuinit mmu_context_cpu_notify(struct notifier_block *self,
333333
unsigned long action, void *hcpu)
334334
{
335335
unsigned int cpu = (unsigned int)(long)hcpu;
336-
#ifdef CONFIG_HOTPLUG_CPU
337-
struct task_struct *p;
338-
#endif
336+
339337
/* We don't touch CPU 0 map, it's allocated at aboot and kept
340338
* around forever
341339
*/
@@ -358,12 +356,7 @@ static int __cpuinit mmu_context_cpu_notify(struct notifier_block *self,
358356
stale_map[cpu] = NULL;
359357

360358
/* We also clear the cpu_vm_mask bits of CPUs going away */
361-
read_lock(&tasklist_lock);
362-
for_each_process(p) {
363-
if (p->mm)
364-
cpumask_clear_cpu(cpu, mm_cpumask(p->mm));
365-
}
366-
read_unlock(&tasklist_lock);
359+
clear_tasks_mm_cpumask(cpu);
367360
break;
368361
#endif /* CONFIG_HOTPLUG_CPU */
369362
}

‎arch/sh/kernel/smp.c‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ void native_play_dead(void)
123123
int __cpu_disable(void)
124124
{
125125
unsigned int cpu = smp_processor_id();
126-
struct task_struct *p;
127126
int ret;
128127

129128
ret = mp_ops->cpu_disable(cpu);
@@ -153,11 +152,7 @@ int __cpu_disable(void)
153152
flush_cache_all();
154153
local_flush_tlb_all();
155154

156-
read_lock(&tasklist_lock);
157-
for_each_process(p)
158-
if (p->mm)
159-
cpumask_clear_cpu(cpu, mm_cpumask(p->mm));
160-
read_unlock(&tasklist_lock);
155+
clear_tasks_mm_cpumask(cpu);
161156

162157
return 0;
163158
}

‎arch/um/kernel/reboot.c‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
*/
55

66
#include "linux/sched.h"
7+
#include "linux/spinlock.h"
78
#include "linux/slab.h"
9+
#include "linux/oom.h"
810
#include "kern_util.h"
911
#include "os.h"
1012
#include "skas.h"
@@ -22,13 +24,18 @@ static void kill_off_processes(void)
2224
struct task_struct *p;
2325
int pid;
2426

27+
read_lock(&tasklist_lock);
2528
for_each_process(p) {
26-
if (p->mm == NULL)
27-
continue;
29+
struct task_struct *t;
2830

29-
pid = p->mm->context.id.u.pid;
31+
t = find_lock_task_mm(p);
32+
if (!t)
33+
continue;
34+
pid = t->mm->context.id.u.pid;
35+
task_unlock(t);
3036
os_kill_ptraced_process(pid, 1);
3137
}
38+
read_unlock(&tasklist_lock);
3239
}
3340
}
3441

0 commit comments

Comments
 (0)