---
title: 休止とウェイクアップ
url: https://doc.liz6.com/ja/linux-kernel/14-power-management/02-suspend-and-resume
locale: ja
area: linux-kernel
tags:
- linux-kernel
- power-management
date: 2026-06-30
modified: 2026-07-16
description: '概要: suspend-to-RAM (S3) → suspend-to-disk (S4/hibernate) → freeze (suspend-to-idle) → runtime PM → ACPI S-states → ドライバPMコールバック → デバッグ / カーネルバージョン: 2.6 ~ 6.x'
---

# 休止とウェイクアップ

> 概要: suspend-to-RAM (S3) → suspend-to-disk (S4/hibernate) → freeze (suspend-to-idle) → runtime PM → ACPI S-states → ドライバPMコールバック → デバッグ
> カーネルバージョン: 2.6 ~ 6.x

## システムの休止状態

```
suspend-to-idle (freeze / s2idle):
  ユーザープロセスのフリーズ + デバイスの低電力状態移行 + CPU idle
  → 消費電力: 中程度, ウェイクアップ: 最速 (~100ms)
  → 依存: すべてのデバイスとCPUが優れたruntime PMをサポートしていること

suspend-to-RAM (S3 / deep):
  RAMの自己刷新, CPUと大部分のデバイスの電源オフ
  → 消費電力: 低い (~1W), ウェイクアップ: ~1-2秒
  → BIOS/UEFI ACPI S3 サポートが必要

suspend-to-disk (S4 / hibernate):
  全RAM内容をスワップまたはファイルに書き出し, 全機電源オフ
  → 消費電力: 0W, ウェイクアップ: ~10-30秒 (RAM容量とディスク速度による)
  → カーネルリジューム: スワップイメージをRAMに読み込み → 実行を再開
```

## Suspend-to-RAM の詳細フロー

<svg viewBox="0 0 720 330" xmlns="http://www.w3.org/2000/svg" font-family="-apple-system,'Source Han Sans CN','Microsoft YaHei',sans-serif" role="img" aria-label="Suspend-to-RAM S3 挂起与唤醒流程">
  <defs><marker id="s3ah" markerWidth="10" markerHeight="8" refX="8" refY="3" orient="auto"><path d="M0,0 L8,3 L0,6 Z" fill="#475569"/></marker></defs>
  <rect width="720" height="330" fill="#ffffff"/>
  <text x="360" y="26" text-anchor="middle" font-size="17" font-weight="700" fill="#1f2933">Suspend-to-RAM (S3):サスペンド 4 手順 → S3 睡眠 → ウェイクアップ 4 手順</text>
  <text x="360" y="42" text-anchor="middle" font-size="11" fill="#64748b">echo mem &gt; /sys/power/state · kernel/power/suspend.c · pm_suspend()</text>

  <rect x="50" y="56" width="140" height="58" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="120" y="78" text-anchor="middle" font-size="12" font-weight="700" fill="#3730a3">① ユーザープロセスのフリーズ</text>
  <text x="120" y="96" text-anchor="middle" font-size="10.5" fill="#4f46e5">freeze_processes()</text>

  <rect x="210" y="56" width="140" height="58" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="280" y="78" text-anchor="middle" font-size="12" font-weight="700" fill="#3730a3">② デバイスのサスペンド</text>
  <text x="280" y="96" text-anchor="middle" font-size="10.5" fill="#4f46e5">dpm_suspend()</text>

  <rect x="370" y="56" width="140" height="58" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="440" y="78" text-anchor="middle" font-size="12" font-weight="700" fill="#3730a3">③ 非ブートCPUの無効化</text>
  <text x="440" y="96" text-anchor="middle" font-size="10.5" fill="#4f46e5">disable_nonboot_cpus()</text>

  <rect x="530" y="56" width="140" height="58" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="600" y="78" text-anchor="middle" font-size="12" font-weight="700" fill="#3730a3">④ syscore + S3移行</text>
  <text x="600" y="96" text-anchor="middle" font-size="10.5" fill="#4f46e5">acpi_suspend_enter()</text>

  <line x1="190" y1="85" x2="210" y2="85" stroke="#475569" stroke-width="1.6" marker-end="url(#s3ah)"/>
  <line x1="350" y1="85" x2="370" y2="85" stroke="#475569" stroke-width="1.6" marker-end="url(#s3ah)"/>
  <line x1="510" y1="85" x2="530" y2="85" stroke="#475569" stroke-width="1.6" marker-end="url(#s3ah)"/>

  <rect x="50" y="130" width="620" height="34" rx="8" fill="#e2e8f0"/>
  <text x="360" y="151" text-anchor="middle" font-size="12" font-weight="700" fill="#475569">この時点でシステムは S3 状態 —— RAMは自己刷新、CPU/デバイスは電源オフ、ウェイクアップソースを待機中</text>

  <line x1="600" y1="114" x2="600" y2="129" stroke="#475569" stroke-width="1.6" marker-end="url(#s3ah)"/>
  <line x1="120" y1="164" x2="120" y2="179" stroke="#475569" stroke-width="1.6" marker-end="url(#s3ah)"/>
  <text x="130" y="175" font-size="10" fill="#64748b">ウェイクアップトリガー: RTCアラーム / ライドカバー開 / キー入力</text>

  <rect x="50" y="180" width="140" height="58" rx="6" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="120" y="202" text-anchor="middle" font-size="12" font-weight="700" fill="#115e59">⑤ CPUリセット起動</text>
  <text x="120" y="220" text-anchor="middle" font-size="10.5" fill="#0f766e">→BIOS→resume path</text>

  <rect x="210" y="180" width="140" height="58" rx="6" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="280" y="202" text-anchor="middle" font-size="12" font-weight="700" fill="#115e59">⑥ CPU+デバイスのリジューム</text>
  <text x="280" y="220" text-anchor="middle" font-size="10.5" fill="#0f766e">逆順リジューム</text>

  <rect x="370" y="180" width="140" height="58" rx="6" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="440" y="213" text-anchor="middle" font-size="12" font-weight="700" fill="#115e59">⑦ ユーザープロセスのアンフリーズ</text>

  <rect x="530" y="180" width="140" height="58" rx="6" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="600" y="202" text-anchor="middle" font-size="12" font-weight="700" fill="#115e59">⑧ ユーザー空間に戻る</text>
  <text x="600" y="220" text-anchor="middle" font-size="10.5" fill="#0f766e">echo mem の次の行から継続</text>

  <line x1="190" y1="209" x2="210" y2="209" stroke="#475569" stroke-width="1.6" marker-end="url(#s3ah)"/>
  <line x1="350" y1="209" x2="370" y2="209" stroke="#475569" stroke-width="1.6" marker-end="url(#s3ah)"/>
  <line x1="510" y1="209" x2="530" y2="209" stroke="#475569" stroke-width="1.6" marker-end="url(#s3ah)"/>

  <rect x="50" y="256" width="620" height="58" rx="8" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="66" y="278" font-size="12.5" fill="#3730a3">全 8 手順はカーネル空間で完了します。ユーザープロセスは①のフリーズから⑦のアンフリーズまで、その間いかなるロックも保持できません。</text>
  <text x="66" y="298" font-size="12.5" fill="#3730a3">S3 中は RAM が自己刷新され、CPU/デバイスの電源がオフになり、消費電力は約 1W に低下します。ウェイクアップには約 1–2 秒かかり、BIOS/UEFI の ACPI S3 サポートに依存します。</text>
