Commit cb6f8739 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'akpm' (patches from Andrew)

Merge yet more updates from Andrew Morton:
 "A few final bits:

   - large changes to vmalloc, yielding large performance benefits

   - tweak the console-flush-on-panic code

   - a few fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  panic: add an option to replay all the printk message in buffer
  initramfs: don't free a non-existent initrd
  fs/writeback.c: use rcu_barrier() to wait for inflight wb switches going into workqueue when umount
  mm/compaction.c: correct zone boundary handling when isolating pages from a pageblock
  mm/vmap: add DEBUG_AUGMENT_LOWEST_MATCH_CHECK macro
  mm/vmap: add DEBUG_AUGMENT_PROPAGATE_CHECK macro
  mm/vmalloc.c: keep track of free blocks for vmap allocation
parents ff8583d6 de6da1e8
...@@ -3212,6 +3212,7 @@ ...@@ -3212,6 +3212,7 @@
bit 2: print timer info bit 2: print timer info
bit 3: print locks info if CONFIG_LOCKDEP is on bit 3: print locks info if CONFIG_LOCKDEP is on
bit 4: print ftrace buffer bit 4: print ftrace buffer
bit 5: print all printk messages in buffer
panic_on_warn panic() instead of WARN(). Useful to cause kdump panic_on_warn panic() instead of WARN(). Useful to cause kdump
on a WARN(). on a WARN().
......
...@@ -179,7 +179,7 @@ extern void panic_flush_kmsg_end(void) ...@@ -179,7 +179,7 @@ extern void panic_flush_kmsg_end(void)
kmsg_dump(KMSG_DUMP_PANIC); kmsg_dump(KMSG_DUMP_PANIC);
bust_spinlocks(0); bust_spinlocks(0);
debug_locks_off(); debug_locks_off();
console_flush_on_panic(); console_flush_on_panic(CONSOLE_FLUSH_PENDING);
} }
static unsigned long oops_begin(struct pt_regs *regs) static unsigned long oops_begin(struct pt_regs *regs)
......
...@@ -523,8 +523,6 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id) ...@@ -523,8 +523,6 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id)
isw->inode = inode; isw->inode = inode;
atomic_inc(&isw_nr_in_flight);
/* /*
* In addition to synchronizing among switchers, I_WB_SWITCH tells * In addition to synchronizing among switchers, I_WB_SWITCH tells
* the RCU protected stat update paths to grab the i_page * the RCU protected stat update paths to grab the i_page
...@@ -532,6 +530,9 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id) ...@@ -532,6 +530,9 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id)
* Let's continue after I_WB_SWITCH is guaranteed to be visible. * Let's continue after I_WB_SWITCH is guaranteed to be visible.
*/ */
call_rcu(&isw->rcu_head, inode_switch_wbs_rcu_fn); call_rcu(&isw->rcu_head, inode_switch_wbs_rcu_fn);
atomic_inc(&isw_nr_in_flight);
goto out_unlock; goto out_unlock;
out_free: out_free:
...@@ -901,7 +902,11 @@ static void bdi_split_work_to_wbs(struct backing_dev_info *bdi, ...@@ -901,7 +902,11 @@ static void bdi_split_work_to_wbs(struct backing_dev_info *bdi,
void cgroup_writeback_umount(void) void cgroup_writeback_umount(void)
{ {
if (atomic_read(&isw_nr_in_flight)) { if (atomic_read(&isw_nr_in_flight)) {
synchronize_rcu(); /*
* Use rcu_barrier() to wait for all pending callbacks to
* ensure that all in-flight wb switches are in the workqueue.
*/
rcu_barrier();
flush_workqueue(isw_wq); flush_workqueue(isw_wq);
} }
} }
......
...@@ -166,6 +166,11 @@ struct console { ...@@ -166,6 +166,11 @@ struct console {
extern int console_set_on_cmdline; extern int console_set_on_cmdline;
extern struct console *early_console; extern struct console *early_console;
enum con_flush_mode {
CONSOLE_FLUSH_PENDING,
CONSOLE_REPLAY_ALL,
};
extern int add_preferred_console(char *name, int idx, char *options); extern int add_preferred_console(char *name, int idx, char *options);
extern void register_console(struct console *); extern void register_console(struct console *);
extern int unregister_console(struct console *); extern int unregister_console(struct console *);
...@@ -175,7 +180,7 @@ extern int console_trylock(void); ...@@ -175,7 +180,7 @@ extern int console_trylock(void);
extern void console_unlock(void); extern void console_unlock(void);
extern void console_conditional_schedule(void); extern void console_conditional_schedule(void);
extern void console_unblank(void); extern void console_unblank(void);
extern void console_flush_on_panic(void); extern void console_flush_on_panic(enum con_flush_mode mode);
extern struct tty_driver *console_device(int *); extern struct tty_driver *console_device(int *);
extern void console_stop(struct console *); extern void console_stop(struct console *);
extern void console_start(struct console *); extern void console_start(struct console *);
......
...@@ -50,12 +50,16 @@ struct vm_struct { ...@@ -50,12 +50,16 @@ struct vm_struct {
struct vmap_area { struct vmap_area {
unsigned long va_start; unsigned long va_start;
unsigned long va_end; unsigned long va_end;
/*
* Largest available free size in subtree.
*/
unsigned long subtree_max_size;
unsigned long flags; unsigned long flags;
struct rb_node rb_node; /* address sorted rbtree */ struct rb_node rb_node; /* address sorted rbtree */
struct list_head list; /* address sorted list */ struct list_head list; /* address sorted list */
struct llist_node purge_list; /* "lazy purge" list */ struct llist_node purge_list; /* "lazy purge" list */
struct vm_struct *vm; struct vm_struct *vm;
struct rcu_head rcu_head;
}; };
/* /*
......
...@@ -669,7 +669,7 @@ static int __init populate_rootfs(void) ...@@ -669,7 +669,7 @@ static int __init populate_rootfs(void)
* If the initrd region is overlapped with crashkernel reserved region, * If the initrd region is overlapped with crashkernel reserved region,
* free only memory that is not part of crashkernel region. * free only memory that is not part of crashkernel region.
*/ */
if (!do_retain_initrd && !kexec_free_initrd()) if (!do_retain_initrd && initrd_start && !kexec_free_initrd())
free_initrd_mem(initrd_start, initrd_end); free_initrd_mem(initrd_start, initrd_end);
initrd_start = 0; initrd_start = 0;
initrd_end = 0; initrd_end = 0;
......
...@@ -51,6 +51,7 @@ EXPORT_SYMBOL_GPL(panic_timeout); ...@@ -51,6 +51,7 @@ EXPORT_SYMBOL_GPL(panic_timeout);
#define PANIC_PRINT_TIMER_INFO 0x00000004 #define PANIC_PRINT_TIMER_INFO 0x00000004
#define PANIC_PRINT_LOCK_INFO 0x00000008 #define PANIC_PRINT_LOCK_INFO 0x00000008
#define PANIC_PRINT_FTRACE_INFO 0x00000010 #define PANIC_PRINT_FTRACE_INFO 0x00000010
#define PANIC_PRINT_ALL_PRINTK_MSG 0x00000020
unsigned long panic_print; unsigned long panic_print;
ATOMIC_NOTIFIER_HEAD(panic_notifier_list); ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
...@@ -134,6 +135,9 @@ EXPORT_SYMBOL(nmi_panic); ...@@ -134,6 +135,9 @@ EXPORT_SYMBOL(nmi_panic);
static void panic_print_sys_info(void) static void panic_print_sys_info(void)
{ {
if (panic_print & PANIC_PRINT_ALL_PRINTK_MSG)
console_flush_on_panic(CONSOLE_REPLAY_ALL);
if (panic_print & PANIC_PRINT_TASK_INFO) if (panic_print & PANIC_PRINT_TASK_INFO)
show_state(); show_state();
...@@ -277,7 +281,7 @@ void panic(const char *fmt, ...) ...@@ -277,7 +281,7 @@ void panic(const char *fmt, ...)
* panic() is not being callled from OOPS. * panic() is not being callled from OOPS.
*/ */
debug_locks_off(); debug_locks_off();
console_flush_on_panic(); console_flush_on_panic(CONSOLE_FLUSH_PENDING);
panic_print_sys_info(); panic_print_sys_info();
......
...@@ -2535,10 +2535,11 @@ void console_unblank(void) ...@@ -2535,10 +2535,11 @@ void console_unblank(void)
/** /**
* console_flush_on_panic - flush console content on panic * console_flush_on_panic - flush console content on panic
* @mode: flush all messages in buffer or just the pending ones
* *
* Immediately output all pending messages no matter what. * Immediately output all pending messages no matter what.
*/ */
void console_flush_on_panic(void) void console_flush_on_panic(enum con_flush_mode mode)
{ {
/* /*
* If someone else is holding the console lock, trylock will fail * If someone else is holding the console lock, trylock will fail
...@@ -2549,6 +2550,15 @@ void console_flush_on_panic(void) ...@@ -2549,6 +2550,15 @@ void console_flush_on_panic(void)
*/ */
console_trylock(); console_trylock();
console_may_schedule = 0; console_may_schedule = 0;
if (mode == CONSOLE_REPLAY_ALL) {
unsigned long flags;
logbuf_lock_irqsave(flags);
console_seq = log_first_seq;
console_idx = log_first_idx;
logbuf_unlock_irqrestore(flags);
}
console_unlock(); console_unlock();
} }
......
...@@ -1230,7 +1230,7 @@ fast_isolate_around(struct compact_control *cc, unsigned long pfn, unsigned long ...@@ -1230,7 +1230,7 @@ fast_isolate_around(struct compact_control *cc, unsigned long pfn, unsigned long
/* Pageblock boundaries */ /* Pageblock boundaries */
start_pfn = pageblock_start_pfn(pfn); start_pfn = pageblock_start_pfn(pfn);
end_pfn = min(start_pfn + pageblock_nr_pages, zone_end_pfn(cc->zone)); end_pfn = min(pageblock_end_pfn(pfn), zone_end_pfn(cc->zone)) - 1;
/* Scan before */ /* Scan before */
if (start_pfn != pfn) { if (start_pfn != pfn) {
...@@ -1241,7 +1241,7 @@ fast_isolate_around(struct compact_control *cc, unsigned long pfn, unsigned long ...@@ -1241,7 +1241,7 @@ fast_isolate_around(struct compact_control *cc, unsigned long pfn, unsigned long
/* Scan after */ /* Scan after */
start_pfn = pfn + nr_isolated; start_pfn = pfn + nr_isolated;
if (start_pfn != end_pfn) if (start_pfn < end_pfn)
isolate_freepages_block(cc, &start_pfn, end_pfn, &cc->freepages, 1, false); isolate_freepages_block(cc, &start_pfn, end_pfn, &cc->freepages, 1, false);
/* Skip this pageblock in the future as it's full or nearly full */ /* Skip this pageblock in the future as it's full or nearly full */
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment