Skip to content

Commit

Permalink
Merge branch 'for-2.6.39' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/tj/wq

* 'for-2.6.39' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
  workqueue: fix build failure introduced by s/freezeable/freezable/
  workqueue: add system_freezeable_wq
  rds/ib: use system_wq instead of rds_ib_fmr_wq
  net/9p: replace p9_poll_task with a work
  net/9p: use system_wq instead of p9_mux_wq
  xfs: convert to alloc_workqueue()
  reiserfs: make commit_wq use the default concurrency level
  ocfs2: use system_wq instead of ocfs2_quota_wq
  ext4: convert to alloc_workqueue()
  scsi/scsi_tgt_lib: scsi_tgtd isn't used in memory reclaim path
  scsi/be2iscsi,qla2xxx: convert to alloc_workqueue()
  misc/iwmc3200top: use system_wq instead of dedicated workqueues
  i2o: use alloc_workqueue() instead of create_workqueue()
  acpi: kacpi*_wq don't need WQ_MEM_RECLAIM
  fs/aio: aio_wq isn't used in memory reclaim path
  input/tps6507x-ts: use system_wq instead of dedicated workqueue
  cpufreq: use system_wq instead of dedicated workqueues
  wireless/ipw2x00: use system_wq instead of dedicated workqueues
  arm/omap: use system_wq in mailbox
  workqueue: use WQ_MEM_RECLAIM instead of WQ_RESCUER
  • Loading branch information
torvalds committed Mar 16, 2011
2 parents 016aa2e + 24d51ad commit bd2895e
Show file tree
Hide file tree
Showing 32 changed files with 190 additions and 339 deletions.
10 changes: 2 additions & 8 deletions arch/arm/plat-omap/mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

#include <plat/mailbox.h>

static struct workqueue_struct *mboxd;
static struct omap_mbox **mboxes;

static int mbox_configured;
Expand Down Expand Up @@ -197,7 +196,7 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
/* no more messages in the fifo. clear IRQ source. */
ack_mbox_irq(mbox, IRQ_RX);
nomem:
queue_work(mboxd, &mbox->rxq->work);
schedule_work(&mbox->rxq->work);
}

static irqreturn_t mbox_interrupt(int irq, void *p)
Expand Down Expand Up @@ -307,7 +306,7 @@ static void omap_mbox_fini(struct omap_mbox *mbox)
if (!--mbox->use_count) {
free_irq(mbox->irq, mbox);
tasklet_kill(&mbox->txq->tasklet);
flush_work(&mbox->rxq->work);
flush_work_sync(&mbox->rxq->work);
mbox_queue_free(mbox->txq);
mbox_queue_free(mbox->rxq);
}
Expand Down Expand Up @@ -409,10 +408,6 @@ static int __init omap_mbox_init(void)
if (err)
return err;

mboxd = create_workqueue("mboxd");
if (!mboxd)
return -ENOMEM;

/* kfifo size sanity check: alignment and minimal size */
mbox_kfifo_size = ALIGN(mbox_kfifo_size, sizeof(mbox_msg_t));
mbox_kfifo_size = max_t(unsigned int, mbox_kfifo_size,
Expand All @@ -424,7 +419,6 @@ subsys_initcall(omap_mbox_init);

static void __exit omap_mbox_exit(void)
{
destroy_workqueue(mboxd);
class_unregister(&omap_mbox_class);
}
module_exit(omap_mbox_exit);
Expand Down
6 changes: 3 additions & 3 deletions drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1589,9 +1589,9 @@ acpi_status __init acpi_os_initialize(void)

acpi_status __init acpi_os_initialize1(void)
{
kacpid_wq = create_workqueue("kacpid");
kacpi_notify_wq = create_workqueue("kacpi_notify");
kacpi_hotplug_wq = create_workqueue("kacpi_hotplug");
kacpid_wq = alloc_workqueue("kacpid", 0, 1);
kacpi_notify_wq = alloc_workqueue("kacpi_notify", 0, 1);
kacpi_hotplug_wq = alloc_workqueue("kacpi_hotplug", 0, 1);
BUG_ON(!kacpid_wq);
BUG_ON(!kacpi_notify_wq);
BUG_ON(!kacpi_hotplug_wq);
Expand Down
22 changes: 3 additions & 19 deletions drivers/cpufreq/cpufreq_conservative.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */
*/
static DEFINE_MUTEX(dbs_mutex);

static struct workqueue_struct *kconservative_wq;

static struct dbs_tuners {
unsigned int sampling_rate;
unsigned int sampling_down_factor;
Expand Down Expand Up @@ -560,7 +558,7 @@ static void do_dbs_timer(struct work_struct *work)

dbs_check_cpu(dbs_info);

queue_delayed_work_on(cpu, kconservative_wq, &dbs_info->work, delay);
schedule_delayed_work_on(cpu, &dbs_info->work, delay);
mutex_unlock(&dbs_info->timer_mutex);
}

Expand All @@ -572,8 +570,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)

dbs_info->enable = 1;
INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer);
queue_delayed_work_on(dbs_info->cpu, kconservative_wq, &dbs_info->work,
delay);
schedule_delayed_work_on(dbs_info->cpu, &dbs_info->work, delay);
}

