From owner-freebsd-geom@FreeBSD.ORG Mon Aug 20 06:25:04 2007 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20E3916A417 for ; Mon, 20 Aug 2007 06:25:04 +0000 (UTC) (envelope-from hg@queue.to) Received: from pickle.queue.to (pickle.queue.to [71.180.69.18]) by mx1.freebsd.org (Postfix) with ESMTP id BD23713C458 for ; Mon, 20 Aug 2007 06:25:03 +0000 (UTC) (envelope-from hg@queue.to) Received: (qmail 75057 invoked from network); 20 Aug 2007 02:25:02 -0400 Received: from cally.queue.to (172.16.0.6) by pickle.queue.to with ESMTP; 20 Aug 2007 02:25:02 -0400 Message-ID: <46C933BE.9090904@queue.to> Date: Mon, 20 Aug 2007 02:25:02 -0400 From: Howard Goldstein User-Agent: Thunderbird 2.0.0.6 (X11/20070802) MIME-Version: 1.0 To: arne_woerner@yahoo.com References: <829676.49356.qm@web30306.mail.mud.yahoo.com> In-Reply-To: <829676.49356.qm@web30306.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: freebsd-geom@freebsd.org Subject: Re: graid5, 3 consumers, unaligned access X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2007 06:25:04 -0000 Arne Wörner wrote: > --- Howard Goldstein 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.