Skip to content

Commit 0994695

Browse files
committed
Merge branch 'akpm' (aka "Andrew's patch-bomb, take two")
Andrew explains: - various misc stuff - Most of the rest of MM: memcg, threaded hugepages, others. - cpumask - kexec - kdump - some direct-io performance tweaking - radix-tree optimisations - new selftests code A note on this: often people will develop a new userspace-visible feature and will develop userspace code to exercise/test that feature. Then they merge the patch and the selftest code dies. Sometimes we paste it into the changelog. Sometimes the code gets thrown into Documentation/(!). This saddens me. So this patch creates a bare-bones framework which will henceforth allow me to ask people to include their test apps in the kernel tree so we can keep them alive. Then when people enhance or fix the feature, I can ask them to update the test app too. The infrastruture is terribly trivial at present - let's see how it evolves. - checkpoint/restart feature work. A note on this: this is a project by various mad Russians to perform c/r mainly from userspace, with various oddball helper code added into the kernel where the need is demonstrated. So rather than some large central lump of code, what we have is little bits and pieces popping up in various places which either expose something new or which permit something which is normally kernel-private to be modified. The overall project is an ongoing thing. I've judged that the size and scope of the thing means that we're more likely to be successful with it if we integrate the support into mainline piecemeal rather than allowing it all to develop out-of-tree. However I'm less confident than the developers that it will all eventually work! So what I'm asking them to do is to wrap each piece of new code inside CONFIG_CHECKPOINT_RESTORE. So if it all eventually comes to tears and the project as a whole fails, it should be a simple matter to go through and delete all trace of it. This lot pretty much wraps up the -rc1 merge for me. * akpm: (96 commits) unlzo: fix input buffer free ramoops: update parameters only after successful init ramoops: fix use of rounddown_pow_of_two() c/r: prctl: add PR_SET_MM codes to set up mm_struct entries c/r: procfs: add start_data, end_data, start_brk members to /proc/$pid/stat v4 c/r: introduce CHECKPOINT_RESTORE symbol selftests: new x86 breakpoints selftest selftests: new very basic kernel selftests directory radix_tree: take radix_tree_path off stack radix_tree: remove radix_tree_indirect_to_ptr() dio: optimize cache misses in the submission path vfs: cache request_queue in struct block_device fs/direct-io.c: calculate fs_count correctly in get_more_blocks() drivers/parport/parport_pc.c: fix warnings panic: don't print redundant backtraces on oops sysctl: add the kernel.ns_last_pid control kdump: add udev events for memory online/offline include/linux/crash_dump.h needs elf.h kdump: fix crash_kexec()/smp_send_stop() race in panic() kdump: crashk_res init check for /sys/kernel/kexec_crash_size ...
2 parents 7c17d86 + 35f1526 commit 0994695

Some content is hidden

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

100 files changed

+2589
-1562
lines changed

Documentation/ABI/testing/sysfs-kernel-slab

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,10 @@ Description:
346346
number of objects per slab. If a slab cannot be allocated
347347
because of fragmentation, SLUB will retry with the minimum order
348348
possible depending on its characteristics.
349+
When debug_guardpage_minorder=N (N > 0) parameter is specified
350+
(see Documentation/kernel-parameters.txt), the minimum possible
351+
order is used and this sysfs entry can not be used to change
352+
the order at run time.
349353

350354
What: /sys/kernel/slab/cache/order_fallback
351355
Date: April 2008

Documentation/cgroups/memory.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Brief summary of control files.
6161
memory.failcnt # show the number of memory usage hits limits
6262
memory.memsw.failcnt # show the number of memory+Swap hits limits
6363
memory.max_usage_in_bytes # show max memory usage recorded
64-
memory.memsw.usage_in_bytes # show max memory+Swap usage recorded
64+
memory.memsw.max_usage_in_bytes # show max memory+Swap usage recorded
6565
memory.soft_limit_in_bytes # set/show soft limit of memory usage
6666
memory.stat # show various statistics
6767
memory.use_hierarchy # set/show hierarchical account enabled
@@ -410,8 +410,11 @@ memory.stat file includes following statistics
410410
cache - # of bytes of page cache memory.
411411
rss - # of bytes of anonymous and swap cache memory.
412412
mapped_file - # of bytes of mapped file (includes tmpfs/shmem)
413-
pgpgin - # of pages paged in (equivalent to # of charging events).
414-
pgpgout - # of pages paged out (equivalent to # of uncharging events).
413+
pgpgin - # of charging events to the memory cgroup. The charging
414+
event happens each time a page is accounted as either mapped
415+
anon page(RSS) or cache page(Page Cache) to the cgroup.
416+
pgpgout - # of uncharging events to the memory cgroup. The uncharging
417+
event happens each time a page is unaccounted from the cgroup.
415418
swap - # of bytes of swap usage
416419
inactive_anon - # of bytes of anonymous memory and swap cache memory on
417420
LRU list.

Documentation/filesystems/proc.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ Table 1-4: Contents of the stat files (as of 2.6.30-rc7)
307307
blkio_ticks time spent waiting for block IO
308308
gtime guest time of the task in jiffies
309309
cgtime guest time of the task children in jiffies
310+
start_data address above which program data+bss is placed
311+
end_data address below which program data+bss is placed
312+
start_brk address above which program heap can be expanded with brk()
310313
..............................................................................
311314

312315
The /proc/PID/maps file containing the currently mapped memory regions and

Documentation/sysctl/kernel.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,14 @@ PIDs of value pid_max or larger are not allocated.
415415

416416
==============================================================
417417

418+
ns_last_pid:
419+
420+
The last pid allocated in the current (the one task using this sysctl
421+
lives in) pid namespace. When selecting a pid for a next task on fork
422+
kernel tries to allocate a number starting from this one.
423+
424+
==============================================================
425+
418426
powersave-nap: (PPC only)
419427

420428
If set, Linux-PPC will use the 'nap' mode of powersaving,

Documentation/vm/slub.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ slub_min_objects.
131131
slub_max_order specified the order at which slub_min_objects should no
132132
longer be checked. This is useful to avoid SLUB trying to generate
133133
super large order pages to fit slub_min_objects of a slab cache with
134-
large object sizes into one high order page.
134+
large object sizes into one high order page. Setting command line
135+
parameter debug_guardpage_minorder=N (N > 0), forces setting
136+
slub_max_order to 0, what cause minimum possible order of slabs
137+
allocation.
135138

136139
SLUB Debug output
137140
-----------------

arch/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,18 @@ config HAVE_RCU_TABLE_FREE
185185
config ARCH_HAVE_NMI_SAFE_CMPXCHG
186186
bool
187187

188+
config HAVE_ALIGNED_STRUCT_PAGE
189+
bool
190+
help
191+
This makes sure that struct pages are double word aligned and that
192+
e.g. the SLUB allocator can perform double word atomic operations
193+
on a struct page for better performance. However selecting this
194+
might increase the size of a struct page by a word.
195+
196+
config HAVE_CMPXCHG_LOCAL
197+
bool
198+
199+
config HAVE_CMPXCHG_DOUBLE
200+
bool
201+
188202
source "kernel/gcov/Kconfig"

arch/avr32/include/asm/system.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr,
169169
#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
170170

171171
struct pt_regs;
172-
void NORET_TYPE die(const char *str, struct pt_regs *regs, long err);
172+
void die(const char *str, struct pt_regs *regs, long err);
173173
void _exception(long signr, struct pt_regs *regs, int code,
174174
unsigned long addr);
175175

arch/avr32/kernel/traps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
static DEFINE_SPINLOCK(die_lock);
2626

27-
void NORET_TYPE die(const char *str, struct pt_regs *regs, long err)
27+
void die(const char *str, struct pt_regs *regs, long err)
2828
{
2929
static int die_counter;
3030

arch/ia64/include/asm/processor.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ struct thread_struct {
309309
}
310310

311311
#define start_thread(regs,new_ip,new_sp) do { \
312-
set_fs(USER_DS); \
313312
regs->cr_ipsr = ((regs->cr_ipsr | (IA64_PSR_BITS_TO_SET | IA64_PSR_CPL)) \
314313
& ~(IA64_PSR_BITS_TO_CLEAR | IA64_PSR_RI | IA64_PSR_IS)); \
315314
regs->cr_iip = new_ip; \

arch/ia64/kernel/machine_kexec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
#include <asm/sal.h>
2828
#include <asm/mca.h>
2929

30-
typedef NORET_TYPE void (*relocate_new_kernel_t)(
30+
typedef void (*relocate_new_kernel_t)(
3131
unsigned long indirection_page,
3232
unsigned long start_address,
3333
struct ia64_boot_param *boot_param,
34-
unsigned long pal_addr) ATTRIB_NORET;
34+
unsigned long pal_addr) __noreturn;
3535

3636
struct kimage *ia64_kimage;
3737

arch/m68k/amiga/config.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,7 @@ static unsigned long amiga_gettimeoffset(void)
511511
return ticks + offset;
512512
}
513513

514-
static NORET_TYPE void amiga_reset(void)
515-
ATTRIB_NORET;
514+
static void amiga_reset(void) __noreturn;
516515