static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info)
Expand Down Expand Up @@ -716,25 +713,12 @@ struct cpufreq_governor cpufreq_gov_conservative = {

static int __init cpufreq_gov_dbs_init(void)
{
int err;

kconservative_wq = create_workqueue("kconservative");
if (!kconservative_wq) {
printk(KERN_ERR "Creation of kconservative failed\n");
return -EFAULT;
}

err = cpufreq_register_governor(&cpufreq_gov_conservative);
if (err)
destroy_workqueue(kconservative_wq);

return err;
return cpufreq_register_governor(&cpufreq_gov_conservative);
}

static void __exit cpufreq_gov_dbs_exit(void)
{
cpufreq_unregister_governor(&cpufreq_gov_conservative);
destroy_workqueue(kconservative_wq);
}


Expand Down
20 changes: 3 additions & 17 deletions drivers/cpufreq/cpufreq_ondemand.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */
*/
static DEFINE_MUTEX(dbs_mutex);

static struct workqueue_struct *kondemand_wq;

static struct dbs_tuners {
unsigned int sampling_rate;
unsigned int up_threshold;
Expand Down Expand Up @@ -667,7 +665,7 @@ static void do_dbs_timer(struct work_struct *work)
__cpufreq_driver_target(dbs_info->cur_policy,
dbs_info->freq_lo, CPUFREQ_RELATION_H);
}
queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, delay);
schedule_delayed_work_on(cpu, &dbs_info->work, delay);
mutex_unlock(&dbs_info->timer_mutex);
}

Expand All @@ -681,8 +679,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)

dbs_info->sample_type = DBS_NORMAL_SAMPLE;
INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer);
queue_delayed_work_on(dbs_info->cpu, kondemand_wq, &dbs_info->work,
delay);
schedule_delayed_work_on(dbs_info->cpu, &dbs_info->work, delay);
}

static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info)
Expand Down Expand Up @@ -814,7 +811,6 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,

static int __init cpufreq_gov_dbs_init(void)
{
int err;
cputime64_t wall;
u64 idle_time;
int cpu = get_cpu();
Expand All @@ -838,22 +834,12 @@ static int __init cpufreq_gov_dbs_init(void)
MIN_SAMPLING_RATE_RATIO * jiffies_to_usecs(10);
}

kondemand_wq = create_workqueue("kondemand");
if (!kondemand_wq) {
printk(KERN_ERR "Creation of kondemand failed\n");
return -EFAULT;
}
err = cpufreq_register_governor(&cpufreq_gov_ondemand);
if (err)
destroy_workqueue(kondemand_wq);

return err;
return cpufreq_register_governor(&cpufreq_gov_ondemand);
}

static void __exit cpufreq_gov_dbs_exit(void)
{
cpufreq_unregister_governor(&cpufreq_gov_ondemand);
destroy_workqueue(kondemand_wq);
}


