Grr. I'm surprised this result ;-)
shrink_all_memory() finish to shrink memory successfully. but your
system still hang immediately after. I have no idea why this mysterious
occur.
I prepared next debugging patch. It added prenty debug printk. I hope
it enlighten up which path makes system hang-up.
1. apply my new patch
2. Enable following PM debug option in Kconfig
[*] Power Management support
[*] Power Management Debug Support
[*] Extra PM attributes in sysfs for low-level debugging/testing
[*] Verbose Power Management debugging
3. append following kernel boot option into grub configration file
no_console_suspend=1
3. kernel build and reboot
4. some prepare
# echo 8 > /proc/sysrq-trigger
# cd /sys/power
# echo 1 > pm_trace
# echo 0 > pm_async
5. run your test program
This is expected result because tmpfs shrink need swap-out. then
we need i/o time.
Please send me your .config and full dmesg.
Thanks many and many help us!