Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 288768
b: refs/heads/master
c: 600e145
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Mar 15, 2012
1 parent 8bd0fe7 commit 284b640
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9993bc635d01a6ee7f6b833b4ee65ce7c06350b1
refs/heads/master: 600e145882802d6ccbfe2c4aea243d97caeb91a9
40 changes: 20 additions & 20 deletions trunk/kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1222,26 +1222,6 @@ int is_console_locked(void)
static DEFINE_PER_CPU(int, printk_pending);
static DEFINE_PER_CPU(char [PRINTK_BUF_SIZE], printk_sched_buf);

int printk_sched(const char *fmt, ...)
{
unsigned long flags;
va_list args;
char *buf;
int r;

local_irq_save(flags);
buf = __get_cpu_var(printk_sched_buf);

va_start(args, fmt);
r = vsnprintf(buf, PRINTK_BUF_SIZE, fmt, args);
va_end(args);

__this_cpu_or(printk_pending, PRINTK_PENDING_SCHED);
local_irq_restore(flags);

return r;
}

void printk_tick(void)
{
if (__this_cpu_read(printk_pending)) {
Expand Down Expand Up @@ -1658,6 +1638,26 @@ late_initcall(printk_late_init);

#if defined CONFIG_PRINTK

int printk_sched(const char *fmt, ...)
{
unsigned long flags;
va_list args;
char *buf;
int r;

local_irq_save(flags);
buf = __get_cpu_var(printk_sched_buf);

va_start(args, fmt);
r = vsnprintf(buf, PRINTK_BUF_SIZE, fmt, args);
va_end(args);

__this_cpu_or(printk_pending, PRINTK_PENDING_SCHED);
local_irq_restore(flags);

return r;
}

/*
* printk rate limiting, lifted from the networking subsystem.
*
Expand Down

0 comments on commit 284b640

Please sign in to comment.