</svg>

## Hibernate (Suspend-to-Disk)

<svg viewBox="0 0 720 330" xmlns="http://www.w3.org/2000/svg" font-family="-apple-system,'Source Han Sans CN','Microsoft YaHei',sans-serif" role="img" aria-label="Suspend-to-Disk 休眠写入与恢复流程">
  <defs><marker id="hibah" markerWidth="10" markerHeight="8" refX="8" refY="3" orient="auto"><path d="M0,0 L8,3 L0,6 Z" fill="#475569"/></marker></defs>
  <rect width="720" height="330" fill="#ffffff"/>
  <text x="360" y="26" text-anchor="middle" font-size="17" font-weight="700" fill="#1f2933">Suspend-to-Disk (S4/Hibernate):ディスクへの書き出し → 電源オフ → コールドブートで読み込み</text>
  <text x="360" y="42" text-anchor="middle" font-size="11" fill="#64748b">echo disk &gt; /sys/power/state · kernel/power/hibernate.c · hibernate()</text>

  <rect x="50" y="56" width="140" height="58" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="120" y="90" text-anchor="middle" font-size="12" font-weight="700" fill="#3730a3">① プロセスとデバイスのフリーズ</text>

  <rect x="210" y="56" width="140" height="58" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="280" y="78" text-anchor="middle" font-size="12" font-weight="700" fill="#3730a3">② メモリスナップショットの作成</text>
  <text x="280" y="96" text-anchor="middle" font-size="10.5" fill="#4f46e5">物理ページを走査 → スワップに書き出し</text>

  <rect x="370" y="56" width="140" height="58" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="440" y="78" text-anchor="middle" font-size="12" font-weight="700" fill="#3730a3">③ メタデータの書き出し</text>
  <text x="440" y="96" text-anchor="middle" font-size="10.5" fill="#4f46e5">ページマッピング, カーネル状態</text>

  <rect x="530" y="56" width="140" height="58" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="600" y="78" text-anchor="middle" font-size="12" font-weight="700" fill="#3730a3">④ デバイスの再サスペンド → シャットダウン</text>
  <text x="600" y="96" text-anchor="middle" font-size="10.5" fill="#4f46e5">power off</text>

  <line x1="190" y1="85" x2="210" y2="85" stroke="#475569" stroke-width="1.6" marker-end="url(#hibah)"/>
  <line x1="350" y1="85" x2="370" y2="85" stroke="#475569" stroke-width="1.6" marker-end="url(#hibah)"/>
  <line x1="510" y1="85" x2="530" y2="85" stroke="#475569" stroke-width="1.6" marker-end="url(#hibah)"/>

  <rect x="50" y="130" width="620" height="34" rx="8" fill="#e2e8f0"/>
  <text x="360" y="151" text-anchor="middle" font-size="12" font-weight="700" fill="#475569">システムはシャットダウン済み (power off) —— 次回起動時に resume= カーネルパラメータによって読み込みがトリガーされるのを待機中</text>

  <line x1="600" y1="114" x2="600" y2="129" stroke="#475569" stroke-width="1.6" marker-end="url(#hibah)"/>
  <line x1="120" y1="164" x2="120" y2="179" stroke="#475569" stroke-width="1.6" marker-end="url(#hibah)"/>
  <text x="130" y="175" font-size="10" fill="#64748b">コールドブートでディスクから読み込み、resume path に入る</text>

  <rect x="50" y="180" width="140" height="58" rx="6" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="120" y="202" text-anchor="middle" font-size="12" font-weight="700" fill="#115e59">⑤ resume=/dev/sda2</text>
  <text x="120" y="220" text-anchor="middle" font-size="10.5" fill="#0f766e">カーネルパラメータ</text>

  <rect x="210" y="180" width="140" height="58" rx="6" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="280" y="202" text-anchor="middle" font-size="12" font-weight="700" fill="#115e59">⑥ swsusp_check()</text>
  <text x="280" y="220" text-anchor="middle" font-size="10.5" fill="#0f766e">シグネチャの読み込み</text>

  <rect x="370" y="180" width="140" height="58" rx="6" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="440" y="202" text-anchor="middle" font-size="12" font-weight="700" fill="#115e59">⑦ swsusp_read()</text>
  <text x="440" y="220" text-anchor="middle" font-size="10.5" fill="#0f766e">スナップショット → RAM</text>

  <rect x="530" y="180" width="140" height="58" rx="6" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="600" y="202" text-anchor="middle" font-size="12" font-weight="700" fill="#115e59">⑧ カーネル状態のリジューム</text>
  <text x="600" y="220" text-anchor="middle" font-size="10.5" fill="#0f766e">保存された実行ポイントへジャンプ</text>

  <line x1="190" y1="209" x2="210" y2="209" stroke="#475569" stroke-width="1.6" marker-end="url(#hibah)"/>
  <line x1="350" y1="209" x2="370" y2="209" stroke="#475569" stroke-width="1.6" marker-end="url(#hibah)"/>
  <line x1="510" y1="209" x2="530" y2="209" stroke="#475569" stroke-width="1.6" marker-end="url(#hibah)"/>

  <rect x="50" y="256" width="620" height="58" rx="8" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="66" y="278" font-size="12.5" fill="#3730a3">全RAM内容がスワップに書き出された後、システム全体の電源がオフになり、消費電力は 0W に低下します。使用中のページのみが書き出され、アイドルページやページキャッシュはスキップされます。</text>
  <text x="66" y="298" font-size="12.5" fill="#3730a3">次回起動時は resume= カーネルパラメータによって読み込みがトリガーされ、ウェイクアップには約 10–30 秒かかり、RAM容量とディスク速度に依存します。</text>
