Commit e19941e9 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] misc fixes

- Spell Jeremy's name correctly.

- Fix compile warning in raw.c

- Do a waitqueue_active() test before waking klogd in printk.

  Not only is is negligibly faster, but the wake_up() in there causes
  deadlocks when you try to print debug info out from inside scheduler
  code.

  This patch gives a delightfully obscure way of avoiding the
  deadlock: kill off klogd.

- Fix a couple of compile warnings in the mtrr code.
parent fc1be578
...@@ -96,4 +96,7 @@ extern struct mtrr_ops * mtrr_if; ...@@ -96,4 +96,7 @@ extern struct mtrr_ops * mtrr_if;
extern unsigned int num_var_ranges; extern unsigned int num_var_ranges;
void finalize_mtrr_state(void);
void mtrr_state_warn(void);
extern char * mtrr_if_name[]; extern char * mtrr_if_name[];
...@@ -241,7 +241,7 @@ raw_read(struct file *filp, char *buf, size_t size, loff_t *offp) ...@@ -241,7 +241,7 @@ raw_read(struct file *filp, char *buf, size_t size, loff_t *offp)
static ssize_t static ssize_t
raw_write(struct file *filp, const char *buf, size_t size, loff_t *offp) raw_write(struct file *filp, const char *buf, size_t size, loff_t *offp)
{ {
struct iovec local_iov = { .iov_base = buf, .iov_len = size}; struct iovec local_iov = { .iov_base = (char *)buf, .iov_len = size};
return rw_raw_dev(WRITE, filp, &local_iov, 1, offp); return rw_raw_dev(WRITE, filp, &local_iov, 1, offp);
} }
......
...@@ -525,11 +525,11 @@ void release_console_sem(void) ...@@ -525,11 +525,11 @@ void release_console_sem(void)
{ {
unsigned long flags; unsigned long flags;
unsigned long _con_start, _log_end; unsigned long _con_start, _log_end;
unsigned long must_wake_klogd = 0; unsigned long wake_klogd = 0;
for ( ; ; ) { for ( ; ; ) {
spin_lock_irqsave(&logbuf_lock, flags); spin_lock_irqsave(&logbuf_lock, flags);
must_wake_klogd |= log_start - log_end; wake_klogd |= log_start - log_end;
if (con_start == log_end) if (con_start == log_end)
break; /* Nothing to print */ break; /* Nothing to print */
_con_start = con_start; _con_start = con_start;
...@@ -541,7 +541,7 @@ void release_console_sem(void) ...@@ -541,7 +541,7 @@ void release_console_sem(void)
console_may_schedule = 0; console_may_schedule = 0;
up(&console_sem); up(&console_sem);
spin_unlock_irqrestore(&logbuf_lock, flags); spin_unlock_irqrestore(&logbuf_lock, flags);
if (must_wake_klogd && !oops_in_progress) if (wake_klogd && !oops_in_progress && waitqueue_active(&log_wait))
wake_up_interruptible(&log_wait); wake_up_interruptible(&log_wait);
} }
......
...@@ -1092,7 +1092,7 @@ static int splitvma(struct mm_struct *mm, struct vm_area_struct *mpnt, unsigned ...@@ -1092,7 +1092,7 @@ static int splitvma(struct mm_struct *mm, struct vm_area_struct *mpnt, unsigned
/* Munmap is split into 2 main parts -- this part which finds /* Munmap is split into 2 main parts -- this part which finds
* what needs doing, and the areas themselves, which do the * what needs doing, and the areas themselves, which do the
* work. This now handles partial unmappings. * work. This now handles partial unmappings.
* Jeremy Fitzhardine <jeremy@sw.oz.au> * Jeremy Fitzhardinge <jeremy@goop.org>
*/ */
int do_munmap(struct mm_struct *mm, unsigned long start, size_t len) int do_munmap(struct mm_struct *mm, unsigned long start, size_t len)
{ {
......
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