Skip to content

Commit

Permalink
Merge branch 'akpm' (aka "Andrew's patch-bomb, take two")
Browse files Browse the repository at this point in the history
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
  ...
  • Loading branch information
torvalds committed Jan 13, 2012
2 parents 7c17d86 + 35f1526 commit 0994695
Show file tree
Hide file tree
Showing 100 changed files with 2,589 additions and 1,562 deletions.
4 changes: 4 additions & 0 deletions Documentation/ABI/testing/sysfs-kernel-slab
Expand Up @@ -346,6 +346,10 @@ Description:
number of objects per slab. If a slab cannot be allocated
because of fragmentation, SLUB will retry with the minimum order
possible depending on its characteristics.
When debug_guardpage_minorder=N (N > 0) parameter is specified
(see Documentation/kernel-parameters.txt), the minimum possible
order is used and this sysfs entry can not be used to change
the order at run time.

What: /sys/kernel/slab/cache/order_fallback
Date: April 2008
Expand Down
9 changes: 6 additions & 3 deletions Documentation/cgroups/memory.txt
Expand Up @@ -61,7 +61,7 @@ Brief summary of control files.
memory.failcnt # show the number of memory usage hits limits
memory.memsw.failcnt # show the number of memory+Swap hits limits
memory.max_usage_in_bytes # show max memory usage recorded
memory.memsw.usage_in_bytes # show max memory+Swap usage recorded
memory.memsw.max_usage_in_bytes # show max memory+Swap usage recorded
memory.soft_limit_in_bytes # set/show soft limit of memory usage
memory.stat # show various statistics
memory.use_hierarchy # set/show hierarchical account enabled
Expand Down Expand Up @@ -410,8 +410,11 @@ memory.stat file includes following statistics
cache - # of bytes of page cache memory.
rss - # of bytes of anonymous and swap cache memory.
mapped_file - # of bytes of mapped file (includes tmpfs/shmem)
pgpgin - # of pages paged in (equivalent to # of charging events).
pgpgout - # of pages paged out (equivalent to # of uncharging events).
pgpgin - # of charging events to the memory cgroup. The charging
event happens each time a page is accounted as either mapped
anon page(RSS) or cache page(Page Cache) to the cgroup.
pgpgout - # of uncharging events to the memory cgroup. The uncharging
event happens each time a page is unaccounted from the cgroup.
swap - # of bytes of swap usage
inactive_anon - # of bytes of anonymous memory and swap cache memory on
LRU list.
Expand Down
3 changes: 3 additions & 0 deletions Documentation/filesystems/proc.txt
Expand Up @@ -307,6 +307,9 @@ Table 1-4: Contents of the stat files (as of 2.6.30-rc7)
blkio_ticks time spent waiting for block IO
gtime guest time of the task in jiffies
cgtime guest time of the task children in jiffies
start_data address above which program data+bss is placed
end_data address below which program data+bss is placed
start_brk address above which program heap can be expanded with brk()
..............................................................................

The /proc/PID/maps file containing the currently mapped memory regions and
Expand Down
8 changes: 8 additions & 0 deletions Documentation/sysctl/kernel.txt
Expand Up @@ -415,6 +415,14 @@ PIDs of value pid_max or larger are not allocated.

==============================================================

ns_last_pid:

The last pid allocated in the current (the one task using this sysctl
lives in) pid namespace. When selecting a pid for a next task on fork
kernel tries to allocate a number starting from this one.

==============================================================

powersave-nap: (PPC only)

If set, Linux-PPC will use the 'nap' mode of powersaving,
Expand Down
5 changes: 4 additions & 1 deletion Documentation/vm/slub.txt
Expand Up @@ -131,7 +131,10 @@ slub_min_objects.
slub_max_order specified the order at which slub_min_objects should no
longer be checked. This is useful to avoid SLUB trying to generate
super large order pages to fit slub_min_objects of a slab cache with
large object sizes into one high order page.
large object sizes into one high order page. Setting command line
parameter debug_guardpage_minorder=N (N > 0), forces setting
slub_max_order to 0, what cause minimum possible order of slabs
allocation.

SLUB Debug output
-----------------
Expand Down
14 changes: 14 additions & 0 deletions arch/Kconfig
Expand Up @@ -185,4 +185,18 @@ config HAVE_RCU_TABLE_FREE
config ARCH_HAVE_NMI_SAFE_CMPXCHG
bool

config HAVE_ALIGNED_STRUCT_PAGE
bool
help
This makes sure that struct pages are double word aligned and that
e.g. the SLUB allocator can perform double word atomic operations
on a struct page for better performance. However selecting this
might increase the size of a struct page by a word.

config HAVE_CMPXCHG_LOCAL
bool

config HAVE_CMPXCHG_DOUBLE
bool

source "kernel/gcov/Kconfig"
2 changes: 1 addition & 1 deletion arch/avr32/include/asm/system.h
Expand Up @@ -169,7 +169,7 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr,
#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))

struct pt_regs;
void NORET_TYPE die(const char *str, struct pt_regs *regs, long err);
void die(const char *str, struct pt_regs *regs, long err);
void _exception(long signr, struct pt_regs *regs, int code,
unsigned long addr);

Expand Down
2 changes: 1 addition & 1 deletion arch/avr32/kernel/traps.c
Expand Up @@ -24,7 +24,7 @@

static DEFINE_SPINLOCK(die_lock);

void NORET_TYPE die(const char *str, struct pt_regs *regs, long err)
void die(const char *str, struct pt_regs *regs, long err)
{
static int die_counter;

Expand Down
1 change: 0 additions & 1 deletion arch/ia64/include/asm/processor.h
Expand Up @@ -309,7 +309,6 @@ struct thread_struct {
}

#define start_thread(regs,new_ip,new_sp) do { \
set_fs(USER_DS); \
regs->cr_ipsr = ((regs->cr_ipsr | (IA64_PSR_BITS_TO_SET | IA64_PSR_CPL)) \
& ~(IA64_PSR_BITS_TO_CLEAR | IA64_PSR_RI | IA64_PSR_IS)); \
regs->cr_iip = new_ip; \
Expand Down
4 changes: 2 additions & 2 deletions arch/ia64/kernel/machine_kexec.c
Expand Up @@ -27,11 +27,11 @@
#include <asm/sal.h>
#include <asm/mca.h>

typedef NORET_TYPE void (*relocate_new_kernel_t)(
typedef void (*relocate_new_kernel_t)(
unsigned long indirection_page,
unsigned long start_address,
struct ia64_boot_param *boot_param,
unsigned long pal_addr) ATTRIB_NORET;
unsigned long pal_addr) __noreturn;

struct kimage *ia64_kimage;

Expand Down
3 changes: 1 addition & 2 deletions arch/m68k/amiga/config.c
Expand Up @@ -511,8 +511,7 @@ static unsigned long amiga_gettimeoffset(void)
return ticks + offset;
}

static NORET_TYPE void amiga_reset(void)
ATTRIB_NORET;
static void amiga_reset(void) __noreturn;

