From owner-svn-src-head@FreeBSD.ORG Thu May 21 13:43:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4E771065673; Thu, 21 May 2009 13:43:32 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-bw0-f165.google.com (mail-bw0-f165.google.com [209.85.218.165]) by mx1.freebsd.org (Postfix) with ESMTP id F22558FC26; Thu, 21 May 2009 13:43:31 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by bwz9 with SMTP id 9so1054650bwz.43 for ; Thu, 21 May 2009 06:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=lYftcZWETAEb+KMcDinhPByshaQrEqhEMKMsa4X6jVY=; b=lPfvo0R02qzA3O+HlXoOlB2N8DTkXY99u0RdSWbm8C+UsD12INk9HDLvSQ4Lnmyo7P uVvy35yPYWln4RBRiWGJHrixRvbW67NNzJLCZ8p747hnb7Sb+pUjbmVU0VR6YvxXvmqv wH7DiG899AbKDkxa00PQQQS87tOfjoOkPiQ8I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=QvnQPSVpofAejZDSBPyw4p49t78t0BK1+PsDvkJzTwJmNZ9uAN/tISBcPbesZa1iyZ EDjfBYSB2EsOo8Nmgm+vKbbbSYRIXOE1KmA9Y/MmHV4ja0rkwUziCXUNIzdAJO5GFFRX D8sJNd8PvUh2WpX3pmRCoC4FWn/RF7PgNEmyc= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.127.8 with SMTP id e8mr1621819fas.95.1242913410768; Thu, 21 May 2009 06:43:30 -0700 (PDT) In-Reply-To: <20090521133634.GK1927@deviant.kiev.zoral.com.ua> References: <200905211322.n4LDM73t067924@svn.freebsd.org> <20090521132641.GJ1927@deviant.kiev.zoral.com.ua> <3bbf2fe10905210629p46c7a204v6863aaba77354462@mail.gmail.com> <20090521133634.GK1927@deviant.kiev.zoral.com.ua> Date: Thu, 21 May 2009 15:43:30 +0200 X-Google-Sender-Auth: 60ebcc995a163298 Message-ID: <3bbf2fe10905210643y103d500eqcf16aeebe32187d1@mail.gmail.com> From: Attilio Rao To: Kostik Belousov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r192535 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 13:43:33 -0000 2009/5/21 Kostik Belousov : > On Thu, May 21, 2009 at 03:29:57PM +0200, Attilio Rao wrote: >> 2009/5/21 Kostik Belousov : >> > On Thu, May 21, 2009 at 01:22:07PM +0000, Attilio Rao wrote: >> >> Author: attilio >> >> Date: Thu May 21 13:22:07 2009 >> >> New Revision: 192535 >> >> URL: http://svn.freebsd.org/changeset/base/192535 >> >> >> >> Log: >> >> Move the M_WAITOK flag in notify() into an M_NOWAIT one in order to match >> >> the behaviour alredy present with the further malloc() call in >> >> devctl_notify(). >> >> This fixes a bug in the CAM layer where the camisr handler finished to >> >> call camperiphfree() (and subsequently destroy_dev() resulting in a new >> >> dev notify) while the xpt lock is held. >> > This is wrong. You cannot call destroy_dev() while holding any mutex. >> > Taking this into account, it makes no sense to use M_NOWAIT in notify(). >> >> As long as devctl_notify() also calls M_NOWAIT and if not available >> skips "silently" it just does the same thing, I think this approach is >> more consistent. > M_NOWAIT currently uses system reserve for page allocation, > so less it is used, the better. > >> >> It remains, though, the fact to fix CAM when calling destroy_dev(). >> Maybe we should add a witness_warn() there? > > Destroy_dev already has the warning, see line 853. Oh, but this is not present in 7.2 (that's why the assertion wasn't going to be hit). Maybe you can MFC it? Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein