An error occurred while fetching folder content.
PM / hibernate: Fix rtree_next_node() to avoid walking off list ends
James Morse authored
commit 924d8696 upstream.

rtree_next_node() walks the linked list of leaf nodes to find the next
block of pages in the struct memory_bitmap. If it walks off the end of
the list of nodes, it walks the list of memory zones to find the next
region of memory. If it walks off the end of the list of zones, it
returns false.

This leaves the struct bm_position's node and zone pointers pointing
at their respective struct list_heads in struct mem_zone_bm_rtree.

memory_bm_find_bit() uses struct bm_position's node and zone pointers
to avoid walking lists and trees if the next bit appears in the same
node/zone. It handles these values being stale.

Swap rtree_next_node()s 'step then test' to 'test-next then step',
this means if we reach the end of memory we return false and leave
the node and zone pointers as they were.

This fixes a panic on resume using AMD Seattle with 64K pages:
[    6.868732] Freezing user spac...
116fcd88
Name Last commit Last update
..
bpf bpf, inode: disallow userns mounts
configs kconfig: tinyconfig: provide whole choice blocks to avoid warnings
debug debug: prevent entering debug mode on panic/exception.
events uprobes: Fix the memcg accounting
gcov gcov: add support for GCC 5.1
irq genirq/msi: Fix broken debug output
livepatch livepatch: x86: fix relocation computation with kASLR
locking locking/qspinlock: Fix spin_unlock_wait() some more
power PM / hibernate: Fix rtree_next_node() to avoid walking off list ends
printk printk: do cond_resched() between lines while outputting to consoles
rcu Merge branches 'doc.2015.10.06a', 'percpu-rwsem.2015.10.06a' and 'torture.2015.10.06a' into HEAD
sched sched/core: Fix a race between try_to_wake_up() and a woken up task
time timekeeping: Avoid taking lock in NMI path with CONFIG_DEBUG_TIMEKEEPING
trace tracing: Move mutex to protect against resetting of seq data
.gitignore certs: add .gitignore to stop git nagging about x509_certificate_list
Kconfig.freezer container freezer: implement freezer cgroup subsystem
Kconfig.hz kernel: remove CONFIG_USE_GENERIC_SMP_HELPERS
Kconfig.locks locking/qrwlock: Rename QUEUE_RWLOCK to QUEUED_RWLOCKS
Kconfig.preempt locking/kconfig: Simplify INLINE_SPIN_UNLOCK usage
Makefile sys_membarrier(): system-wide memory barrier (generic, x86)
acct.c acct: check FMODE_CAN_WRITE
async.c kernel/async.c: switch to pr_foo()
audit.c mm, page_alloc: distinguish between being unable to sleep, unwilling to sleep and avoiding waking kswapd
audit.h audit: audit_tree_match can be boolean
audit_fsnotify.c audit: clean simple fsnotify implementation
audit_tree.c audit: audit_tree_match can be boolean
audit_watch.c audit: fix exe_file access in audit_exe_compare
auditfilter.c audit: fix comment block whitespace
auditsc.c audit: fix a double fetch in audit_log_single_execve_arg()
backtracetest.c kernel/backtracetest.c: replace no level printk by pr_info()
bounds.c page-cgroup: get rid of NR_PCG_FLAGS
capability.c kernel: Add noaudit variant of ns_capable()
cgroup.c cgroup: set css->id to -1 during init
cgroup_freezer.c cgroup: fix handling of multi-destination migration from subtree_control enabling
cgroup_pids.c cgroup_pids: don't account for the root cgroup
compat.c compat: cleanup coding in compat_get_bitmap() and compat_put_bitmap()
configs.c proc: Supply PDE attribute setting accessor functions
context_tracking.c context_tracking: avoid irq_save/irq_restore on guest entry and exit
cpu.c Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
cpu_pm.c kernel/cpu_pm: fix cpu_cluster_pm_exit comment
cpuset.c Fix build warning in kernel/cpuset.c
crash_dump.c crash_dump: Make is_kdump_kernel() accessible from modules
cred.c cred: Reject inodes with invalid ids in set_create_file_as()
delayacct.c delayacct: Remove braindamaged type conversions
dma.c Remove all #inclusions of asm/system.h
elfcore.c switch elf_core_write_extra_phdrs() to dump_emit()
exec_domain.c Remove rest of exec domains.
exit.c wait/ptrace: assume __WALL if the child is traced
extable.c kernel/extable.c: remove duplicated include
fork.c mm: introduce get_task_exe_file
freezer.c
futex.c
futex_compat.c
groups.c
hung_task.c
irq_work.c
jump_label.c
kallsyms.c
kcmp.c
kexec.c
kexec_core.c
kexec_file.c
kexec_internal.h
kmod.c
kprobes.c
ksysfs.c
kthread.c
latencytop.c
membarrier.c
memremap.c
module-internal.h
module.c
module_signing.c
notifier.c
nsproxy.c
padata.c
panic.c
params.c
pid.c
pid_namespace.c
profile.c
ptrace.c
range.c
reboot.c
relay.c
resource.c
seccomp.c
signal.c
smp.c
smpboot.c
smpboot.h
softirq.c
stacktrace.c
stop_machine.c
sys.c
sys_ni.c
sysctl.c
sysctl_binary.c
task_work.c
taskstats.c