</svg>

## Runtime PM: デバイスレベルの電源管理

```c
// drivers/base/power/runtime.c
// 各デバイスは独立してサスペンド/リジューム可能 (他のデバイスやプロセスに影響を与えない)

// 自動サスペンドの条件:
//   - デバイスがアイドル状態で autosuspend_delay_ms を超過
//   - リファレンスがない (pm_runtime_get/put)
//   - ドライバが runtime_suspend/runtime_resume をサポート

// PCIe: runtime D3hot (電源オフだが PCIe リンクは維持)
// USB: 選択的サスペンド (個々のUSBデバイスをサスペンド)
```

## デバッグ

```bash
# サポートされている休止状態
cat /sys/power/state          # freeze mem disk

# サスペンド/ウェイクアップのトレース
echo 1 > /sys/power/pm_trace  # RTCハッシュを使用して障害デバイスをトレース
dmesg | grep -i "PM: suspend" # サスペンド/ウェイクアップのログ

# サスペンドをブロックしているデバインの特定
cat /sys/power/pm_wakeup_irq  # 最後のウェイクアップIRQ
dmesg | grep -i "wakeup"      # ウェイクアップソース

# サスペンド/ウェイクアップのレイテンシ分析
echo 1 > /sys/kernel/debug/tracing/events/power/suspend_resume/enable
cat trace_pipe
```

## 参考

- **ソースコード**: `kernel/power/suspend.c`, `kernel/power/hibernate.c`, `drivers/base/power/`, `drivers/acpi/sleep.c`
- **カーネルドキュメント**: `Documentation/admin-guide/pm/sleep-states.rst`, `Documentation/power/runtime_pm.rst`

*キーワード: suspend, hibernate, freeze, s2idle, S3, S4, runtime PM, pm_wakeup, ACPI*
