From owner-freebsd-current@FreeBSD.ORG Sun Jul 8 02:48:29 2007 Return-Path: X-Original-To: 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 5F36D16A400 for ; Sun, 8 Jul 2007 02:48:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay02.kiev.sovam.com (relay02.kiev.sovam.com [62.64.120.197]) by mx1.freebsd.org (Postfix) with ESMTP id E4DE813C45B for ; Sun, 8 Jul 2007 02:48:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [89.162.146.170] (helo=skuns.kiev.zoral.com.ua) by relay02.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1I7Moy-000NeA-R2 for current@freebsd.org; Sun, 08 Jul 2007 05:48:27 +0300 Received: from deviant.kiev.zoral.com.ua (root@[10.1.1.148]) by skuns.kiev.zoral.com.ua (8.14.1/8.14.1) with ESMTP id l682mGXD045293 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 Jul 2007 05:48:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.1/8.14.1) with ESMTP id l682mGQ1037589; Sun, 8 Jul 2007 05:48:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.1/8.14.1/Submit) id l682mFXK037588; Sun, 8 Jul 2007 05:48:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 8 Jul 2007 05:48:15 +0300 From: Kostik Belousov To: Tai-hwa Liang Message-ID: <20070708024815.GK2200@deviant.kiev.zoral.com.ua> References: <20070703180141.GJ2200@deviant.kiev.zoral.com.ua> <20070705144443.GV2200@deviant.kiev.zoral.com.ua> <20070707160042.GJ2200@deviant.kiev.zoral.com.ua> <07070809441413.59322@www.mmlab.cse.yzu.edu.tw> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YhYebsMuj/FQeBW/" Content-Disposition: inline In-Reply-To: <07070809441413.59322@www.mmlab.cse.yzu.edu.tw> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.90.3, clamav-milter version 0.90.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.2.1 X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on skuns.kiev.zoral.com.ua X-Scanner-Signature: c6fa9c03b00bb8e85b0a425727b89505 X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 1190 [July 06 2007] X-SpamTest-Info: helo_type=3 X-SpamTest-Method: none X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release Cc: Kostik Belousov , Jiawei Ye , current@freebsd.org Subject: Re: HEADS UP: destroy_dev_sched() KPI in the tree 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: Sun, 08 Jul 2007 02:48:29 -0000 --YhYebsMuj/FQeBW/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 08, 2007 at 09:47:41AM +0800, Tai-hwa Liang wrote: > On Sat, 7 Jul 2007, Kostik Belousov wrote: > >On Sat, Jul 07, 2007 at 08:36:23PM +0800, Jiawei Ye wrote: > >>On 7/5/07, Kostik Belousov wrote: > >>> > >>>Today, I reverted the part of commit that tried to transform=20 > >>>destroy_dev() > >>>from d_close() into destroy_dev_sched(). See kern_conf.c, rev. 1.208. > >>>You shall call destroy_dev_sched() explicitely. > >>> > >>> > >>Does this mean that mount_smbfs has to explicitly call it now? It is > >>currently stuck in the devdrn state with the latest kernel :( > >> > >>Jiawei Ye > >Exactly. Patch by Tai-hwa Liang is pending. I also remember that sg(4) >=20 > I'll ask for re@'s approval tomorrow. Hopefully the new KPI would have > more exposure before my patch is committed. >=20 > >had the same problem, but I do not know it current status. >=20 > Though it was reviewed before destroy_dev_sched() KPI enters to the tre= e, > I'd be appreciate it if you can reviewed the attached patch again. So, this is still the problem for scsi_targ ? It probably make sense to postpone free of softc until all threads finished using it. You may use destroy_dev_sched_cb() to run the function after the device is actually destroyed. It would just call free(). >=20 > --=20 > Cheers, >=20 > Tai-hwa Liang > --- cam/scsi/scsi_target.c.orig Wed May 2 11:42:46 2007 > +++ cam/scsi/scsi_target.c Wed May 2 11:43:11 2007 > @@ -210,7 +210,7 @@ targclose(struct cdev *dev, int flag, in > softc =3D (struct targ_softc *)dev->si_drv1; > if ((softc->periph =3D=3D NULL) || > (softc->state & TARG_STATE_LUN_ENABLED) =3D=3D 0) { > - destroy_dev(dev); > + destroy_dev_sched(dev); > FREE(softc, M_TARG); > return (0); > } > @@ -229,7 +229,7 @@ targclose(struct cdev *dev, int flag, in > cam_periph_invalidate(softc->periph); > softc->periph =3D NULL; > } > - destroy_dev(dev); > + destroy_dev_sched(dev); > FREE(softc, M_TARG); > } > cam_periph_unlock(periph); --YhYebsMuj/FQeBW/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFGkFBuC3+MBN1Mb4gRAqP3AKC2kvzmi5lrEM+BeO/z/5Nb47oW3QCg9KyY q5VX0+uqTTImA6IaXzninaU= =jlIc -----END PGP SIGNATURE----- --YhYebsMuj/FQeBW/--