From owner-freebsd-firewire@FreeBSD.ORG Mon Dec 17 06:02:16 2007 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B3D316A419; Mon, 17 Dec 2007 06:02:16 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from plato.miralink.com (mail.miralink.com [70.103.185.20]) by mx1.freebsd.org (Postfix) with ESMTP id 103C913C44B; Mon, 17 Dec 2007 06:02:16 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id B83961C818D; Sun, 16 Dec 2007 22:02:15 -0800 (PST) Received: from plato.miralink.com ([127.0.0.1]) by localhost (plato.miralink.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25446-10; Sun, 16 Dec 2007 22:02:14 -0800 (PST) Received: from [10.47.1.118] (vpn.office.miralink.com [10.0.0.5]) by plato.miralink.com (Postfix) with ESMTP id 6F1931C8180; Sun, 16 Dec 2007 22:02:14 -0800 (PST) Message-ID: <476610E5.2060108@miralink.com> Date: Sun, 16 Dec 2007 22:02:13 -0800 From: Sean Bruno User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: freebsd-firewire@freebsd.org, Hidetoshi Shimokawa Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DSPAM-Result: Innocent X-DSPAM-Processed: Sun Dec 16 22:02:15 2007 X-DSPAM-Confidence: 0.9997 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 476610e715761214584237 X-DSPAM-Factors: 27, X-Virus-Scanned: amavisd-new at X-Spam-Status: No, score=-4.499 tagged_above=-10 required=6.6 autolearn=ham tests=[ALL_TRUSTED=-1.8, BAYES_00=-2.599, DSPAM_HAM=-0.1] X-Spam-Score: -4.499 X-Spam-Level: Cc: Subject: sbp_targ memory leak X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2007 06:02:16 -0000 In trying to understand and make sbp_targ functional, I've noted that the code seems to lose track of how many page tables it allocates for any give orbi. I had to add a lot of debugging code around the malloc/free's to find out what was going on, and I'm not sure what the code is supposed to do in this case. Please review the patch diff at --> http://consultcsg.com/RELENG_6.diff And the log at -->http://consultcsg.com/malloc_failure.txt This clearly shows that a new page table is being allocated for the same IO operation, which should be fine, but then a second malloc is attempted and stored in the same variable effectively leaking the data. I'm sure that this type of operation is supposed to be possible, but my interpretation of SBP-2 is suspect! :) Sean From owner-freebsd-firewire@FreeBSD.ORG Mon Dec 17 06:58:54 2007 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C91B616A419 for ; Mon, 17 Dec 2007 06:58:54 +0000 (UTC) (envelope-from freebsd@gm.nunu.org) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.191]) by mx1.freebsd.org (Postfix) with ESMTP id B439313C461 for ; Mon, 17 Dec 2007 06:58:54 +0000 (UTC) (envelope-from freebsd@gm.nunu.org) Received: by rv-out-0910.google.com with SMTP id l15so1982991rvb.43 for ; Sun, 16 Dec 2007 22:58:53 -0800 (PST) Received: by 10.142.212.19 with SMTP id k19mr271462wfg.193.1197874733573; Sun, 16 Dec 2007 22:58:53 -0800 (PST) Received: by 10.142.224.12 with HTTP; Sun, 16 Dec 2007 22:58:53 -0800 (PST) Message-ID: <626eb4530712162258s4dfe1448o1102f20a623d3f95@mail.gmail.com> Date: Mon, 17 Dec 2007 15:58:53 +0900 From: "Hidetoshi Shimokawa" Sender: freebsd@gm.nunu.org To: "Sean Bruno" In-Reply-To: <476610E5.2060108@miralink.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <476610E5.2060108@miralink.com> X-Google-Sender-Auth: ae82b4ba317c02df Cc: freebsd-firewire@freebsd.org Subject: Re: sbp_targ memory leak X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2007 06:58:54 -0000 Thanks for the tracking of the problem. Could you resend the patch in unified or context diff? Thanks, On 12/17/07, Sean Bruno wrote: > In trying to understand and make sbp_targ functional, I've noted that > the code seems to lose track of how many page tables it allocates for > any give orbi. I had to add a lot of debugging code around the > malloc/free's to find out what was going on, and I'm not sure what the > code is supposed to do in this case. > > Please review the patch diff at --> http://consultcsg.com/RELENG_6.diff > > And the log at -->http://consultcsg.com/malloc_failure.txt > > This clearly shows that a new page table is being allocated for the same > IO operation, which should be fine, but then a second malloc is > attempted and stored in the same variable effectively leaking the data. > I'm sure that this type of operation is supposed to be possible, but my > interpretation of SBP-2 is suspect! :) > > Sean > > > -- /\ Hidetoshi Shimokawa \/ simokawa@FreeBSD.ORG From owner-freebsd-firewire@FreeBSD.ORG Mon Dec 17 11:06:56 2007 Return-Path: Delivered-To: freebsd-firewire@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48E1416A4F3 for ; Mon, 17 Dec 2007 11:06:56 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3398713C4D9 for ; Mon, 17 Dec 2007 11:06:56 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id lBHB6unB088196 for ; Mon, 17 Dec 2007 11:06:56 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lBHB6t4h088192 for freebsd-firewire@FreeBSD.org; Mon, 17 Dec 2007 11:06:55 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 17 Dec 2007 11:06:55 GMT Message-Id: <200712171106.lBHB6t4h088192@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-firewire@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-firewire@FreeBSD.org X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2007 11:06:56 -0000 Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/74238 firewire [firewire] fw_rcv: unknown response; firewire ad-hoc w 1 problem total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- f kern/113785 firewire [firewire] dropouts when playing DV on firewire 1 problem total. From owner-freebsd-firewire@FreeBSD.ORG Mon Dec 17 15:33:26 2007 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD0B816A419; Mon, 17 Dec 2007 15:33:26 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from plato.miralink.com (mail.miralink.com [70.103.185.20]) by mx1.freebsd.org (Postfix) with ESMTP id 9256513C459; Mon, 17 Dec 2007 15:33:26 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id 4DFFF1C8196; Mon, 17 Dec 2007 07:33:26 -0800 (PST) Received: from plato.miralink.com ([127.0.0.1]) by localhost (plato.miralink.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23948-07; Mon, 17 Dec 2007 07:33:24 -0800 (PST) Received: from [10.47.1.118] (vpn.office.miralink.com [10.0.0.5]) by plato.miralink.com (Postfix) with ESMTP id B6D431C8194; Mon, 17 Dec 2007 07:33:24 -0800 (PST) Message-ID: <476696C4.60408@miralink.com> Date: Mon, 17 Dec 2007 07:33:24 -0800 From: Sean Bruno User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: Hidetoshi Shimokawa References: <476610E5.2060108@miralink.com> <626eb4530712162258s4dfe1448o1102f20a623d3f95@mail.gmail.com> In-Reply-To: <626eb4530712162258s4dfe1448o1102f20a623d3f95@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DSPAM-Result: Innocent X-DSPAM-Processed: Mon Dec 17 07:33:25 2007 X-DSPAM-Confidence: 0.9997 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 476696c577311259843084 X-DSPAM-Factors: 27, X-Virus-Scanned: amavisd-new at X-Spam-Status: No, score=-4.499 tagged_above=-10 required=6.6 autolearn=ham tests=[ALL_TRUSTED=-1.8, BAYES_00=-2.599, DSPAM_HAM=-0.1] X-Spam-Score: -4.499 X-Spam-Level: Cc: freebsd-firewire@freebsd.org Subject: Re: sbp_targ memory leak X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2007 15:33:26 -0000 Hidetoshi Shimokawa wrote: > Thanks for the tracking of the problem. > Could you resend the patch in unified or context diff? > > Thanks, > > On 12/17/07, Sean Bruno wrote: > >> In trying to understand and make sbp_targ functional, I've noted that >> the code seems to lose track of how many page tables it allocates for >> any give orbi. I had to add a lot of debugging code around the >> malloc/free's to find out what was going on, and I'm not sure what the >> code is supposed to do in this case. >> >> Please review the patch diff at --> http://consultcsg.com/RELENG_6.diff >> >> And the log at -->http://consultcsg.com/malloc_failure.txt >> >> >> Diff updated at http://consultcsg.com/RELENG_6.diff Sean From owner-freebsd-firewire@FreeBSD.ORG Wed Dec 19 07:20:55 2007 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62EB116A419 for ; Wed, 19 Dec 2007 07:20:55 +0000 (UTC) (envelope-from freebsd@gm.nunu.org) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.180]) by mx1.freebsd.org (Postfix) with ESMTP id 0C43613C447 for ; Wed, 19 Dec 2007 07:20:54 +0000 (UTC) (envelope-from freebsd@gm.nunu.org) Received: by py-out-1112.google.com with SMTP id u77so5004938pyb.3 for ; Tue, 18 Dec 2007 23:20:54 -0800 (PST) Received: by 10.142.242.8 with SMTP id p8mr1190363wfh.142.1198048853175; Tue, 18 Dec 2007 23:20:53 -0800 (PST) Received: by 10.142.224.12 with HTTP; Tue, 18 Dec 2007 23:20:53 -0800 (PST) Message-ID: <626eb4530712182320q237c344crd309893a82fe8ef8@mail.gmail.com> Date: Wed, 19 Dec 2007 16:20:53 +0900 From: "Hidetoshi Shimokawa" Sender: freebsd@gm.nunu.org To: "Sean Bruno" In-Reply-To: <476696C4.60408@miralink.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <476610E5.2060108@miralink.com> <626eb4530712162258s4dfe1448o1102f20a623d3f95@mail.gmail.com> <476696C4.60408@miralink.com> X-Google-Sender-Auth: 9a86eb3c916cd8e6 Cc: freebsd-firewire@freebsd.org Subject: Re: sbp_targ memory leak X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2007 07:20:55 -0000 I think you are right and page table is not freed when CAM_SEND_STATUS is not set. Maybe we should always free page tables if refcont == 0 rather than free in sbp_targ_send_status(). You patch is not just adding debug printfs, right? What is the mtx locks for? On 12/18/07, Sean Bruno wrote: > Hidetoshi Shimokawa wrote: > > Thanks for the tracking of the problem. > > Could you resend the patch in unified or context diff? > > > > Thanks, > > > > On 12/17/07, Sean Bruno wrote: > > > >> In trying to understand and make sbp_targ functional, I've noted that > >> the code seems to lose track of how many page tables it allocates for > >> any give orbi. I had to add a lot of debugging code around the > >> malloc/free's to find out what was going on, and I'm not sure what the > >> code is supposed to do in this case. > >> > >> Please review the patch diff at --> http://consultcsg.com/RELENG_6.diff > >> > >> And the log at -->http://consultcsg.com/malloc_failure.txt > >> > >> > >> > Diff updated at http://consultcsg.com/RELENG_6.diff > > Sean > > > -- /\ Hidetoshi Shimokawa \/ simokawa@FreeBSD.ORG From owner-freebsd-firewire@FreeBSD.ORG Wed Dec 19 08:14:25 2007 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8ACFF16A41B; Wed, 19 Dec 2007 08:14:25 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from plato.miralink.com (mail.miralink.com [70.103.185.20]) by mx1.freebsd.org (Postfix) with ESMTP id 55B7813C458; Wed, 19 Dec 2007 08:14:25 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id 0A5BF1C81B1; Wed, 19 Dec 2007 00:14:25 -0800 (PST) Received: from plato.miralink.com ([127.0.0.1]) by localhost (plato.miralink.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 29797-06; Wed, 19 Dec 2007 00:14:22 -0800 (PST) Received: from [10.47.1.118] (vpn.office.miralink.com [10.0.0.5]) by plato.miralink.com (Postfix) with ESMTP id DEE2C1C81AC; Wed, 19 Dec 2007 00:14:21 -0800 (PST) Message-ID: <4768D2DD.2010500@miralink.com> Date: Wed, 19 Dec 2007 00:14:21 -0800 From: Sean Bruno User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: Hidetoshi Shimokawa References: <476610E5.2060108@miralink.com> <626eb4530712162258s4dfe1448o1102f20a623d3f95@mail.gmail.com> <476696C4.60408@miralink.com> <626eb4530712182320q237c344crd309893a82fe8ef8@mail.gmail.com> In-Reply-To: <626eb4530712182320q237c344crd309893a82fe8ef8@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DSPAM-Result: Innocent X-DSPAM-Processed: Wed Dec 19 00:14:22 2007 X-DSPAM-Confidence: 0.9997 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 4768d2de265551336712104 X-DSPAM-Factors: 27, X-Virus-Scanned: amavisd-new at X-Spam-Status: No, score=-4.499 tagged_above=-10 required=6.6 autolearn=ham tests=[ALL_TRUSTED=-1.8, AWL=-0.000, BAYES_00=-2.599, DSPAM_HAM=-0.1] X-Spam-Score: -4.499 X-Spam-Level: Cc: freebsd-firewire@freebsd.org Subject: Re: sbp_targ memory leak X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2007 08:14:25 -0000 Hidetoshi Shimokawa wrote: > I think you are right and page table is not freed when CAM_SEND_STATUS > is not set. > Maybe we should always free page tables if refcont == 0 rather than > free in sbp_targ_send_status(). > > You patch is not just adding debug printfs, right? > What is the mtx locks for? > > On 12/18/07, Sean Bruno wrote: > >> Hidetoshi Shimokawa wrote: >> >>> Thanks for the tracking of the problem. >>> Could you resend the patch in unified or context diff? >>> >>> Thanks, >>> >>> On 12/17/07, Sean Bruno wrote: >>> >>> >>>> In trying to understand and make sbp_targ functional, I've noted that >>>> the code seems to lose track of how many page tables it allocates for >>>> any give orbi. I had to add a lot of debugging code around the >>>> malloc/free's to find out what was going on, and I'm not sure what the >>>> code is supposed to do in this case. >>>> >>>> Please review the patch diff at --> http://consultcsg.com/RELENG_6.diff >>>> >>>> And the log at -->http://consultcsg.com/malloc_failure.txt >>>> >>>> >>>> >>>> >> Diff updated at http://consultcsg.com/RELENG_6.diff >> >> Sean >> >> >> >> > > > Currently, they _should_ do nothing. I had intended to use them when I perceived a locking issue between my target driver and the firewire driver. They can be thrown away as far as I know. Sean From owner-freebsd-firewire@FreeBSD.ORG Wed Dec 19 18:21:42 2007 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCAF616A419; Wed, 19 Dec 2007 18:21:42 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from plato.miralink.com (mail.miralink.com [70.103.185.20]) by mx1.freebsd.org (Postfix) with ESMTP id B035713C45B; Wed, 19 Dec 2007 18:21:42 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id 60D571C81BD; Wed, 19 Dec 2007 10:21:42 -0800 (PST) Received: from plato.miralink.com ([127.0.0.1]) by localhost (plato.miralink.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 10696-09; Wed, 19 Dec 2007 10:21:41 -0800 (PST) Received: from iago.office.miralink.com (iago.office.miralink.com [10.0.0.40]) by plato.miralink.com (Postfix) with ESMTP id A37611C81BB; Wed, 19 Dec 2007 10:21:41 -0800 (PST) Message-ID: <47696135.8060508@miralink.com> Date: Wed, 19 Dec 2007 10:21:41 -0800 From: Sean Bruno User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: Hidetoshi Shimokawa References: <476610E5.2060108@miralink.com> <626eb4530712162258s4dfe1448o1102f20a623d3f95@mail.gmail.com> <476696C4.60408@miralink.com> <626eb4530712182320q237c344crd309893a82fe8ef8@mail.gmail.com> <4768D2DD.2010500@miralink.com> In-Reply-To: <4768D2DD.2010500@miralink.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DSPAM-Result: Innocent X-DSPAM-Processed: Wed Dec 19 10:21:42 2007 X-DSPAM-Confidence: 0.7829 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 47696136144251527717022 X-DSPAM-Factors: 27, X-Virus-Scanned: amavisd-new at X-Spam-Status: No, score=-4.499 tagged_above=-10 required=6.6 autolearn=ham tests=[ALL_TRUSTED=-1.8, BAYES_00=-2.599, DSPAM_HAM=-0.1] X-Spam-Score: -4.499 X-Spam-Level: Cc: freebsd-firewire@freebsd.org Subject: Re: sbp_targ memory leak X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2007 18:21:42 -0000 Sean Bruno wrote: > Hidetoshi Shimokawa wrote: >> I think you are right and page table is not freed when CAM_SEND_STATUS >> is not set. >> Maybe we should always free page tables if refcont == 0 rather than >> free in sbp_targ_send_status(). >> I thought about this some more this morning. What is causing us to allocate two page tables per XPT_CONT_TARGET_IO? The address printed out for the XPT_CONT_TARGET_IO call is identical, so I assume that these operations were for the same SCSI command. >> You patch is not just adding debug printfs, right? Yes, there is additions for XPT_SET_TRAN_SETTINGS /XPT_GET_TRAN_SETTINGS, additional CAM_SEND_SENSE flags and remove the requirement for target 0. Sean From owner-freebsd-firewire@FreeBSD.ORG Fri Dec 21 01:16:37 2007 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D328C16A46C; Fri, 21 Dec 2007 01:16:37 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from plato.miralink.com (mail.miralink.com [70.103.185.20]) by mx1.freebsd.org (Postfix) with ESMTP id AA18013C4CE; Fri, 21 Dec 2007 01:16:37 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id 3A7931C81D9; Thu, 20 Dec 2007 17:16:37 -0800 (PST) Received: from plato.miralink.com ([127.0.0.1]) by localhost (plato.miralink.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 22249-01; Thu, 20 Dec 2007 17:16:36 -0800 (PST) Received: from iago.office.miralink.com (iago.office.miralink.com [10.0.0.40]) by plato.miralink.com (Postfix) with ESMTP id 52CA91C81CD; Thu, 20 Dec 2007 17:16:36 -0800 (PST) Message-ID: <476B13F4.5050409@miralink.com> Date: Thu, 20 Dec 2007 17:16:36 -0800 From: Sean Bruno User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: Hidetoshi Shimokawa References: <476610E5.2060108@miralink.com> <626eb4530712162258s4dfe1448o1102f20a623d3f95@mail.gmail.com> <476696C4.60408@miralink.com> <626eb4530712182320q237c344crd309893a82fe8ef8@mail.gmail.com> In-Reply-To: <626eb4530712182320q237c344crd309893a82fe8ef8@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DSPAM-Result: Innocent X-DSPAM-Processed: Thu Dec 20 17:16:36 2007 X-DSPAM-Confidence: 0.9997 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 476b13f4230907852419847 X-DSPAM-Factors: 27, X-Virus-Scanned: amavisd-new at X-Spam-Status: No, score=-4.468 tagged_above=-10 required=6.6 autolearn=ham tests=[ALL_TRUSTED=-1.8, AWL=0.031, BAYES_00=-2.599, DSPAM_HAM=-0.1] X-Spam-Score: -4.468 X-Spam-Level: Cc: freebsd-firewire@freebsd.org Subject: Re: sbp_targ memory leak X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2007 01:16:37 -0000 Hidetoshi Shimokawa wrote: > I think you are right and page table is not freed when CAM_SEND_STATUS > is not set. > Maybe we should always free page tables if refcont == 0 rather than > free in sbp_targ_send_status(). > > You patch is not just adding debug printfs, right? > What is the mtx locks for? > > On 12/18/07, Sean Bruno wrote: > >> Hidetoshi Shimokawa wrote: >> >>> Thanks for the tracking of the problem. >>> Could you resend the patch in unified or context diff? >>> >>> Thanks, >>> >>> On 12/17/07, Sean Bruno wrote: >>> >>> >>>> In trying to understand and make sbp_targ functional, I've noted that >>>> the code seems to lose track of how many page tables it allocates for >>>> any give orbi. I had to add a lot of debugging code around the >>>> malloc/free's to find out what was going on, and I'm not sure what the >>>> code is supposed to do in this case. >>>> >>>> Please review the patch diff at --> http://consultcsg.com/RELENG_6.diff >>>> >>>> And the log at -->http://consultcsg.com/malloc_failure.txt >>>> >>>> >>>> >>>> >> Diff updated at http://consultcsg.com/RELENG_6.diff >> >> Sean >> >> I moved the free around as you suggested and the memory leak does indeed go away and there are no further crashes. Here is my current diff --> http://consultcsg.com/RELENG_6.diff . It does look like the data is not being written or read to the backend correctly however. I.e. the page_table is not being setup correctly when more than one read or write is required to service an ORB. Any ideas on how to look into that? Sean From owner-freebsd-firewire@FreeBSD.ORG Fri Dec 21 01:27:41 2007 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83BD916A417 for ; Fri, 21 Dec 2007 01:27:41 +0000 (UTC) (envelope-from freebsd@gm.nunu.org) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.225]) by mx1.freebsd.org (Postfix) with ESMTP id 4E5F213C45D for ; Fri, 21 Dec 2007 01:27:41 +0000 (UTC) (envelope-from freebsd@gm.nunu.org) Received: by nz-out-0506.google.com with SMTP id l8so76883nzf.13 for ; Thu, 20 Dec 2007 17:27:40 -0800 (PST) Received: by 10.142.142.16 with SMTP id p16mr448078wfd.119.1198200459844; Thu, 20 Dec 2007 17:27:39 -0800 (PST) Received: by 10.142.224.12 with HTTP; Thu, 20 Dec 2007 17:27:39 -0800 (PST) Message-ID: <626eb4530712201727n3fc0d33aq6e6b44603b5d77f2@mail.gmail.com> Date: Fri, 21 Dec 2007 10:27:39 +0900 From: "Hidetoshi Shimokawa" Sender: freebsd@gm.nunu.org To: "Sean Bruno" In-Reply-To: <476B13F4.5050409@miralink.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <476610E5.2060108@miralink.com> <626eb4530712162258s4dfe1448o1102f20a623d3f95@mail.gmail.com> <476696C4.60408@miralink.com> <626eb4530712182320q237c344crd309893a82fe8ef8@mail.gmail.com> <476B13F4.5050409@miralink.com> X-Google-Sender-Auth: 16cadc62d94b0d76 Cc: freebsd-firewire@freebsd.org Subject: Re: sbp_targ memory leak X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2007 01:27:41 -0000 Thanks for the test. I'll look into the page_table problem this weekend. Sorry for late response. On 12/21/07, Sean Bruno wrote: > Hidetoshi Shimokawa wrote: > > I think you are right and page table is not freed when CAM_SEND_STATUS > > is not set. > > Maybe we should always free page tables if refcont == 0 rather than > > free in sbp_targ_send_status(). > > > > You patch is not just adding debug printfs, right? > > What is the mtx locks for? > > > > On 12/18/07, Sean Bruno wrote: > > > >> Hidetoshi Shimokawa wrote: > >> > >>> Thanks for the tracking of the problem. > >>> Could you resend the patch in unified or context diff? > >>> > >>> Thanks, > >>> > >>> On 12/17/07, Sean Bruno wrote: > >>> > >>> > >>>> In trying to understand and make sbp_targ functional, I've noted that > >>>> the code seems to lose track of how many page tables it allocates for > >>>> any give orbi. I had to add a lot of debugging code around the > >>>> malloc/free's to find out what was going on, and I'm not sure what the > >>>> code is supposed to do in this case. > >>>> > >>>> Please review the patch diff at --> http://consultcsg.com/RELENG_6.diff > >>>> > >>>> And the log at -->http://consultcsg.com/malloc_failure.txt > >>>> > >>>> > >>>> > >>>> > >> Diff updated at http://consultcsg.com/RELENG_6.diff > >> > >> Sean > >> > >> > I moved the free around as you suggested and the memory leak does indeed > go away and there are no further crashes. > Here is my current diff --> http://consultcsg.com/RELENG_6.diff . > > It does look like the data is not being written or read to the backend > correctly however. I.e. the page_table is not being > setup correctly when more than one read or write is required to service > an ORB. Any ideas on how to look into that? > > Sean > > -- /\ Hidetoshi Shimokawa \/ simokawa@FreeBSD.ORG From owner-freebsd-firewire@FreeBSD.ORG Sat Dec 22 05:16:29 2007 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AA0A16A41A; Sat, 22 Dec 2007 05:16:29 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from plato.miralink.com (mail.miralink.com [70.103.185.20]) by mx1.freebsd.org (Postfix) with ESMTP id 5178513C455; Sat, 22 Dec 2007 05:16:29 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id EE59A1C800F; Fri, 21 Dec 2007 21:16:28 -0800 (PST) Received: from plato.miralink.com ([127.0.0.1]) by localhost (plato.miralink.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 21876-04; Fri, 21 Dec 2007 21:16:28 -0800 (PST) Received: from [10.47.1.118] (vpn.office.miralink.com [10.0.0.5]) by plato.miralink.com (Postfix) with ESMTP id 52B421C800C; Fri, 21 Dec 2007 21:16:28 -0800 (PST) Message-ID: <476C9DAB.7080402@miralink.com> Date: Fri, 21 Dec 2007 21:16:27 -0800 From: Sean Bruno User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: freebsd-firewire@freebsd.org, Hidetoshi Shimokawa Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DSPAM-Result: Innocent X-DSPAM-Processed: Fri Dec 21 21:16:28 2007 X-DSPAM-Confidence: 0.9996 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 476c9dac77025260519334 X-DSPAM-Factors: 27, X-Virus-Scanned: amavisd-new at X-Spam-Status: No, score=-4.473 tagged_above=-10 required=6.6 autolearn=ham tests=[ALL_TRUSTED=-1.8, AWL=0.026, BAYES_00=-2.599, DSPAM_HAM=-0.1] X-Spam-Score: -4.473 X-Spam-Level: Cc: Subject: sbp and sbp_targ can't co-exist? X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Dec 2007 05:16:29 -0000 I noted that sbp and sbp_targ can't be configured at the same time. Is it possible to have the controller act as a target and see other targets at the same time? Sean