timochan

timochan

Stupid S0 Sleep - Modern Standby

Preface#

Recently, I purchased the Armor Knight RC 20 (referred to as RC 20 below) as my main hard drive because the built-in hard drive in my laptop is too small (512 GiB) and no longer sufficient for my needs. After all, it's more comfortable to have a larger partition for dual systems.

Discovery of the Problem#

Excitedly, I replaced the RC 20 and installed the Windows system. Opening Diskinfo, it showed that the power-on count was 49 times, with 30 GiB written and 33 GiB read. I was pleasantly surprised because I was worried that it might be a second-hand disk since I bought it from PDD. It seemed normal to me that the read and write speeds were only 30 GiB. So, I proceeded to install Manjaro Linux. After completing the installation and migrating the data, I discovered something strange. When I performed a soft restart in Windows, meaning clicking on "Restart" within Windows, the RC 20 would always disconnect during the next startup. This left me feeling puzzled. Afterwards, I searched the Lenovo community and found that there were quite a few people with the same symptoms.

For example:

As you can see, it seems that I'm not the only one with this problem. Of course, my BIOS was not the latest version at the time, so I planned to upgrade the BIOS with the RC 20. However, things were not that simple. After going through the normal process and restarting, it prompted "firmware image not found!" Of course, the word "firmware" caught my attention. Could there be proprietary firmware? Then I entered the Windows system, went to Device Manager - Firmware, and found that there were only two firmware on this hard drive. Afterwards, when I switched back to the old hard drive, there were actually three firmware!!! One of them was the firmware for the Micron hard drive, but mine is not an OEM disk! Naturally, it doesn't have this exclusive hard drive firmware.

image

image

At this point, I actually had a preliminary understanding of the main cause of the problem, which is this proprietary firmware. The RC 20 doesn't have it, after all, it is an SSD for consumers, not OEMs.

But actually, the problem is not that big, right? It's just that Windows can't be used for restarts. After all, I don't use Windows much, just for gaming, so it's not a big problem.

Deepening of the Problem#

As a busy person, I'm used to putting my laptop to sleep instead of shutting it down directly, because who wants to open their laptop and open ten or more software or windows?

But at this point, a problem arises. In the Windows system, prolonged sleep causes the wireless network card driver to disconnect, and Windows must be restarted to reconnect. Actually, this is not a big problem, since my main system is not Windows, it's fine as long as it works normally in Linux. But sleep in Linux is not normal!!! No matter how long the sleep is, the network card will disconnect and cannot be restarted. Then I thought, let's not sleep, let's just hibernate. But even in hibernation, the network card still disconnects, and power management becomes abnormal. This did not happen with the original hard drive. I was completely puzzled. I couldn't figure out the reason.

Root Cause#

After seeing Linus complaining about Windows' modern standby, I realized that it was caused by the stupid S0 sleep - modern standby feature!!!

Initially, Microsoft added S0 sleep to Windows in order to log in to mobile devices. This sleep mode behaves as follows: after entering sleep, the CPU continues to perform small tasks, the network remains connected, and Bluetooth remains connected, making your device like a smartphone. This is different from my understanding of sleep. After consulting the information, I realized that the sleep mode I am familiar with is S3 sleep, which suspends to memory after entering sleep. However, my motherboard does not support switching sleep modes.

You can check what sleep modes your computer supports using the following command (Windows):

powercfg /a

If you see the following content:

image

Congratulations, you have the "noble" S0 sleep.

If you see the following content:

image

Congratulations, you have the "ordinary" S3 sleep.

Of course, on some models, you can enable S3 sleep through the BIOS; however, mine does not support it.

So why did this problem occur?

After detailed research, it was found that Intel promoted the development of S0 sleep. (Tianpai notebooks (Windows) are not included, as they were locked early on)

Originally, Windows only treated S0 as an optional sleep mode, which could be disabled by users. However, Intel introduced the "Project Athena" later known as "EVO certification". One of the requirements for EVO certification is that the device must be able to wake up quickly, so OEM manufacturers started using S0 sleep to implement this feature. This also applies to AMD versions, as the personal PC market is already saturated, and OEM manufacturers only need to support AMD processors in the BIOS. Therefore, S0 sleep is still used. And because of the saturation of the market, OEM manufacturers do not allow switching to S3 sleep. If you forcibly use S3 sleep, there is a high probability of sleep death and other issues.

Ironically, both Ryzen and 12/13th generation Core processors support S3 sleep, but it is only the BIOS provided by OEM manufacturers that does not support it. Of course, in order to implement this feature, AMD versions have added OEM firmware to the hard drive. One reason is that upgrading the BIOS requires it, and the other reason is this annoying S0 sleep.

Of course, the goal of S0 sleep is promising. When the system is idle, it performs small tasks, receives messages, and updates, making the user unaware that Windows is always up to date. It also has the fastest wake-up speed and maintains an internet connection, meaning that instant messaging software can still receive messages in the background. When you turn on your computer and enter work mode, you don't have to wait for message synchronization. However, this is an ideal state; in reality, when you put your fully charged laptop to sleep overnight, it's still warm in the morning, but the battery level is already very low and not enough to support your work in the morning, so you have to find a charger. This kind of experience is quite annoying.

Problem Resolution#

For me, what I need is normal sleep + expanded hard drive capacity, so I chose to purchase a hard drive enclosure. The one I purchased this time is the Green Union M.2 Nvme / SATA dual-protocol hard drive enclosure. JD link, of course, PDD might be cheaper.

For the RC 20, it has its own independent DRAM as a cache, which means it doesn't need to borrow a portion of the memory from the host as a cache. The performance loss when installed in the enclosure is not significant. Of course, if your hard drive doesn't have independent DRAM and uses the HMB (Host Memory Buffer) scheme, it means it needs to borrow a portion of the memory from the host as a cache. However, when you install it in the enclosure, you cannot borrow memory through the PCIE channel (except for Thunderbolt enclosures).

Therefore, for this type of hard drive, it is best to have independent DRAM as a cache, and it is even better if the ratio is 1:1000 (MiB). For example, a 1 TiB hard drive equipped with 1 GiB of DRAM cache.

So the original hard drive continues to be the main hard drive, and the RC 20 is installed in the enclosure as the secondary drive for Windows. Only 80 GiB is allocated to the Windows system on the main drive.

The specific results are as follows:

Internal of the host:

image

Internal of the enclosure:

image

Conclusion#

In this era of OEM manufacturers being lazy, who will force manufacturers to make efforts and promote the popularity of hardware like Microsoft did in the past? Windows Vista completed its mission in that era, greatly reducing the price of computer hardware and making it popular. But in this era, who will be the one to do it? Maybe there will be, maybe there won't be. Maybe when domestic competitors can launch domestic products, prices will drop significantly? Maybe? Maybe our country can complete this mission? Maybe?

References#

  1. Linus Talks About Modern Standby in Windows
  2. Hardware Knowledge: What is the Cache of a Solid State Drive? What is the Difference Between Having Cache and Not Having Cache?

This article is synchronized and updated to xLog by Mix Space.
The original link is https://www.timochan.cn/posts/any_pen/stupid_modern_standby

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.