graid5, 3 consumers, unaligned access
Howard Goldstein
hg at queue.to
Sun Aug 19 23:25:04 PDT 2007
Arne Wörner wrote:
> --- Howard Goldstein <hg at queue.to> wrote:
>> Due to a bug in the twe driver I've noticed quite a few accesses to the
>> graid5 consumer that aren't on 512 byte boundaries. These are all 3
>>
> How can you tell, that the offsets/lengths are not integer multiples of the
> sector size (512 here most likely)?
The twe driver has a design flaw that depends on malloc()ing bounce
buffers when it's handed data not aligned on 512 byte boundaries. When
malloc fails, the driver syslogs a unique error that only can come from
the part where it's acting on unaligned data. The question is why data
are being sent to this driver unaligned. dd'ing to offset 0 at the
beginning of three unpartitioned data disks for 3000x1MB doesn't present
any opportunities I can think of for things to go out of alignment
multiple times while writing the 3GB.
It also happens during ordinary desktop operations (nothing
extraordinary), and when restore xf -'ng a filesystem onto the raid
array from a backup drive.
>
> Maybe you mix it up with some block number (which is not necessarily a multiple
> of the sector size)?
>
> Can you give an example for such strange accesses?
It was in the message you replied to, the dd invocation, that's the
easiest to induce. I can make it happen at will. The indication is
Aug 19 03:05:59 cally kernel: twe0: twe_map_request: malloc failed
Aug 19 03:06:48 cally kernel: twe0: twe_map_request: malloc failed
Aug 19 03:20:12 cally kernel: twe0: twe_map_request: malloc failed
Inspection of the twe driver (twe_freebsd.c) will show that mesage only
occurs when mallocing for the bounce buffer fails.
More information about the freebsd-geom
mailing list