Expand Down
12 changes: 4 additions & 8 deletions drivers/input/touchscreen/tps6507x-ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ struct tps6507x_ts {
struct input_dev *input_dev;
struct device *dev;
char phys[32];
struct workqueue_struct *wq;
struct delayed_work work;
unsigned polling; /* polling is active */
struct ts_event tc;
Expand Down Expand Up @@ -220,8 +219,8 @@ static void tps6507x_ts_handler(struct work_struct *work)
poll = 1;

if (poll) {
schd = queue_delayed_work(tsc->wq, &tsc->work,
msecs_to_jiffies(tsc->poll_period));
schd = schedule_delayed_work(&tsc->work,
msecs_to_jiffies(tsc->poll_period));
if (schd)
tsc->polling = 1;
else {
Expand Down Expand Up @@ -303,7 +302,6 @@ static int tps6507x_ts_probe(struct platform_device *pdev)
tsc->input_dev = input_dev;

INIT_DELAYED_WORK(&tsc->work, tps6507x_ts_handler);
tsc->wq = create_workqueue("TPS6507x Touchscreen");

if (init_data) {
tsc->poll_period = init_data->poll_period;
Expand All @@ -325,8 +323,8 @@ static int tps6507x_ts_probe(struct platform_device *pdev)
if (error)
goto err2;

schd = queue_delayed_work(tsc->wq, &tsc->work,
msecs_to_jiffies(tsc->poll_period));
schd = schedule_delayed_work(&tsc->work,
msecs_to_jiffies(tsc->poll_period));

if (schd)
tsc->polling = 1;
Expand All @@ -341,7 +339,6 @@ static int tps6507x_ts_probe(struct platform_device *pdev)

err2:
cancel_delayed_work_sync(&tsc->work);
destroy_workqueue(tsc->wq);
input_free_device(input_dev);
err1:
kfree(tsc);
Expand All @@ -357,7 +354,6 @@ static int __devexit tps6507x_ts_remove(struct platform_device *pdev)
struct input_dev *input_dev = tsc->input_dev;

cancel_delayed_work_sync(&tsc->work);
destroy_workqueue(tsc->wq);

input_unregister_device(input_dev);

Expand Down
2 changes: 1 addition & 1 deletion drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -7361,7 +7361,7 @@ static int __init md_init(void)
{
int ret = -ENOMEM;

md_wq = alloc_workqueue("md", WQ_RESCUER, 0);
md_wq = alloc_workqueue("md", WQ_MEM_RECLAIM, 0);
if (!md_wq)
goto err_wq;

Expand Down
3 changes: 2 additions & 1 deletion drivers/message/i2o/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ int i2o_driver_register(struct i2o_driver *drv)
osm_debug("Register driver %s\n", drv->name);

if (drv->event) {
drv->event_queue = create_workqueue(drv->name);
drv->event_queue = alloc_workqueue(drv->name,
WQ_MEM_RECLAIM, 1);
if (!drv->event_queue) {
osm_err("Could not initialize event queue for driver "
"%s\n", drv->name);
Expand Down
4 changes: 1 addition & 3 deletions drivers/misc/iwmc3200top/iwmc3200top.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,7 @@ struct iwmct_priv {
u32 barker;
struct iwmct_dbg dbg;

/* drivers work queue */
struct workqueue_struct *wq;
struct workqueue_struct *bus_rescan_wq;
/* drivers work items */
struct work_struct bus_rescan_worker;
struct work_struct isr_worker;

Expand Down
14 changes: 5 additions & 9 deletions drivers/misc/iwmc3200top/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static void op_top_message(struct iwmct_priv *priv, struct top_msg *msg)
switch (msg->hdr.opcode) {
case OP_OPR_ALIVE:
LOG_INFO(priv, FW_MSG, "Got ALIVE from device, wake rescan\n");
queue_work(priv->bus_rescan_wq, &priv->bus_rescan_worker);
schedule_work(&priv->bus_rescan_worker);
break;
default:
LOG_INFO(priv, FW_MSG, "Received msg opcode 0x%X\n",
Expand Down Expand Up @@ -360,7 +360,7 @@ static void iwmct_irq(struct sdio_func *func)
/* clear the function's interrupt request bit (write 1 to clear) */
sdio_writeb(func, 1, IWMC_SDIO_INTR_CLEAR_ADDR, &ret);

queue_work(priv->wq, &priv->isr_worker);
schedule_work(&priv->isr_worker);

LOG_TRACE(priv, IRQ, "exit iwmct_irq\n");

Expand Down Expand Up @@ -506,10 +506,6 @@ static int iwmct_probe(struct sdio_func *func,
priv->func = func;
sdio_set_drvdata(func, priv);


/* create drivers work queue */
priv->wq = create_workqueue(DRV_NAME "_wq");
priv->bus_rescan_wq = create_workqueue(DRV_NAME "_rescan_wq");
INIT_WORK(&priv->bus_rescan_worker, iwmct_rescan_worker);
INIT_WORK(&priv->isr_worker, iwmct_irq_read_worker);

Expand Down Expand Up @@ -604,9 +600,9 @@ static void iwmct_remove(struct sdio_func *func)
sdio_release_irq(func);
sdio_release_host(func);

/* Safely destroy osc workqueue */
destroy_workqueue(priv->bus_rescan_wq);
destroy_workqueue(priv->wq);
/* Make sure works are finished */
flush_work_sync(&priv->bus_rescan_worker);
flush_work_sync(&priv->isr_worker);

sdio_claim_host(func);
sdio_disable_func(func);
Expand Down
Loading

0 comments on commit bd2895e

Please sign in to comment.