Merge branch 'perf/urgent' into perf/core
Merge reason: Pick up updates before queueing up dependent patches. Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
@ -3,6 +3,12 @@
|
||||
*/
|
||||
#include <linux/irqdesc.h>
|
||||
|
||||
#ifdef CONFIG_SPARSE_IRQ
|
||||
# define IRQ_BITMAP_BITS (NR_IRQS + 8196)
|
||||
#else
|
||||
# define IRQ_BITMAP_BITS NR_IRQS
|
||||
#endif
|
||||
|
||||
extern int noirqdebug;
|
||||
|
||||
#define irq_data_to_desc(data) container_of(data, struct irq_desc, irq_data)
|
||||
|
@ -94,7 +94,7 @@ int nr_irqs = NR_IRQS;
|
||||
EXPORT_SYMBOL_GPL(nr_irqs);
|
||||
|
||||
static DEFINE_MUTEX(sparse_irq_lock);
|
||||
static DECLARE_BITMAP(allocated_irqs, NR_IRQS);
|
||||
static DECLARE_BITMAP(allocated_irqs, IRQ_BITMAP_BITS);
|
||||
|
||||
#ifdef CONFIG_SPARSE_IRQ
|
||||
|
||||
@ -217,6 +217,15 @@ int __init early_irq_init(void)
|
||||
initcnt = arch_probe_nr_irqs();
|
||||
printk(KERN_INFO "NR_IRQS:%d nr_irqs:%d %d\n", NR_IRQS, nr_irqs, initcnt);
|
||||
|
||||
if (WARN_ON(nr_irqs > IRQ_BITMAP_BITS))
|
||||
nr_irqs = IRQ_BITMAP_BITS;
|
||||
|
||||
if (WARN_ON(initcnt > IRQ_BITMAP_BITS))
|
||||
initcnt = IRQ_BITMAP_BITS;
|
||||
|
||||
if (initcnt > nr_irqs)
|
||||
nr_irqs = initcnt;
|
||||
|
||||
for (i = 0; i < initcnt; i++) {
|
||||
desc = alloc_desc(i, node);
|
||||
set_bit(i, allocated_irqs);
|
||||
|
@ -1100,7 +1100,7 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler,
|
||||
if (retval)
|
||||
kfree(action);
|
||||
|
||||
#ifdef CONFIG_DEBUG_SHIRQ
|
||||
#ifdef CONFIG_DEBUG_SHIRQ_FIXME
|
||||
if (!retval && (irqflags & IRQF_SHARED)) {
|
||||
/*
|
||||
* It's a shared IRQ -- the driver ought to be prepared for it
|
||||
|
@ -23,7 +23,7 @@
|
||||
#ifdef CONFIG_HARDIRQS_SW_RESEND
|
||||
|
||||
/* Bitmap to handle software resend of interrupts: */
|
||||
static DECLARE_BITMAP(irqs_resend, NR_IRQS);
|
||||
static DECLARE_BITMAP(irqs_resend, IRQ_BITMAP_BITS);
|
||||
|
||||
/*
|
||||
* Run software resends of IRQ's
|
||||
|
@ -326,7 +326,7 @@ EXPORT_SYMBOL_GPL(pm_wq);
|
||||
|
||||
static int __init pm_start_workqueue(void)
|
||||
{
|
||||
pm_wq = alloc_workqueue("pm", WQ_FREEZEABLE, 0);
|
||||
pm_wq = alloc_workqueue("pm", WQ_FREEZABLE, 0);
|
||||
|
||||
return pm_wq ? 0 : -ENOMEM;
|
||||
}
|
||||
|
@ -22,7 +22,7 @@
|
||||
*/
|
||||
#define TIMEOUT (20 * HZ)
|
||||
|
||||
static inline int freezeable(struct task_struct * p)
|
||||
static inline int freezable(struct task_struct * p)
|
||||
{
|
||||
if ((p == current) ||
|
||||
(p->flags & PF_NOFREEZE) ||
|
||||
@ -53,7 +53,7 @@ static int try_to_freeze_tasks(bool sig_only)
|
||||
todo = 0;
|
||||
read_lock(&tasklist_lock);
|
||||
do_each_thread(g, p) {
|
||||
if (frozen(p) || !freezeable(p))
|
||||
if (frozen(p) || !freezable(p))
|
||||
continue;
|
||||
|
||||
if (!freeze_task(p, sig_only))
|
||||
@ -167,7 +167,7 @@ static void thaw_tasks(bool nosig_only)
|
||||
|
||||
read_lock(&tasklist_lock);
|
||||
do_each_thread(g, p) {
|
||||
if (!freezeable(p))
|
||||
if (!freezable(p))
|
||||
continue;
|
||||
|
||||
if (nosig_only && should_send_signal(p))
|
||||
|
@ -1519,11 +1519,8 @@ static int
|
||||
swsusp_alloc(struct memory_bitmap *orig_bm, struct memory_bitmap *copy_bm,
|
||||
unsigned int nr_pages, unsigned int nr_highmem)
|
||||
{
|
||||
int error = 0;
|
||||
|
||||
if (nr_highmem > 0) {
|
||||
error = get_highmem_buffer(PG_ANY);
|
||||
if (error)
|
||||
if (get_highmem_buffer(PG_ANY))
|
||||
goto err_out;
|
||||
if (nr_highmem > alloc_highmem) {
|
||||
nr_highmem -= alloc_highmem;
|
||||
@ -1546,7 +1543,7 @@ swsusp_alloc(struct memory_bitmap *orig_bm, struct memory_bitmap *copy_bm,
|
||||
|
||||
err_out:
|
||||
swsusp_free();
|
||||
return error;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
asmlinkage int swsusp_save(void)
|
||||
|
@ -79,7 +79,9 @@ enum {
|
||||
MAX_IDLE_WORKERS_RATIO = 4, /* 1/4 of busy can be idle */
|
||||
IDLE_WORKER_TIMEOUT = 300 * HZ, /* keep idle ones for 5 mins */
|
||||
|
||||
MAYDAY_INITIAL_TIMEOUT = HZ / 100, /* call for help after 10ms */
|
||||
MAYDAY_INITIAL_TIMEOUT = HZ / 100 >= 2 ? HZ / 100 : 2,
|
||||
/* call for help after 10ms
|
||||
(min two ticks) */
|
||||
MAYDAY_INTERVAL = HZ / 10, /* and then every 100ms */
|
||||
CREATE_COOLDOWN = HZ, /* time to breath after fail */
|
||||
TRUSTEE_COOLDOWN = HZ / 10, /* for trustee draining */
|
||||
@ -2047,6 +2049,15 @@ repeat:
|
||||
move_linked_works(work, scheduled, &n);
|
||||
|
||||
process_scheduled_works(rescuer);
|
||||
|
||||
/*
|
||||
* Leave this gcwq. If keep_working() is %true, notify a
|
||||
* regular worker; otherwise, we end up with 0 concurrency
|
||||
* and stalling the execution.
|
||||
*/
|
||||
if (keep_working(gcwq))
|
||||
wake_up_worker(gcwq);
|
||||
|
||||
spin_unlock_irq(&gcwq->lock);
|
||||
}
|
||||
|
||||
@ -2956,7 +2967,7 @@ struct workqueue_struct *__alloc_workqueue_key(const char *name,
|
||||
*/
|
||||
spin_lock(&workqueue_lock);
|
||||
|
||||
if (workqueue_freezing && wq->flags & WQ_FREEZEABLE)
|
||||
if (workqueue_freezing && wq->flags & WQ_FREEZABLE)
|
||||
for_each_cwq_cpu(cpu, wq)
|
||||
get_cwq(cpu, wq)->max_active = 0;
|
||||
|
||||
@ -3068,7 +3079,7 @@ void workqueue_set_max_active(struct workqueue_struct *wq, int max_active)
|
||||
|
||||
spin_lock_irq(&gcwq->lock);
|
||||
|
||||
if (!(wq->flags & WQ_FREEZEABLE) ||
|
||||
if (!(wq->flags & WQ_FREEZABLE) ||
|
||||
!(gcwq->flags & GCWQ_FREEZING))
|
||||
get_cwq(gcwq->cpu, wq)->max_active = max_active;
|
||||
|
||||
@ -3318,7 +3329,7 @@ static int __cpuinit trustee_thread(void *__gcwq)
|
||||
* want to get it over with ASAP - spam rescuers, wake up as
|
||||
* many idlers as necessary and create new ones till the
|
||||
* worklist is empty. Note that if the gcwq is frozen, there
|
||||
* may be frozen works in freezeable cwqs. Don't declare
|
||||
* may be frozen works in freezable cwqs. Don't declare
|
||||
* completion while frozen.
|
||||
*/
|
||||
while (gcwq->nr_workers != gcwq->nr_idle ||
|
||||
@ -3576,9 +3587,9 @@ EXPORT_SYMBOL_GPL(work_on_cpu);
|
||||
/**
|
||||
* freeze_workqueues_begin - begin freezing workqueues
|
||||
*
|
||||
* Start freezing workqueues. After this function returns, all
|
||||
* freezeable workqueues will queue new works to their frozen_works
|
||||
* list instead of gcwq->worklist.
|
||||
* Start freezing workqueues. After this function returns, all freezable
|
||||
* workqueues will queue new works to their frozen_works list instead of
|
||||
* gcwq->worklist.
|
||||
*
|
||||
* CONTEXT:
|
||||
* Grabs and releases workqueue_lock and gcwq->lock's.
|
||||
@ -3604,7 +3615,7 @@ void freeze_workqueues_begin(void)
|
||||
list_for_each_entry(wq, &workqueues, list) {
|
||||
struct cpu_workqueue_struct *cwq = get_cwq(cpu, wq);
|
||||
|
||||
if (cwq && wq->flags & WQ_FREEZEABLE)
|
||||
if (cwq && wq->flags & WQ_FREEZABLE)
|
||||
cwq->max_active = 0;
|
||||
}
|
||||
|
||||
@ -3615,7 +3626,7 @@ void freeze_workqueues_begin(void)
|
||||
}
|
||||
|
||||
/**
|
||||
* freeze_workqueues_busy - are freezeable workqueues still busy?
|
||||
* freeze_workqueues_busy - are freezable workqueues still busy?
|
||||
*
|
||||
* Check whether freezing is complete. This function must be called
|
||||
* between freeze_workqueues_begin() and thaw_workqueues().
|
||||
@ -3624,8 +3635,8 @@ void freeze_workqueues_begin(void)
|
||||
* Grabs and releases workqueue_lock.
|
||||
*
|
||||
* RETURNS:
|
||||
* %true if some freezeable workqueues are still busy. %false if
|
||||
* freezing is complete.
|
||||
* %true if some freezable workqueues are still busy. %false if freezing
|
||||
* is complete.
|
||||
*/
|
||||
bool freeze_workqueues_busy(void)
|
||||
{
|
||||
@ -3645,7 +3656,7 @@ bool freeze_workqueues_busy(void)
|
||||
list_for_each_entry(wq, &workqueues, list) {
|
||||
struct cpu_workqueue_struct *cwq = get_cwq(cpu, wq);
|
||||
|
||||
if (!cwq || !(wq->flags & WQ_FREEZEABLE))
|
||||
if (!cwq || !(wq->flags & WQ_FREEZABLE))
|
||||
continue;
|
||||
|
||||
BUG_ON(cwq->nr_active < 0);
|
||||
@ -3690,7 +3701,7 @@ void thaw_workqueues(void)
|
||||
list_for_each_entry(wq, &workqueues, list) {
|
||||
struct cpu_workqueue_struct *cwq = get_cwq(cpu, wq);
|
||||
|
||||
if (!cwq || !(wq->flags & WQ_FREEZEABLE))
|
||||
if (!cwq || !(wq->flags & WQ_FREEZABLE))
|
||||
continue;
|
||||
|
||||
/* restore max_active and repopulate worklist */
|
||||
|
Reference in New Issue
Block a user