Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260433
b: refs/heads/master
c: beda94d
h: refs/heads/master
i:
  260431: 30fc3a3
v: v3
  • Loading branch information
Dmitry Torokhov authored and Linus Torvalds committed Jul 26, 2011
1 parent bc8fdb8 commit cb2eba2
Show file tree
Hide file tree
Showing 2 changed files with 12 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: f7b1371eb6b3ff72e38de220663b22f7cc9df296
refs/heads/master: beda94da38d2a3bf7f40c01f0a8e6d86067c91cc
31 changes: 11 additions & 20 deletions trunk/drivers/misc/vmw_balloon.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

MODULE_AUTHOR("VMware, Inc.");
MODULE_DESCRIPTION("VMware Memory Control (Balloon) Driver");
MODULE_VERSION("1.2.1.2-k");
MODULE_VERSION("1.2.1.3-k");
MODULE_ALIAS("dmi:*:svnVMware*:*");
MODULE_ALIAS("vmware_vmmemctl");
MODULE_LICENSE("GPL");
Expand Down Expand Up @@ -215,7 +215,6 @@ struct vmballoon {
};

static struct vmballoon balloon;
static struct workqueue_struct *vmballoon_wq;

/*
* Send "start" command to the host, communicating supported version
Expand Down Expand Up @@ -674,7 +673,12 @@ static void vmballoon_work(struct work_struct *work)
vmballoon_deflate(b);
}

queue_delayed_work(vmballoon_wq, dwork, round_jiffies_relative(HZ));
/*
* We are using a freezable workqueue so that balloon operations are
* stopped while the system transitions to/from sleep/hibernation.
*/
queue_delayed_work(system_freezable_wq,
dwork, round_jiffies_relative(HZ));
}

/*
Expand Down Expand Up @@ -785,12 +789,6 @@ static int __init vmballoon_init(void)
if (x86_hyper != &x86_hyper_vmware)
return -ENODEV;

vmballoon_wq = create_freezable_workqueue("vmmemctl");
if (!vmballoon_wq) {
pr_err("failed to create workqueue\n");
return -ENOMEM;
}

INIT_LIST_HEAD(&balloon.pages);
INIT_LIST_HEAD(&balloon.refused_pages);

Expand All @@ -805,34 +803,27 @@ static int __init vmballoon_init(void)
*/
if (!vmballoon_send_start(&balloon)) {
pr_err("failed to send start command to the host\n");
error = -EIO;
goto fail;
return -EIO;
}

if (!vmballoon_send_guest_id(&balloon)) {
pr_err("failed to send guest ID to the host\n");
error = -EIO;
goto fail;
return -EIO;
}

error = vmballoon_debugfs_init(&balloon);
if (error)
goto fail;
return error;

queue_delayed_work(vmballoon_wq, &balloon.dwork, 0);
queue_delayed_work(system_freezable_wq, &balloon.dwork, 0);

return 0;

fail:
destroy_workqueue(vmballoon_wq);
return error;
}
module_init(vmballoon_init);

static void __exit vmballoon_exit(void)
{
cancel_delayed_work_sync(&balloon.dwork);
destroy_workqueue(vmballoon_wq);

vmballoon_debugfs_exit(&balloon);

Expand Down

0 comments on commit cb2eba2

Please sign in to comment.