fs/erofs: major alignment fixes
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 3 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | fs/erofs: align the malloc'ed datafs/ fs/ | +5 | 3 replies | |
| 2/4 | fs/erofs: allocate data buffers on heap with alignment (1/3)fs/ fs/ fs/ +2 more | +91 | 0 replies | |
| 3/4 | fs/erofs: allocate data buffers on heap with alignment (2/3)fs/ | +15 | 0 replies | |
| 4/4 | fs/erofs: allocate data buffers on heap with alignment (3/3)fs/ fs/ fs/ | +94 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/4] fs/erofs: major alignment fixes
Throughout the whole fs code, large (4k) data buffers are allocated on the stack. While it is not nice, to allocate that large buffers on the stack, there is a much more fundamental problem: it's not aligned.
This will result in a huge amount of cache misaligned messages on arm32 SoCs, e.g.:
CACHE: Misaligned operation at range [x, y]
While this is more or less a warning, as it will only invalidate surrounding data, DMA is more of a problem. Some DMA controllers have address restrictions and because of that there is ARCH_DMA_MINALIGN. Thus as a first fix, move all the data buffers from the stack to the heap with proper alignment.
There are still some misalignment warnings. I've traced it to fs_devread(). Most of the calls to blk_dread() will pass an aligned buffer. But the main blk_dread() will just pass buf, which might have previously been advanced by readlen. Not sure how that could be fixed in an elegant way. The simplest would probably be just a bounce buffer, which there is already one in blk_read() if BOUNCE_BUFFERS is enabled. But I haven't managed to get that working. And now, I'm running out of time.
Michael Walle (4):
fs/erofs: align the malloc'ed data
fs/erofs: allocate data buffers on heap with alignment (1/3) fs/erofs: allocate data buffers on heap with alignment (2/3) fs/erofs: allocate data buffers on heap with alignment (3/3)
fs/erofs/data.c | 125 +++++++++++++++++++++++++++++--------------- fs/erofs/fs.c | 14 ++++- fs/erofs/internal.h | 5 +- fs/erofs/namei.c | 47 ++++++++++++----- fs/erofs/super.c | 40 ++++++++++---- fs/erofs/zmap.c | 61 +++++++++++++++------ 6 files changed, 205 insertions(+), 87 deletions(-)
Signature · 1 line
2.47.3