517516
static void amiga_reset(void)
518517
{

arch/mips/include/asm/ptrace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ extern int ptrace_set_watch_regs(struct task_struct *child,
144144
extern asmlinkage void syscall_trace_enter(struct pt_regs *regs);
145145
extern asmlinkage void syscall_trace_leave(struct pt_regs *regs);
146146

147-
extern NORET_TYPE void die(const char *, struct pt_regs *) ATTRIB_NORET;
147+
extern void die(const char *, struct pt_regs *) __noreturn;
148148

149149
static inline void die_if_kernel(const char *str, struct pt_regs *regs)
150150
{

arch/mips/kernel/traps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,7 @@ void ejtag_exception_handler(struct pt_regs *regs)
13401340
/*
13411341
* NMI exception handler.
13421342
*/
1343-
NORET_TYPE void ATTRIB_NORET nmi_exception_handler(struct pt_regs *regs)
1343+
void __noreturn nmi_exception_handler(struct pt_regs *regs)
13441344
{
13451345
bust_spinlocks(1);
13461346
printk("NMI taken!!!!\n");

arch/mn10300/include/asm/exceptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ extern asmlinkage void nmi_handler(void);
110110
extern asmlinkage void misalignment(struct pt_regs *, enum exception_code);
111111

112112
extern void die(const char *, struct pt_regs *, enum exception_code)
113-
ATTRIB_NORET;
113+
__noreturn;
114114

115115
extern int die_if_no_fixup(const char *, struct pt_regs *, enum exception_code);
116116

arch/parisc/include/asm/processor.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ typedef unsigned int elf_caddr_t;
196196
/* offset pc for priv. level */ \
197197
pc |= 3; \
198198
\
199-
set_fs(USER_DS); \
200199
regs->iasq[0] = spaceid; \
201200
regs->iasq[1] = spaceid; \
202201
regs->iaoq[0] = pc; \
@@ -299,7 +298,6 @@ on downward growing arches, it looks like this:
299298
elf_addr_t pc = (elf_addr_t)new_pc | 3; \
300299
elf_caddr_t *argv = (elf_caddr_t *)bprm->exec + 1; \
301300
\
302-
set_fs(USER_DS); \
303301
regs->iasq[0] = spaceid; \
304302
regs->iasq[1] = spaceid; \
305303
regs->iaoq[0] = pc; \

arch/parisc/kernel/process.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ void flush_thread(void)
192192
/* Only needs to handle fpu stuff or perf monitors.
193193
** REVISIT: several arches implement a "lazy fpu state".
194194
*/
195-
set_fs(USER_DS);
196195
}
197196

198197
void release_thread(struct task_struct *dead_task)

arch/powerpc/kernel/machine_kexec_32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
#include <asm/hw_irq.h>
1717
#include <asm/io.h>
1818

19-
typedef NORET_TYPE void (*relocate_new_kernel_t)(
19+
typedef void (*relocate_new_kernel_t)(
2020
unsigned long indirection_page,
2121
unsigned long reboot_code_buffer,
22-
unsigned long start_address) ATTRIB_NORET;
22+
unsigned long start_address) __noreturn;
2323

2424
/*
2525
* This is a generic machine_kexec function suitable at least for

arch/powerpc/kernel/machine_kexec_64.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,9 @@ static union thread_union kexec_stack __init_task_data =
307307
struct paca_struct kexec_paca;
308308

309309
/* Our assembly helper, in kexec_stub.S */
310-
extern NORET_TYPE void kexec_sequence(void *newstack, unsigned long start,
311-
void *image, void *control,
312-
void (*clear_all)(void)) ATTRIB_NORET;
310+
extern void kexec_sequence(void *newstack, unsigned long start,
311+
void *image, void *control,
312+
void (*clear_all)(void)) __noreturn;
313313

314314
/* too late to fail here */
315315
void default_machine_kexec(struct kimage *image)

arch/powerpc/mm/numa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static int distance_lookup_table[MAX_NUMNODES][MAX_DISTANCE_REF_POINTS];
5858
* Allocate node_to_cpumask_map based on number of available nodes
5959
* Requires node_possible_map to be valid.
6060
*
61-
* Note: node_to_cpumask() is not valid until after this is done.
61+
* Note: cpumask_of_node() is not valid until after this is done.
6262
*/
6363
static void __init setup_node_to_cpumask_map(void)
6464
{

arch/powerpc/platforms/pseries/nvram.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,6 @@ static void oops_to_nvram(struct kmsg_dumper *dumper,
638638
/* These are almost always orderly shutdowns. */
639639
return;
640640
case KMSG_DUMP_OOPS:
641-
case KMSG_DUMP_KEXEC:
642641
break;
643642
case KMSG_DUMP_PANIC:
644643
panicking = true;

arch/s390/include/asm/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ static inline unsigned long __rewind_psw(psw_t psw, unsigned long ilc)
236236
/*
237237
* Function to drop a processor into disabled wait state
238238
*/
239-
static inline void ATTRIB_NORET disabled_wait(unsigned long code)
239+
static inline void __noreturn disabled_wait(unsigned long code)
240240
{
241241
unsigned long ctl_buf;
242242
psw_t dw_psw;

arch/s390/kernel/nmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct mcck_struct {
3030

3131
static DEFINE_PER_CPU(struct mcck_struct, cpu_mcck);
3232

33-
static NORET_TYPE void s390_handle_damage(char *msg)
33+
static void s390_handle_damage(char *msg)
3434
{
3535
smp_send_stop();
3636
disabled_wait((unsigned long) __builtin_return_address(0));

arch/sh/kernel/process_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void show_regs(struct pt_regs * regs)
7070
/*
7171
* Create a kernel thread
7272
*/
73-
ATTRIB_NORET void kernel_thread_helper(void *arg, int (*fn)(void *))
73+
__noreturn void kernel_thread_helper(void *arg, int (*fn)(void *))
7474
{
7575
do_exit(fn(arg));
7676
}

arch/sh/kernel/process_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ void show_regs(struct pt_regs *regs)
285285
/*
286286
* Create a kernel thread
287287
*/
288-
ATTRIB_NORET void kernel_thread_helper(void *arg, int (*fn)(void *))
288+
__noreturn void kernel_thread_helper(void *arg, int (*fn)(void *))
289289
{
290290
do_exit(fn(arg));
291291
}

arch/tile/kernel/machine_kexec.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,11 @@ static void setup_quasi_va_is_pa(void)
248248
}
249249

250250

251-
NORET_TYPE void machine_kexec(struct kimage *image)
251+
void machine_kexec(struct kimage *image)
252252
{
253253
void *reboot_code_buffer;
254-
NORET_TYPE void (*rnk)(unsigned long, void *, unsigned long)
255-
ATTRIB_NORET;
254+
void (*rnk)(unsigned long, void *, unsigned long)
255+
__noreturn;
256256

257257
/* Mask all interrupts before starting to reboot. */
258258
interrupt_mask_set_mask(~0ULL);

arch/x86/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ config X86
6060
select PERF_EVENTS
6161
select HAVE_PERF_EVENTS_NMI
6262
select ANON_INODES
63+
select HAVE_ALIGNED_STRUCT_PAGE if SLUB && !M386
64+
select HAVE_CMPXCHG_LOCAL if !M386
65+
select HAVE_CMPXCHG_DOUBLE
6366
select HAVE_ARCH_KMEMCHECK
6467
select HAVE_USER_RETURN_NOTIFIER
6568
select ARCH_BINFMT_ELF_RANDOMIZE_PIE

arch/x86/Kconfig.cpu

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,12 +309,6 @@ config X86_INTERNODE_CACHE_SHIFT
309309
config X86_CMPXCHG
310310
def_bool X86_64 || (X86_32 && !M386)
311311

312-
config CMPXCHG_LOCAL
313-
def_bool X86_64 || (X86_32 && !M386)
314-
315-
config CMPXCHG_DOUBLE
316-
def_bool y
317-
318312
config X86_L1_CACHE_SHIFT
319313
int
320314
default "7" if MPENTIUM4 || MPSC

arch/x86/mm/numa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void __cpuinit numa_clear_node(int cpu)
110110
* Allocate node_to_cpumask_map based on number of available nodes
111111
* Requires node_possible_map to be valid.
112112
*
113-
* Note: node_to_cpumask() is not valid until after this is done.
113+
* Note: cpumask_of_node() is not valid until after this is done.
114114
* (Use CONFIG_DEBUG_PER_CPU_MAPS to check this.)
115115
*/
116116
void __init setup_node_to_cpumask_map(void)

arch/x86/um/Kconfig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@ menu "UML-specific options"
66

77
menu "Host processor type and features"
88

9-
config CMPXCHG_LOCAL
10-
bool
11-
default n
12-
13-
config CMPXCHG_DOUBLE
14-
bool
15-
default n
16-
179
source "arch/x86/Kconfig.cpu"
1810

1911
endmenu

drivers/base/memory.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,22 @@ static int memory_block_change_state(struct memory_block *mem,
295295

296296
ret = memory_block_action(mem->start_section_nr, to_state);
297297

298-
if (ret)
298+
if (ret) {
299299
mem->state = from_state_req;
300-
else
301-
mem->state = to_state;
300+
goto out;
301+
}
302302

303+
mem->state = to_state;
304+
switch (mem->state) {
305+
case MEM_OFFLINE:
306+
kobject_uevent(&mem->dev.kobj, KOBJ_OFFLINE);
307+
break;
308+
case MEM_ONLINE:
309+
kobject_uevent(&mem->dev.kobj, KOBJ_ONLINE);
310+
break;
311+
default:
312+
break;
313+
}
303314
out:
304315
mutex_unlock(&mem->state_mutex);
305316
return ret;

0 commit comments

Comments
 (0)