static void amiga_reset(void)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/include/asm/ptrace.h
Expand Up @@ -144,7 +144,7 @@ extern int ptrace_set_watch_regs(struct task_struct *child,
extern asmlinkage void syscall_trace_enter(struct pt_regs *regs);
extern asmlinkage void syscall_trace_leave(struct pt_regs *regs);

extern NORET_TYPE void die(const char *, struct pt_regs *) ATTRIB_NORET;
extern void die(const char *, struct pt_regs *) __noreturn;

static inline void die_if_kernel(const char *str, struct pt_regs *regs)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/traps.c
Expand Up @@ -1340,7 +1340,7 @@ void ejtag_exception_handler(struct pt_regs *regs)
/*
* NMI exception handler.
*/
NORET_TYPE void ATTRIB_NORET nmi_exception_handler(struct pt_regs *regs)
void __noreturn nmi_exception_handler(struct pt_regs *regs)
{
bust_spinlocks(1);
printk("NMI taken!!!!\n");
Expand Down
2 changes: 1 addition & 1 deletion arch/mn10300/include/asm/exceptions.h
Expand Up @@ -110,7 +110,7 @@ extern asmlinkage void nmi_handler(void);
extern asmlinkage void misalignment(struct pt_regs *, enum exception_code);

extern void die(const char *, struct pt_regs *, enum exception_code)
ATTRIB_NORET;
__noreturn;

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

Expand Down
2 changes: 0 additions & 2 deletions arch/parisc/include/asm/processor.h
Expand Up @@ -196,7 +196,6 @@ typedef unsigned int elf_caddr_t;
/* offset pc for priv. level */ \
pc |= 3; \
\
set_fs(USER_DS); \
regs->iasq[0] = spaceid; \
regs->iasq[1] = spaceid; \
regs->iaoq[0] = pc; \
Expand Down Expand Up @@ -299,7 +298,6 @@ on downward growing arches, it looks like this:
elf_addr_t pc = (elf_addr_t)new_pc | 3; \
elf_caddr_t *argv = (elf_caddr_t *)bprm->exec + 1; \
\
set_fs(USER_DS); \
regs->iasq[0] = spaceid; \
regs->iasq[1] = spaceid; \
regs->iaoq[0] = pc; \
Expand Down
1 change: 0 additions & 1 deletion arch/parisc/kernel/process.c
Expand Up @@ -192,7 +192,6 @@ void flush_thread(void)
/* Only needs to handle fpu stuff or perf monitors.
** REVISIT: several arches implement a "lazy fpu state".
*/
set_fs(USER_DS);
}

void release_thread(struct task_struct *dead_task)
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/kernel/machine_kexec_32.c
Expand Up @@ -16,10 +16,10 @@
#include <asm/hw_irq.h>
#include <asm/io.h>

typedef NORET_TYPE void (*relocate_new_kernel_t)(
typedef void (*relocate_new_kernel_t)(
unsigned long indirection_page,
unsigned long reboot_code_buffer,
unsigned long start_address) ATTRIB_NORET;
unsigned long start_address) __noreturn;

/*
* This is a generic machine_kexec function suitable at least for
Expand Down
6 changes: 3 additions & 3 deletions arch/powerpc/kernel/machine_kexec_64.c
Expand Up @@ -307,9 +307,9 @@ static union thread_union kexec_stack __init_task_data =
struct paca_struct kexec_paca;

/* Our assembly helper, in kexec_stub.S */
extern NORET_TYPE void kexec_sequence(void *newstack, unsigned long start,
void *image, void *control,
void (*clear_all)(void)) ATTRIB_NORET;
extern void kexec_sequence(void *newstack, unsigned long start,
void *image, void *control,
void (*clear_all)(void)) __noreturn;

/* too late to fail here */
void default_machine_kexec(struct kimage *image)
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/mm/numa.c
Expand Up @@ -58,7 +58,7 @@ static int distance_lookup_table[MAX_NUMNODES][MAX_DISTANCE_REF_POINTS];
* Allocate node_to_cpumask_map based on number of available nodes
* Requires node_possible_map to be valid.
*
* Note: node_to_cpumask() is not valid until after this is done.
* Note: cpumask_of_node() is not valid until after this is done.
*/
static void __init setup_node_to_cpumask_map(void)
{
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/platforms/pseries/nvram.c
Expand Up @@ -638,7 +638,6 @@ static void oops_to_nvram(struct kmsg_dumper *dumper,
/* These are almost always orderly shutdowns. */
return;
case KMSG_DUMP_OOPS:
case KMSG_DUMP_KEXEC:
break;
case KMSG_DUMP_PANIC:
panicking = true;
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/include/asm/processor.h
Expand Up @@ -236,7 +236,7 @@ static inline unsigned long __rewind_psw(psw_t psw, unsigned long ilc)
/*
* Function to drop a processor into disabled wait state
*/
static inline void ATTRIB_NORET disabled_wait(unsigned long code)
static inline void __noreturn disabled_wait(unsigned long code)
{
unsigned long ctl_buf;
psw_t dw_psw;
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/kernel/nmi.c
Expand Up @@ -30,7 +30,7 @@ struct mcck_struct {

static DEFINE_PER_CPU(struct mcck_struct, cpu_mcck);

static NORET_TYPE void s390_handle_damage(char *msg)
static void s390_handle_damage(char *msg)
{
smp_send_stop();
disabled_wait((unsigned long) __builtin_return_address(0));
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/kernel/process_32.c
Expand Up @@ -70,7 +70,7 @@ void show_regs(struct pt_regs * regs)
/*
* Create a kernel thread
*/
ATTRIB_NORET void kernel_thread_helper(void *arg, int (*fn)(void *))
__noreturn void kernel_thread_helper(void *arg, int (*fn)(void *))
{
do_exit(fn(arg));
}
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/kernel/process_64.c
Expand Up @@ -285,7 +285,7 @@ void show_regs(struct pt_regs *regs)
/*
* Create a kernel thread
*/
ATTRIB_NORET void kernel_thread_helper(void *arg, int (*fn)(void *))
__noreturn void kernel_thread_helper(void *arg, int (*fn)(void *))
{
do_exit(fn(arg));
}
Expand Down
6 changes: 3 additions & 3 deletions arch/tile/kernel/machine_kexec.c
Expand Up @@ -248,11 +248,11 @@ static void setup_quasi_va_is_pa(void)
}


NORET_TYPE void machine_kexec(struct kimage *image)
void machine_kexec(struct kimage *image)
{
void *reboot_code_buffer;
NORET_TYPE void (*rnk)(unsigned long, void *, unsigned long)
ATTRIB_NORET;
void (*rnk)(unsigned long, void *, unsigned long)
__noreturn;

/* Mask all interrupts before starting to reboot. */
interrupt_mask_set_mask(~0ULL);
Expand Down
3 changes: 3 additions & 0 deletions arch/x86/Kconfig
Expand Up @@ -60,6 +60,9 @@ config X86
select PERF_EVENTS
select HAVE_PERF_EVENTS_NMI
select ANON_INODES
select HAVE_ALIGNED_STRUCT_PAGE if SLUB && !M386
select HAVE_CMPXCHG_LOCAL if !M386
select HAVE_CMPXCHG_DOUBLE
select HAVE_ARCH_KMEMCHECK
select HAVE_USER_RETURN_NOTIFIER
select ARCH_BINFMT_ELF_RANDOMIZE_PIE
Expand Down
6 changes: 0 additions & 6 deletions arch/x86/Kconfig.cpu
Expand Up @@ -309,12 +309,6 @@ config X86_INTERNODE_CACHE_SHIFT
config X86_CMPXCHG
def_bool X86_64 || (X86_32 && !M386)

config CMPXCHG_LOCAL
def_bool X86_64 || (X86_32 && !M386)

config CMPXCHG_DOUBLE
def_bool y

config X86_L1_CACHE_SHIFT
int
default "7" if MPENTIUM4 || MPSC
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/mm/numa.c
Expand Up @@ -110,7 +110,7 @@ void __cpuinit numa_clear_node(int cpu)
* Allocate node_to_cpumask_map based on number of available nodes
* Requires node_possible_map to be valid.
*
* Note: node_to_cpumask() is not valid until after this is done.
* Note: cpumask_of_node() is not valid until after this is done.
* (Use CONFIG_DEBUG_PER_CPU_MAPS to check this.)
*/
void __init setup_node_to_cpumask_map(void)
Expand Down
8 changes: 0 additions & 8 deletions arch/x86/um/Kconfig
Expand Up @@ -6,14 +6,6 @@ menu "UML-specific options"

menu "Host processor type and features"

config CMPXCHG_LOCAL
bool
default n

config CMPXCHG_DOUBLE
bool
default n

source "arch/x86/Kconfig.cpu"

endmenu
Expand Down
17 changes: 14 additions & 3 deletions drivers/base/memory.c
Expand Up @@ -295,11 +295,22 @@ static int memory_block_change_state(struct memory_block *mem,

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

if (ret)
if (ret) {
mem->state = from_state_req;
else
mem->state = to_state;
goto out;
}

mem->state = to_state;
switch (mem->state) {
case MEM_OFFLINE:
kobject_uevent(&mem->dev.kobj, KOBJ_OFFLINE);
break;
case MEM_ONLINE:
kobject_uevent(&mem->dev.kobj, KOBJ_ONLINE);
break;
default:
break;
}
out:
mutex_unlock(&mem->state_mutex);
return ret;
Expand Down

0 comments on commit 0994695

Please sign in to comment.