freebsd-src/lib/libufs
Kirk McKusick 772430dd67 Ensure I/O buffers in libufs(3) are 128-byte aligned.
Various disk controllers require their buffers to be aligned to a
cache-line size (128 bytes). For buffers allocated in structures,
ensure that they are 128-byte aligned. Use aligned_malloc to allocate
memory to ensure that the returned memory is 128-byte aligned.

While we are here, we replace the dynamically allocated inode buffer
with a buffer allocated in the uufsd structure just as the superblock
and cylinder group buffers do.

This can be removed if/when the kernel is fixed. Because this problem
has existed on one I/O subsystem or another since the 1990's, we
are probably stuck with dealing with it forever.

The problem most recent showed up in Azure, see:
    https://reviews.freebsd.org/D41728
    https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267654
Before these fixes were applied, it was confirmed that the changes
in this commit also fixed the issue in Azure.

Reviewed-by: Warner Losh, kib
Tested-by:   Souradeep Chakrabarti of Microsoft (earlier version)
PR:          267654
Differential Revision: https://reviews.freebsd.org/D41724
2023-11-17 14:11:24 -08:00
..
block.c Ensure I/O buffers in libufs(3) are 128-byte aligned. 2023-11-17 14:11:24 -08:00
bread.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
cgread.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
cgroup.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
getinode.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
inode.c Ensure I/O buffers in libufs(3) are 128-byte aligned. 2023-11-17 14:11:24 -08:00
libufs.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libufs.h Ensure I/O buffers in libufs(3) are 128-byte aligned. 2023-11-17 14:11:24 -08:00
Makefile Ensure I/O buffers in libufs(3) are 128-byte aligned. 2023-11-17 14:11:24 -08:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
sblock.c Ensure I/O buffers in libufs(3) are 128-byte aligned. 2023-11-17 14:11:24 -08:00
sbread.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
type.c Ensure I/O buffers in libufs(3) are 128-byte aligned. 2023-11-17 14:11:24 -08:00
ufs_disk_close.3 Ensure I/O buffers in libufs(3) are 128-byte aligned. 2023-11-17 14:11:24 -08:00