# suspend to disk: "not enough free swap"

## peter4

I have a 1GB swap partition and about 500-600 MB of RAM currently in use. When I try to suspend to disk, the screen goes blank and after about a minute the system goes back up. After that gkrellm shows ~350 MB of RAM and ~700 MB of swap used. After I do a swapoff and swapon, it returns to the initial ~500MB RAM usage. dmesg shows something like this:

```
[18358.967586] PM: Marking nosave pages: 000000000009e000 - 0000000000100000

[18358.967592] PM: Marking nosave pages: 000000007d6a1000 - 000000007d6a7000

[18358.967594] PM: Marking nosave pages: 000000007d7bd000 - 000000007d80f000

[18358.967598] PM: Marking nosave pages: 000000007d908000 - 000000007db0f000

[18358.967611] PM: Marking nosave pages: 000000007db19000 - 000000007db1f000

[18358.967613] PM: Basic memory bitmaps created

[18358.967614] PM: Syncing filesystems ... done.

[18359.229301] Freezing user space processes ... (elapsed 0.00 seconds) done.

[18359.230127] Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.

[18359.230197] PM: Preallocating image memory... done (allocated 382048 pages)

[18369.663373] PM: Allocated 1528192 kbytes in 10.43 seconds (146.51 MB/s)

[18369.663376] Suspending console(s) (use no_console_suspend to debug)

[18369.864037] sd 0:0:0:0: [sda] Synchronizing SCSI cache

[18369.930419] ACPI handle has no context!

[18369.930586] ath9k 0000:02:00.0: PCI INT A disabled

[18369.941055] pci 0000:00:1f.3: PCI INT C disabled

[18370.086163] HDA Intel 0000:00:1b.0: PCI INT A disabled

[18370.109370] ACPI: Preparing to enter system sleep state S4

[18370.113420] PM: Saving platform NVS memory

[18370.116566] Disabling non-boot CPUs ...

[18370.118803] CPU 1 is now offline

[18370.118805] SMP alternatives: switching to UP code

[18370.122639] CPU1 is down

[18370.122688] Extended CMOS year: 2000

[18370.122773] PM: Creating hibernation image:

[18370.123005] PM: Need to copy 123747 pages

[18370.123005] PM: Normal pages needed: 123747 + 1024, available pages: 390408

[18370.123005] PM: Hibernation image created (123747 pages copied)

[18370.123005] CPU0: Thermal LVT vector (0xfa) already installed

[18370.123005] Extended CMOS year: 2000

[18370.123005] Enabling non-boot CPUs ...

[18370.124114] SMP alternatives: switching to SMP code

[18370.127591] Booting processor 1 APIC 0x1 ip 0x6000

[18370.122406] Initializing CPU#1

[18370.122406] Calibrating delay using timer specific routine.. 4186.42 BogoMIPS (lpj=2093210)

[18370.122406] CPU: L1 I cache: 32K, L1 D cache: 32K

[18370.122406] CPU: L2 cache: 1024K

[18370.122406] CPU: Physical Processor ID: 0

[18370.122406] CPU: Processor Core ID: 1

[18370.122406] CPU1: Thermal monitoring enabled (TM2)

[18370.198048] CPU1: Intel Pentium(R) Dual-Core CPU       T4300  @ 2.10GHz stepping 0a

[18370.200270] CPU1 is up

[18370.200581] ACPI: Waking up from system sleep state S4

[18370.416969] PM: Device PNP0C0D:00 failed to thaw: error 1

[18370.421197] i915 0000:00:02.0: setting latency timer to 64

[18370.754391] [drm] LVDS-8: set mode 1366x768 23

[18371.146090] HDA Intel 0000:00:1b.0: restoring config space at offset 0xf (was 0x100, writing 0x105)

[18371.146111] HDA Intel 0000:00:1b.0: restoring config space at offset 0x3 (was 0x0, writing 0x10)

[18371.146117] HDA Intel 0000:00:1b.0: restoring config space at offset 0x1 (was 0x100000, writing 0x100002)

[18371.146138] HDA Intel 0000:00:1b.0: PCI INT A -> GSI 22 (level, low) -> IRQ 22

[18371.146144] HDA Intel 0000:00:1b.0: setting latency timer to 64

[18371.202332] pci 0000:00:1e.0: setting latency timer to 64

[18371.202402] ahci 0000:00:1f.2: restoring config space at offset 0x1 (was 0x2b00403, writing 0x2b00407)

[18371.202457] ahci 0000:00:1f.2: setting latency timer to 64

[18371.202580] pci 0000:00:1f.3: PCI INT C -> GSI 19 (level, low) -> IRQ 19

[18371.203050] ath9k 0000:02:00.0: restoring config space at offset 0x1 (was 0x100003, writing 0x100007)

[18371.214073] ath9k 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16

[18371.240115] r8169: eth0: link down

[18371.301108] sd 0:0:0:0: [sda] Starting disk

[18371.507084] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[18371.509042] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

[18371.511040] ata6: SATA link down (SStatus 0 SControl 300)

[18371.511479] ata2.00: configured for UDMA/100

[18371.513044] ata5: SATA link down (SStatus 0 SControl 300)

[18371.554692] ata1.00: configured for UDMA/133

[18371.566908] PM: writing image.

[18371.566922] PM: Free swap pages: 56452

[18371.566924] PM: Not enough free swap

[18371.642766] Restarting tasks ... done.

[18371.647896] PM: Basic memory bitmaps freed

[18389.348036] r8169: eth0: link down

[18389.513204] [drm] TV-20: set mode NTSC 480i 0

[18389.654435] [drm] TV-20: set mode NTSC 480i 0

[18392.996367] ath9k: Two wiphys trying to scan at the same time

[18393.313429] wlan0: deauthenticating from 00:22:6b:ef:98:1c by local choice (reason=3)

[18393.521383] wlan0: direct probe to AP 00:22:6b:ef:98:1c (try 1)

[18393.525322] wlan0: direct probe responded

[18393.525325] wlan0: authenticate with AP 00:22:6b:ef:98:1c (try 1)

[18393.529110] wlan0: authenticated

[18393.529128] wlan0: associate with AP 00:22:6b:ef:98:1c (try 1)

[18393.534479] wlan0: RX AssocResp from 00:22:6b:ef:98:1c (capab=0x431 status=0 aid=7)

[18393.534482] wlan0: associated

```

Why does it say "PM: Not enough free swap" when I have almost double the amount of needed space?

----------

## cwr

Well, it says it wants ~1.5G of space, and on the whole I'd believe it.  Why?

That I don't know.

Will

----------

