From owner-freebsd-scsi@FreeBSD.ORG Sat Dec 20 15:56:26 2014 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2E7C107; Sat, 20 Dec 2014 15:56:26 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 276AB1F7B; Sat, 20 Dec 2014 15:56:25 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sBKFuGll021758 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 20 Dec 2014 17:56:16 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sBKFuGll021758 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sBKFuFnl021757; Sat, 20 Dec 2014 17:56:15 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 20 Dec 2014 17:56:15 +0200 From: Konstantin Belousov To: Stephen Mcconnell Subject: Re: changing kern.bio_transient_maxcnt fixes panic Message-ID: <20141220155615.GT2148@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: freebsd-scsi@freebsd.org X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 15:56:26 -0000 On Fri, Dec 19, 2014 at 11:16:36AM -0700, Stephen Mcconnell wrote: > changing kern.bio_transient_maxcnt fixes panic > > Hi Konstantine. I hope you are the right person to help with this. Or > perhaps someone else on the list can help. > > We (Avago) have a customer who is getting the following panic. They are > using the mrsas (MegaRAID) driver in FreeBSD 10. In a test, they tried to > restore a database backup of 3GB. After the restore they queried the > database and then saw the panic. They found this link, saying that > changing the value of kern.bio_transient_maxcnt should fix the problem. It > did fix the problem, be we would like to know why it helped so that we???re > not just putting a band-aid on it. > > *https://lists.freebsd.org/pipermail/freebsd-stable/2013-October/075577.html* > > > Also, I found this link with the same type of question. > > *https://docs.freebsd.org/cgi/getmsg.cgi?fetch=179246+182329+/usr/local/www/db/text/2014/freebsd-questions/20141019.freebsd-questions* > > > Can you explain why changing this value fixes this problem, and what we > might need to do in the driver to make a permanent fix? The tunable controls the size of the KVA area used to map pages of the bio's which are not mapped into KVA, but which are passed to a driver that requires mapped bio's. The auto-tuning logic was developed with an assumption that the system load consists of the typical UFS-generated I/O. It is possible, for some i/o pathes. to generate more i/o. Note that the transient mappings are only needed when the driver does not handle unmapped bio's. So the proper fix is to add support for the unmapped i/o, see e.g. mfi(4); the required modifications are relatively simple. If you driver already supports unmapped i/o, then there is something else going on.