Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 09 Feb 2020 21:36:35 -0800
From:      Cy Schubert <Cy.Schubert@cschubert.com>
To:        "O. Hartmann" <o.hartmann@walstatt.org>
Cc:        Scott Long <scottl@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r357710 - in head/sys: cam/ata cam/nvme cam/scsi  ufs/ffs
Message-ID:  <202002100536.01A5aakV073830@slippy.cwsent.com>
In-Reply-To: <20200210060145.6920e8f5@thor.intern.walstatt.dynvpn.de>
References:  <202002100023.01A0NKmY053556@repo.freebsd.org>  <20200210060145.6920e8f5@thor.intern.walstatt.dynvpn.de>

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20200210060145.6920e8f5@thor.intern.walstatt.dynvpn.de>, "O. 
Hartma
nn" writes:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Am Mon, 10 Feb 2020 00:23:20 +0000 (UTC)
> Scott Long <scottl@FreeBSD.org> schrieb:
>
> > Author: scottl
> > Date: Mon Feb 10 00:23:20 2020
> > New Revision: 357710
> > URL: https://svnweb.freebsd.org/changeset/base/357710
> > 
> > Log:
> >   Add rudamentary support for UFS to probe whether a block device supports 
> the
> >   BIO_SPEEDUP command.  Add complimentary support to the CAM periphs that
> >   support it.
> > 
> > Modified:
> >   head/sys/cam/ata/ata_da.c
> >   head/sys/cam/nvme/nvme_da.c
> >   head/sys/cam/scsi/scsi_da.c
> >   head/sys/ufs/ffs/ffs_softdep.c
> >   head/sys/ufs/ffs/ffs_vfsops.c
> > 
> > Modified: head/sys/cam/ata/ata_da.c
> > ===========================================================================
> ===
> > --- head/sys/cam/ata/ata_da.c	Mon Feb 10 00:05:04 2020	(r35770
> 9)
> > +++ head/sys/cam/ata/ata_da.c	Mon Feb 10 00:23:20 2020	(r35771
> 0)
> > @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
> >  #include <sys/proc.h>
> >  #include <sys/reboot.h>
> >  #include <sys/sbuf.h>
> > +#include <geom/geom.h>
> >  #include <geom/geom_disk.h>
> >  #endif /* _KERNEL */
> >  
> > @@ -1565,6 +1566,10 @@ adagetattr(struct bio *bp)
> >  {
> >  	int ret;
> >  	struct cam_periph *periph;
> > +
> > +	/* TODO: tunable knob */
> > +	if (g_handleattr_int(bp, "GEOM::canspeedup", 1))
> > +		return (0);
> >  
> >  	periph = (struct cam_periph *)bp->bio_disk->d_drv1;
> >  	cam_periph_lock(periph);
> > 
> > Modified: head/sys/cam/nvme/nvme_da.c
> > ===========================================================================
> ===
> > --- head/sys/cam/nvme/nvme_da.c	Mon Feb 10 00:05:04 2020	(r35770
> 9)
> > +++ head/sys/cam/nvme/nvme_da.c	Mon Feb 10 00:23:20 2020	(r35771
> 0)
> > @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$");
> >  #include <sys/cons.h>
> >  #include <sys/proc.h>
> >  #include <sys/reboot.h>
> > +#include <geom/geom.h>
> >  #include <geom/geom_disk.h>
> >  #endif /* _KERNEL */
> >  
> > @@ -699,6 +700,10 @@ ndagetattr(struct bio *bp)
> >  {
> >  	int ret;
> >  	struct cam_periph *periph;
> > +
> > +	/* TODO: tunable knob */
> > +	if (g_handleattr_int(bp, "GEOM::canspeedup", 1))
> > +		return (0);
> >  
> >  	periph = (struct cam_periph *)bp->bio_disk->d_drv1;
> >  	cam_periph_lock(periph);
> > 
> > Modified: head/sys/cam/scsi/scsi_da.c
> > ===========================================================================
> ===
> > --- head/sys/cam/scsi/scsi_da.c	Mon Feb 10 00:05:04 2020	(r35770
> 9)
> > +++ head/sys/cam/scsi/scsi_da.c	Mon Feb 10 00:23:20 2020	(r35771
> 0)
> > @@ -1942,6 +1942,10 @@ dagetattr(struct bio *bp)
> >  	int ret;
> >  	struct cam_periph *periph;
> >  
> > +	/* TODO: tunable knob for this */
> > +	if (g_handleattr_int(bp, "GEOM::canspeedup", 1))
> > +		return (0);
> > +
> >  	periph = (struct cam_periph *)bp->bio_disk->d_drv1;
> >  	cam_periph_lock(periph);
> >  	ret = xpt_getattr(bp->bio_data, bp->bio_length, bp->bio_attribute,
> > 
> > Modified: head/sys/ufs/ffs/ffs_softdep.c
> > ===========================================================================
> ===
> > --- head/sys/ufs/ffs/ffs_softdep.c	Mon Feb 10 00:05:04 2020	(r35770
> 9)
> > +++ head/sys/ufs/ffs/ffs_softdep.c	Mon Feb 10 00:23:20 2020	(r35771
> 0)
> > @@ -1464,6 +1464,9 @@ softdep_send_speedup(struct ufsmount *ump, size_t sho
> r
> >  {
> >  	struct buf *bp;
> >  
> > +	if ((ump->um_flags & UM_CANSPEEDUP) == 0)
> > +		return;
> > +
> >  	bp = malloc(sizeof(*bp), M_TRIM, M_WAITOK | M_ZERO);
> >  	bp->b_iocmd = BIO_SPEEDUP;
> >  	bp->b_ioflags = flags;
> > 
> > Modified: head/sys/ufs/ffs/ffs_vfsops.c
> > ===========================================================================
> ===
> > --- head/sys/ufs/ffs/ffs_vfsops.c	Mon Feb 10 00:05:04 2020	(r35770
> 9)
> > +++ head/sys/ufs/ffs/ffs_vfsops.c	Mon Feb 10 00:23:20 2020	(r35771
> 0)
> > @@ -794,7 +794,7 @@ ffs_mountfs(devvp, mp, td)
> >  	struct ucred *cred;
> >  	struct g_consumer *cp;
> >  	struct mount *nmp;
> > -	int candelete;
> > +	int candelete, canspeedup;
> >  	off_t loc;
> >  
> >  	fs = NULL;
> > @@ -1009,6 +1009,13 @@ ffs_mountfs(devvp, mp, td)
> >  			ump->um_trimhash = hashinit(MAXTRIMIO, M_TRIM,
> >  			    &ump->um_trimlisthashsize);
> >  		}
> > +	}
> > +
> > +	/* TODO: sysctl tunables, runtime modification */
> > +	len = sizeof(int);
> > +	if (g_io_getattr("GEOM::canspeedup", cp, &len, &canspeedup) == 0) {
> > +		if (canspeedup)
> > +			ump->um_flags |= UM_CANSPEEDUP;
> >  	}
> >  
> >  	ump->um_mountp = mp;
> > _______________________________________________
> > svn-src-head@freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/svn-src-head
> > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org"
>
> It seems that this commit makes our systems to hang at the point, when trying
>  to mount the
> root partition, last seen message on console is:
>
> [...]
> mountroot: waiting for device /dev/gpt/root...
>
>
> The root partitions on those systems resides on UFS2 formated SSDs (if this h
> as any relevance).

What does fstab have to mount root?

Mine that work use gmirror:

/dev/mirror/gm0a                        /               ufs     rw 1 1

The machines that hang use:

/dev/ada0s1a            /               ufs     rw 1 1
or a disk with a UFS label (essentially the same thing).


-- 
Cheers,
Cy Schubert <Cy.Schubert@cschubert.com>
FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  http://www.FreeBSD.org

	The need of the many outweighs the greed of the few.





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