From owner-freebsd-geom@FreeBSD.ORG Tue Feb 25 22:16:38 2014 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F542E95; Tue, 25 Feb 2014 22:16:38 +0000 (UTC) Received: from mail-bk0-x22a.google.com (mail-bk0-x22a.google.com [IPv6:2a00:1450:4008:c01::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C914311B9; Tue, 25 Feb 2014 22:16:37 +0000 (UTC) Received: by mail-bk0-f42.google.com with SMTP id mx12so464236bkb.1 for ; Tue, 25 Feb 2014 14:16:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=YziSJVWSY+grv5AqHVvCqrLES29xca0AMxFV/m+jR2A=; b=SbQ+jCelZusQVlGNzjZMhQkH+lM9laHxWEn2PDJKmNoiZGnmClkIBSZXwXCCXT0SRT 7qU5Ux+26OtTMSmXLIgpnNWaPGjFLfDOZDClJJXnKr9ivSdV/vfIl+DippLiyt/Le2EF izfWBy8+lwlGzdtNN/PuQ11SAcMhYE4kSRN8fSmCq2JGfiMJJD/i56Ad+n0dVd8s+SDU T90Iq5cZDo4CazM3Z5x0nos/ouCb5MpbTfOIS0hQbhjFRMG0F7WyODJh/mbobKSBBBP8 FpOwT7L31hKaMmyEYl9+jMOtBoWNdbMWp0iE9EyHslFbAStjiMSTllDkqShPQAozt5YZ /LPg== X-Received: by 10.205.32.142 with SMTP id sk14mr2397609bkb.18.1393366596041; Tue, 25 Feb 2014 14:16:36 -0800 (PST) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by mx.google.com with ESMTPSA id z2sm19981850bkm.14.2014.02.25.14.16.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Feb 2014 14:16:35 -0800 (PST) Sender: Alexander Motin Message-ID: <530D1640.3050104@FreeBSD.org> Date: Wed, 26 Feb 2014 00:16:32 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: lev@FreeBSD.org, freebsd-geom@freebsd.org Subject: Re: 3rd party geom module on 10-STABLE cause panics in biodone() References: <585146922.20140226020105@serebryakov.spb.ru> In-Reply-To: <585146922.20140226020105@serebryakov.spb.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 22:16:38 -0000 On 26.02.2014 00:01, Lev Serebryakov wrote: > My geom_raid5, which works rock-stable on 9-STABLE, causes panics in > biodone() on 10-STABLE. It causes panic at line 3567, > > 3561 if ((bp->bio_flags & BIO_TRANSIENT_MAPPING) != 0) { > 3562 bp->bio_flags &= ~BIO_TRANSIENT_MAPPING; > 3563 bp->bio_flags |= BIO_UNMAPPED; > 3564 start = trunc_page((vm_offset_t)bp->bio_data); > 3565 end = round_page((vm_offset_t)bp->bio_data + bp->bio_length); > 3566 pmap_qremove(start, OFF_TO_IDX(end - start)); > 3567 vmem_free(transient_arena, start, end - start); > 3568 atomic_add_int(&inflight_transient_maps, -1); > 3569 } > > And these crashes are very bad: 9 of 10 times system could not make > crashdump or reboot and 8 out of 10 times it shuts down video output (!). > > I was lucky to get one crashdump to find this line... > > What could I do wrong in my module? IIRC I had problem with that part of code during my GEOM direct dispatch work when some requests were unmapped twice. At that time I've added restoring the flags at lines 3562-3563, and it helped in my case. Make sure that you are not have some unexpected requests reuse, etc, that may cause incorrect combination of BIO flags and addresses. -- Alexander Motin