hibernation on 4k disks

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

hibernation on 4k disks

joshua stein-3
When booting on a 4k NVMe disk, the kernel will always print:

     hib block_io biowait error 22 blk 4229561 size 512

This is from hibernate_resume() trying to read the signature of a
previous hibernation.  ZZZ also fails in the io path.

A bunch of things in subr_hibernate.c have DEV_BSIZE (512)
hard-coded, which goes through hibernate_block_io(), and then
bounds_check_with_label() in subr_disk.c which returns EINVAL
because the block number is not divisible by 8 and the block count
(512) is not divisible by d_secsize (4096).

Reply | Threaded
Open this post in threaded view
|

Re: hibernation on 4k disks

Mike Larkin-2
On Sat, Jul 06, 2019 at 10:06:14PM -0500, joshua stein wrote:

> When booting on a 4k NVMe disk, the kernel will always print:
>
>      hib block_io biowait error 22 blk 4229561 size 512
>
> This is from hibernate_resume() trying to read the signature of a
> previous hibernation.  ZZZ also fails in the io path.
>
> A bunch of things in subr_hibernate.c have DEV_BSIZE (512)
> hard-coded, which goes through hibernate_block_io(), and then
> bounds_check_with_label() in subr_disk.c which returns EINVAL
> because the block number is not divisible by 8 and the block count
> (512) is not divisible by d_secsize (4096).
>

Getting this to work on a 4k sector disk is going to be difficult as there
are assumptions in the hibernate code for the amount of space reserved for
block I/O. For example, IIRC wd(4) has a single 4K page for everything,
including device soft state used during the side-effect-free I/O routine.

To make matters worse, softraid shares that page, so you get even less space.

There will likely be a ton of surgery required, unless you can write only
512 bytes of a 4k block on those disks, at 512 byte offsets inside the
block (without damaging the rest of the block).

I don't have any of this hardware, so I probably won't be of much help here
aside from advice.

-ml