diff options
author | 2014-07-11 03:06:08 +0000 | |
---|---|---|
committer | 2014-07-11 03:06:08 +0000 | |
commit | 22433bb623a7904d32a0d85497158f6a3f6bc2bb (patch) | |
tree | 09471f1e7e23a214635006c7eb8879b6736006d2 /sys/dev/acpi/acpi.c | |
parent | Fix dumb copy/paste mistake. (diff) | |
download | wireguard-openbsd-22433bb623a7904d32a0d85497158f6a3f6bc2bb.tar.xz wireguard-openbsd-22433bb623a7904d32a0d85497158f6a3f6bc2bb.zip |
Flush the buffercache to 16MB on hibernate and restore its previous max
size (kern.bufcachepercent) on resume, for better hibernate performance.
ok beck@
Diffstat (limited to 'sys/dev/acpi/acpi.c')
-rw-r--r-- | sys/dev/acpi/acpi.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index b74cb27c529..a561faaadee 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.261 2014/07/10 13:52:15 blambert Exp $ */ +/* $OpenBSD: acpi.c,v 1.262 2014/07/11 03:06:08 mlarkin Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -2116,6 +2116,11 @@ acpi_sleep_state(struct acpi_softc *sc, int state) if (config_suspend(mainbus, DVACT_QUIESCE)) goto fail_quiesce; +#ifdef HIBERNATE + if (state == ACPI_STATE_S4) + hibernate_suspend_bufcache(); +#endif /* HIBERNATE */ + bufq_quiesce(); #ifdef MULTIPROCESSOR @@ -2193,6 +2198,7 @@ fail_quiesce: if (state == ACPI_STATE_S4) { hibernate_free(); uvm_pmr_dirty_everything(); + hibernate_resume_bufcache(); } #endif /* HIBERNATE */ |