Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Jul 2007 05:48:15 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Tai-hwa Liang <avatar@mmlab.cse.yzu.edu.tw>
Cc:        Kostik Belousov <kostikbel@gmail.com>, Jiawei Ye <leafy7382@gmail.com>, current@freebsd.org
Subject:   Re: HEADS UP: destroy_dev_sched() KPI in the tree
Message-ID:  <20070708024815.GK2200@deviant.kiev.zoral.com.ua>
In-Reply-To: <07070809441413.59322@www.mmlab.cse.yzu.edu.tw>
References:  <20070703180141.GJ2200@deviant.kiev.zoral.com.ua> <E1I6SAN-0000by-Bt@cs1.cs.huji.ac.il> <20070705144443.GV2200@deviant.kiev.zoral.com.ua> <c21e92e20707070536x6c8053c0l7ecad5a5bfa6de15@mail.gmail.com> <20070707160042.GJ2200@deviant.kiev.zoral.com.ua> <07070809441413.59322@www.mmlab.cse.yzu.edu.tw>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <kostikbel@gmail.com> 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/--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070708024815.GK2200>