From owner-freebsd-stable@FreeBSD.ORG Tue Jan 24 12:49:56 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B8CF16A41F; Tue, 24 Jan 2006 12:49:56 +0000 (GMT) (envelope-from imb@protected-networks.net) Received: from aaron.protected-networks.net (aaron.protected-networks.net [202.12.127.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB60643D4C; Tue, 24 Jan 2006 12:49:54 +0000 (GMT) (envelope-from imb@protected-networks.net) Received: from localhost (localhost [127.0.0.1]) by aaron.protected-networks.net (Postfix) with ESMTP id 9C2F7C310; Tue, 24 Jan 2006 07:49:53 -0500 (EST) Received: from aaron.protected-networks.net (localhost [127.0.0.1]) by aaron.protected-networks.net (Postfix) with ESMTP id D4DBFC308; Tue, 24 Jan 2006 07:49:48 -0500 (EST) Authentication-Results: aaron.protected-networks.net from=imb@protected-networks.net; domainkey=pass Received: from aaron.protected-networks.net (localhost [127.0.0.1]) by aaron.protected-networks.net (Postfix) with ESMTP id 59333C2F7; Tue, 24 Jan 2006 07:49:48 -0500 (EST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=200509; d=protected-networks.net; h=Received:Message-ID:Date:From:User-Agent:X-Accept-Language:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type; b=bAMxlge5iblzxlqm6gjvbxYFv1X70r22tXTAnV0qfSdKmsU11to6a5/ruxb48iTO0pC/QKtmg0Jx7HR6YEbyACG3Qnr/56WSn9v5i+8+T9vwklXGulLBaSxPwzCgC6LG; Received: from [192.168.1.11] (c-24-218-147-31.hsd1.ma.comcast.net [24.218.147.31]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "imb@protected-networks.net", Issuer "Protected Networks Certificate Authority" (verified OK)) by aaron.protected-networks.net (Postfix) with ESMTP id CAE0DC2C7; Tue, 24 Jan 2006 07:49:47 -0500 (EST) Message-ID: <43D62265.8020401@protected-networks.net> Date: Tue, 24 Jan 2006 07:49:41 -0500 From: Michael Butler User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: GreenX FreeBSD References: <43D09224.2050304@azimut-tour.ru> <43D4EDDA.8060901@protected-networks.net> <43D5BBA3.8070606@azimut-tour.ru> In-Reply-To: <43D5BBA3.8070606@azimut-tour.ru> Content-Type: multipart/mixed; boundary="------------070406000806020509060002" Cc: freebsd-stable@freebsd.org, greenx@azimutprint.ru, sos@freebsd.org Subject: Re: panic: kmem_malloc X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2006 12:49:56 -0000 This is a multi-part message in MIME format. --------------070406000806020509060002 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit GreenX FreeBSD wrote: > #sysctl -a | grep ^ata > ata_composit: 192, 0, 22663, 617, 65421 > ata_request: 200, 0, 45326, 1015, 468333 Right - this is a symptom of a memory leak in the ATA raid driver .. > But, I little cvsup system. > #uname -a > FreeBSD crom.azimutprint.ru 6.0-STABLE FreeBSD 6.0-STABLE #0: Mon Jan 23 > 11:18:32 MSK 2006 -skip- .. which has not been merged from current. It should look like .. ITEM SIZE LIMIT USED FREE REQUESTS [ .. ] ata_composit: 196, 0, 0, 320, 2039342 ata_request: 200, 0, 0, 437, 9260705 ^^^^ Use the attached patch until the fix is merged into 6.x, Michael Butler, CISSP Security Consultant www.protected-networks.net --------------070406000806020509060002 Content-Type: text/plain; name="ata-raid-patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ata-raid-patch" *** /usr/src/sys/dev/ata/ata-all.h.orig Sun Nov 27 14:17:57 2005 --- /usr/src/sys/dev/ata/ata-all.h Sun Nov 27 14:22:05 2005 *************** *** 331,336 **** --- 331,337 ---- u_int32_t wr_depend; /* write depends on subdisks */ u_int32_t wr_done; /* done write subdisks */ struct ata_request *request[32]; /* size must match maps above */ + long count; /* count required of this composite */ caddr_t data_1; caddr_t data_2; }; *** ata-raid.c.orig Mon Nov 28 18:02:01 2005 --- ata-raid.c Mon Nov 28 22:52:53 2005 *************** *** 410,415 **** --- 410,416 ---- mtx_init(&composite->lock, "ATA PseudoRAID rebuild lock", NULL, MTX_DEF); + composite->count = request->bytecount; composite->rd_needed |= (1 << drv); composite->wr_depend |= (1 << drv); composite->wr_needed |= (1 << this); *************** *** 468,473 **** --- 469,475 ---- mtx_init(&composite->lock, "ATA PseudoRAID mirror lock", NULL, MTX_DEF); + composite->count = request->bytecount; composite->wr_needed |= (1 << drv); composite->wr_needed |= (1 << this); composite->request[drv] = request; *************** *** 607,613 **** /* good data, update how far we've gotten */ else { bp->bio_resid -= request->donecount; ! if (bp->bio_resid == 0) { if (composite->wr_done & (1 << mirror)) finished = 1; } --- 609,616 ---- /* good data, update how far we've gotten */ else { bp->bio_resid -= request->donecount; ! composite->count -= request->donecount; ! if (composite->count == 0) { if (composite->wr_done & (1 << mirror)) finished = 1; } *************** *** 621,627 **** printf("DOH! rebuild failed\n"); /* XXX SOS */ rdp->rebuild_lba = blk; } ! if (bp->bio_resid == 0) finished = 1; } } --- 624,630 ---- printf("DOH! rebuild failed\n"); /* XXX SOS */ rdp->rebuild_lba = blk; } ! if (composite->count == 0) finished = 1; } } *************** *** 658,667 **** } bp->bio_resid -= composite->request[mirror]->donecount; } ! else bp->bio_resid -= request->donecount; ! if (bp->bio_resid == 0) finished = 1; } mtx_unlock(&composite->lock); --- 661,674 ---- } bp->bio_resid -= composite->request[mirror]->donecount; + composite->count -= + composite->request[mirror]->donecount; } ! else { bp->bio_resid -= request->donecount; ! composite->count -= request->donecount; ! } ! if (composite->count == 0) finished = 1; } mtx_unlock(&composite->lock); *************** *** 723,729 **** rdp->status &= ~AR_S_REBUILDING; ata_raid_config_changed(rdp, 1); } ! biodone(bp); } if (composite) { --- 730,738 ---- rdp->status &= ~AR_S_REBUILDING; ata_raid_config_changed(rdp, 1); } ! /* cover the case of a series of composites which are only partly complete */ ! if (bp->bio_resid == 0) ! biodone(bp); } if (composite) { --------------070406000806020509060002--