From owner-freebsd-current@FreeBSD.ORG Tue Jan 9 19:47:04 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2E4C716A67B; Tue, 9 Jan 2007 19:47:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id ABE0F13C457; Tue, 9 Jan 2007 19:47:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id l09JkQBo077947; Tue, 9 Jan 2007 14:46:37 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-current@freebsd.org Date: Tue, 9 Jan 2007 14:26:35 -0500 User-Agent: KMail/1.9.1 References: <20070107171034.GA13836@crodrigues.org> <45A139CF.3090909@cisco.com> <20070107185228.W41371@fledge.watson.org> In-Reply-To: <20070107185228.W41371@fledge.watson.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200701091426.36740.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Tue, 09 Jan 2007 14:46:37 -0500 (EST) X-Virus-Scanned: ClamAV 0.88.3/2430/Tue Jan 9 12:35:51 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Craig Rodrigues , Randall Stewart , Robert Watson Subject: Re: Witness warning with SCTP X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jan 2007 19:47:04 -0000 On Sunday 07 January 2007 13:54, Robert Watson wrote: > On Sun, 7 Jan 2007, Randall Stewart wrote: > > > Craig: > > > > When we allocate a PCB we hold several locks. This prevents a conflict of > > say a sender allocating a PCB at the very same instant (this was one of my > > race condition bugs that was fixed recently). > > > > Now, each PCB has a small hash table it uses. We call hashinit() for this .. > > > > hashinit() does a malloc with M_WAITOK > > > > thus the warning. > > > > So, I either need to make another hashinit() function with a passed flag for > > the wait (seems the best way) OR make a sctp specific hashinit.. which I > > don't like doing.. > > > > Maybe I can change the name of hashinit() to hashinit_x() and then make > > hashinit() be a macro that calls hasinit_x with M_WAITOK.. then I could use > > hashinit_x() directly? > > > > Don't know what the best course is to go here... > > > > It is rather strange that I have not seen this, since like I said one of my > > machines is running with witness enabled .. hmm.. > > > > Anyway.. advice from others how I should proceed would be welcome.. > > > > hashinit_x() or an sctp specific hash_init?? > > I think my preference would be to see a hashinit_flags() or the like, and have > a wait argument to that. I'd be tempted to give it a new name, like > HASH_WAITOK or such, in case we want to add other flags in the future. > > Remember to update hashinit(9). :-) Either that or use an sx lock to close the pcb alloc race instead and don't hold mutexes while calling hashinit(). > Robert N M Watson > Computer Laboratory > University of Cambridge > > > > > R > > > > Craig Rodrigues wrote: > >> Hi, > >> > >> I am running one of the SCTP tests in the ACE library, > >> and am getting the following witness warning. Any ideas what the cause > >> is? > >> > >> Thanks. > >> > >> malloc(M_WAITOK) of "1024", forcing M_NOWAIT with the following > >> non-sleepable locks held: > >> exclusive sleep mutex sctp-create (inp_create) r = 0 (0xc2ddded0) locked @ > >> /usr/src/sys/netinet/sctp_input.c:4006 > >> KDB: stack backtrace: > >> db_trace_self_wrapper(c09bf21a) at db_trace_self_wrapper+0x25 > >> kdb_backtrace(1,400,c146d5a0,6,cbd70148,...) at kdb_backtrace+0x29 > >> witness_warn(5,0,c09dac6c,c09701c9) at witness_warn+0x192 > >> uma_zalloc_arg(c146d5a0,0,2) at uma_zalloc_arg+0x41 > >> malloc(400,c0a50840,2,c28cf3e4,cbd701ac,...) at malloc+0xb2 > >> hashinit(100,c0a50840,c2dde80c,f1,c28cf3e4,...) at hashinit+0x3b > >> sctp_inpcb_alloc(c28cf3e4) at sctp_inpcb_alloc+0x143 > >> sctp_attach(c28cf3e4,0,0) at sctp_attach+0x34 > >> sonewconn(c28a9530,2,c2ddff48,0,c09cf2c5,839) at sonewconn+0x119 > >> sctp_handle_cookie_echo(c297e900,14,20,c297e948,cbd70390,cbd70bbc,cbd70bc0,cbd70c20,0,0,0,cbd70384) > >> at sctp_handle_cookie_echo+0x77e > >> sctp_process_control(c297e900,14,cbd70c08,1ac,c297e948,c297e954,c2dddc10,c2ddfa50,cbd70c20,cbd70be8) > >> at sctp_process_control+0xd89 > >> sctp_common_input_processing(cbd70c3c,14,20,1ac,c297e948,c297e954,c2dddc10,0,c2de1570,0) > >> at sctp_common_input_processing+0x72 > >> sctp_input(c297e900,14,ae,100007f,0,...) at sctp_input+0x2fa > >> ip_input(c297e900) at ip_input+0x5c5 > >> netisr_processqueue(c0af3658) at netisr_processqueue+0x6e > >> swi_net(0) at swi_net+0xc2 > >> ithread_execute_handlers(c210b6c0,c2129900) at > >> ithread_execute_handlers+0x11e > >> ithread_loop(c20ed960,cbd70d38) at ithread_loop+0x67 > >> fork_exit(c06bbd2c,c20ed960,cbd70d38) at fork_exit+0xac > >> fork_trampoline() at fork_trampoline+0x8 > >> > > > > > > -- > > Randall Stewart > > NSSTG - Cisco Systems Inc. > > 803-345-0369 803-317-4952 (cell) > > _______________________________________________ > > freebsd-current@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-current > > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > -- John Baldwin