svn commit: r351926 - head/sys/fs/ext2fs
Author: cem Date: Fri Sep 6 08:07:12 2019 New Revision: 351926 URL: https://svnweb.freebsd.org/changeset/base/351926 Log: ext2fs: Remove redundant brelse() after r294954 Coccinelle: @ rule1 @ identifier __error; @@ ... int __error; ... @ rule2 depends on rule1 @ identifier rule1.__error; identifier __bp; @@ __error = ( bread | bread_gb | breadn | breadn_flags ) (..., &__bp); if ( ( __error | __error != 0 ) ) { ... - brelse(__bp); ... } No functional change. Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_balloc.c head/sys/fs/ext2fs/ext2_extattr.c head/sys/fs/ext2fs/ext2_extents.c head/sys/fs/ext2fs/ext2_vfsops.c Modified: head/sys/fs/ext2fs/ext2_alloc.c == --- head/sys/fs/ext2fs/ext2_alloc.c Fri Sep 6 05:34:31 2019 (r351925) +++ head/sys/fs/ext2fs/ext2_alloc.c Fri Sep 6 08:07:12 2019 (r351926) @@ -1313,7 +1313,6 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr e2fs_gd_get_i_bitmap(&fs->e2fs_gd[cg])), (int)fs->e2fs_bsize, NOCRED, &bp); if (error) { - brelse(bp); EXT2_LOCK(ump); return (0); } @@ -1417,7 +1416,6 @@ ext2_blkfree(struct inode *ip, e4fs_daddr_t bno, long fsbtodb(fs, e2fs_gd_get_b_bitmap(&fs->e2fs_gd[cg])), (int)fs->e2fs_bsize, NOCRED, &bp); if (error) { - brelse(bp); return; } bbp = (char *)bp->b_data; @@ -1464,7 +1462,6 @@ ext2_vfree(struct vnode *pvp, ino_t ino, int mode) fsbtodb(fs, e2fs_gd_get_i_bitmap(&fs->e2fs_gd[cg])), (int)fs->e2fs_bsize, NOCRED, &bp); if (error) { - brelse(bp); return (0); } ibp = (char *)bp->b_data; Modified: head/sys/fs/ext2fs/ext2_balloc.c == --- head/sys/fs/ext2fs/ext2_balloc.cFri Sep 6 05:34:31 2019 (r351925) +++ head/sys/fs/ext2fs/ext2_balloc.cFri Sep 6 08:07:12 2019 (r351926) @@ -78,7 +78,6 @@ ext2_ext_balloc(struct inode *ip, uint32_t lbn, int si } else { error = bread(vp, lbn, fs->e2fs_bsize, NOCRED, &bp); if (error) { - brelse(bp); return (error); } } @@ -142,7 +141,6 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size if (nb != 0) { error = bread(vp, lbn, fs->e2fs_bsize, NOCRED, &bp); if (error) { - brelse(bp); return (error); } bp->b_blkno = fsbtodb(fs, nb); @@ -219,7 +217,6 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size error = bread(vp, indirs[i].in_lbn, (int)fs->e2fs_bsize, NOCRED, &bp); if (error) { - brelse(bp); return (error); } bap = (e2fs_daddr_t *)bp->b_data; Modified: head/sys/fs/ext2fs/ext2_extattr.c == --- head/sys/fs/ext2fs/ext2_extattr.c Fri Sep 6 05:34:31 2019 (r351925) +++ head/sys/fs/ext2fs/ext2_extattr.c Fri Sep 6 08:07:12 2019 (r351926) @@ -280,7 +280,6 @@ ext2_extattr_block_list(struct inode *ip, int attrname error = bread(ip->i_devvp, fsbtodb(fs, ip->i_facl), fs->e2fs_bsize, NOCRED, &bp); if (error) { - brelse(bp); return (error); } @@ -421,7 +420,6 @@ ext2_extattr_block_get(struct inode *ip, int attrnames error = bread(ip->i_devvp, fsbtodb(fs, ip->i_facl), fs->e2fs_bsize, NOCRED, &bp); if (error) { - brelse(bp); return (error); } @@ -681,7 +679,6 @@ ext2_extattr_block_delete(struct inode *ip, int attrna error = bread(ip->i_devvp, fsbtodb(fs, ip->i_facl), fs->e2fs_bsize, NOCRED, &bp); if (error) { - brelse(bp); return (error); } @@ -1074,7 +1071,6 @@ ext2_extattr_block_set(struct inode *ip, int attrnames error = bread(ip->i_devvp, fsbtodb(fs, ip->i_facl), fs->e2fs_bsize, NOCRED, &bp); if (error) { - brelse(bp); return (error); } @@ -1221,7 +1217,6 @@ int ext2_extattr_free(struct inode *ip) error = bread(ip->i_devvp, fsbtodb(fs, ip->i_facl), fs->e2fs_bsize, NOCRED, &bp); if (error) { - brelse(bp); return (error); } Modified: head/sys/fs/ext2fs/ext2_extents
svn commit: r351927 - head/sys/fs/cd9660
Author: cem Date: Fri Sep 6 08:07:36 2019 New Revision: 351927 URL: https://svnweb.freebsd.org/changeset/base/351927 Log: cd9660: Remove redundant brelse() after r294954 Same automation. No functional change. Modified: head/sys/fs/cd9660/cd9660_vfsops.c head/sys/fs/cd9660/cd9660_vnops.c Modified: head/sys/fs/cd9660/cd9660_vfsops.c == --- head/sys/fs/cd9660/cd9660_vfsops.c Fri Sep 6 08:07:12 2019 (r351926) +++ head/sys/fs/cd9660/cd9660_vfsops.c Fri Sep 6 08:07:36 2019 (r351927) @@ -753,7 +753,6 @@ cd9660_vget_internal(mp, ino, flags, vpp, relocated, i imp->logical_block_size, NOCRED, &bp); if (error) { vput(vp); - brelse(bp); printf("fhtovp: bread error %d\n",error); return (error); } Modified: head/sys/fs/cd9660/cd9660_vnops.c == --- head/sys/fs/cd9660/cd9660_vnops.c Fri Sep 6 08:07:12 2019 (r351926) +++ head/sys/fs/cd9660/cd9660_vnops.c Fri Sep 6 08:07:36 2019 (r351927) @@ -689,7 +689,6 @@ cd9660_readlink(ap) (imp->im_bshift - DEV_BSHIFT), imp->logical_block_size, NOCRED, &bp); if (error) { - brelse(bp); return (EINVAL); } ___ 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-unsubscr...@freebsd.org"
svn commit: r351928 - head/sys/fs/msdosfs
Author: cem Date: Fri Sep 6 08:08:10 2019 New Revision: 351928 URL: https://svnweb.freebsd.org/changeset/base/351928 Log: msdosfs: Remove redundant brelse() after r294954 Same automation. No functional change. Modified: head/sys/fs/msdosfs/msdosfs_fat.c head/sys/fs/msdosfs/msdosfs_lookup.c head/sys/fs/msdosfs/msdosfs_vfsops.c head/sys/fs/msdosfs/msdosfs_vnops.c Modified: head/sys/fs/msdosfs/msdosfs_fat.c == --- head/sys/fs/msdosfs/msdosfs_fat.c Fri Sep 6 08:07:36 2019 (r351927) +++ head/sys/fs/msdosfs/msdosfs_fat.c Fri Sep 6 08:08:10 2019 (r351928) @@ -202,7 +202,6 @@ pcbmap(struct denode *dep, u_long findcn, daddr_t *bnp brelse(bp); error = bread(pmp->pm_devvp, bn, bsize, NOCRED, &bp); if (error) { - brelse(bp); return (error); } bp_bn = bn; @@ -504,7 +503,6 @@ fatentry(int function, struct msdosfsmount *pmp, u_lon fatblock(pmp, byteoffset, &bn, &bsize, &bo); error = bread(pmp->pm_devvp, bn, bsize, NOCRED, &bp); if (error) { - brelse(bp); return (error); } @@ -587,7 +585,6 @@ fatchain(struct msdosfsmount *pmp, u_long start, u_lon fatblock(pmp, byteoffset, &bn, &bsize, &bo); error = bread(pmp->pm_devvp, bn, bsize, NOCRED, &bp); if (error) { - brelse(bp); return (error); } while (count > 0) { @@ -843,7 +840,6 @@ freeclusterchain(struct msdosfsmount *pmp, u_long clus updatefats(pmp, bp, lbn); error = bread(pmp->pm_devvp, bn, bsize, NOCRED, &bp); if (error) { - brelse(bp); MSDOSFS_UNLOCK_MP(pmp); return (error); } Modified: head/sys/fs/msdosfs/msdosfs_lookup.c == --- head/sys/fs/msdosfs/msdosfs_lookup.cFri Sep 6 08:07:36 2019 (r351927) +++ head/sys/fs/msdosfs/msdosfs_lookup.cFri Sep 6 08:08:10 2019 (r351928) @@ -234,7 +234,6 @@ msdosfs_lookup_(struct vnode *vdp, struct vnode **vpp, } error = bread(pmp->pm_devvp, bn, blsize, NOCRED, &bp); if (error) { - brelse(bp); return (error); } for (blkoff = 0; blkoff < blsize; @@ -681,7 +680,6 @@ createde(struct denode *dep, struct denode *ddep, stru error = bread(pmp->pm_devvp, bn, blsize, NOCRED, &bp); if (error) { - brelse(bp); return error; } ndep = bptoep(pmp, bp, ddep->de_fndoffset); @@ -747,7 +745,6 @@ dosdirempty(struct denode *dep) } error = bread(pmp->pm_devvp, bn, blsize, NOCRED, &bp); if (error) { - brelse(bp); return (0); } for (dentp = (struct direntry *)bp->b_data; @@ -960,7 +957,6 @@ removede(struct denode *pdep, struct denode *dep) return error; error = bread(pmp->pm_devvp, bn, blsize, NOCRED, &bp); if (error) { - brelse(bp); return error; } ep = bptoep(pmp, bp, offset); @@ -1037,7 +1033,6 @@ uniqdosname(struct denode *dep, struct componentname * } error = bread(pmp->pm_devvp, bn, blsize, NOCRED, &bp); if (error) { - brelse(bp); return error; } for (dentp = (struct direntry *)bp->b_data; Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c == --- head/sys/fs/msdosfs/msdosfs_vfsops.cFri Sep 6 08:07:36 2019 (r351927) +++ head/sys/fs/msdosfs/msdosfs_vfsops.cFri Sep 6 08:08:10 2019 (r351928) @@ -862,7 +862,6 @@ msdosfs_fsiflush(struct msdosfsmount *pmp, int waitfor error = bread(pmp->pm_devvp, pmp->pm_fsinfo, pmp->pm_BytesPerSec, NOCRED, &bp); if (error != 0) { - brelse(bp); goto unlock; } fp = (struct fsinfo *)bp->b_data; Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ==
svn commit: r351929 - head/sys/ufs/ffs
Author: cem Date: Fri Sep 6 08:08:33 2019 New Revision: 351929 URL: https://svnweb.freebsd.org/changeset/base/351929 Log: ufs: Remove redundant brelse() after r294954 Same automation. No functional change. Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_subr.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_alloc.c == --- head/sys/ufs/ffs/ffs_alloc.cFri Sep 6 08:08:10 2019 (r351928) +++ head/sys/ufs/ffs/ffs_alloc.cFri Sep 6 08:08:33 2019 (r351929) @@ -300,7 +300,6 @@ retry: */ error = bread_gb(vp, lbprev, osize, NOCRED, gbflags, &bp); if (error) { - brelse(bp); return (error); } Modified: head/sys/ufs/ffs/ffs_balloc.c == --- head/sys/ufs/ffs/ffs_balloc.c Fri Sep 6 08:08:10 2019 (r351928) +++ head/sys/ufs/ffs/ffs_balloc.c Fri Sep 6 08:08:33 2019 (r351929) @@ -173,7 +173,6 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, i if (nb != 0 && ip->i_size >= smalllblktosize(fs, lbn + 1)) { error = bread(vp, lbn, fs->fs_bsize, NOCRED, &bp); if (error) { - brelse(bp); return (error); } bp->b_blkno = fsbtodb(fs, nb); @@ -189,7 +188,6 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, i if (nsize <= osize) { error = bread(vp, lbn, osize, NOCRED, &bp); if (error) { - brelse(bp); return (error); } bp->b_blkno = fsbtodb(fs, nb); @@ -292,7 +290,6 @@ retry: error = bread(vp, indirs[i].in_lbn, (int)fs->fs_bsize, NOCRED, &bp); if (error) { - brelse(bp); goto fail; } bap = (ufs1_daddr_t *)bp->b_data; @@ -665,7 +662,6 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, i error = bread_gb(vp, -1 - lbn, fs->fs_bsize, NOCRED, gbflags, &bp); if (error) { - brelse(bp); return (error); } bp->b_blkno = fsbtodb(fs, nb); @@ -683,7 +679,6 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, i error = bread_gb(vp, -1 - lbn, osize, NOCRED, gbflags, &bp); if (error) { - brelse(bp); return (error); } bp->b_blkno = fsbtodb(fs, nb); @@ -771,7 +766,6 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, i error = bread_gb(vp, lbn, fs->fs_bsize, NOCRED, gbflags, &bp); if (error) { - brelse(bp); return (error); } bp->b_blkno = fsbtodb(fs, nb); @@ -788,7 +782,6 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, i error = bread_gb(vp, lbn, osize, NOCRED, gbflags, &bp); if (error) { - brelse(bp); return (error); } bp->b_blkno = fsbtodb(fs, nb); @@ -892,7 +885,6 @@ retry: error = bread(vp, indirs[i].in_lbn, (int)fs->fs_bsize, NOCRED, &bp); if (error) { - brelse(bp); goto fail; } bap = (ufs2_daddr_t *)bp->b_data; Modified: head/sys/ufs/ffs/ffs_snapshot.c == --- head/sys/ufs/ffs/ffs_snapshot.c Fri Sep 6 08:08:10 2019 (r351928) +++ head/sys/ufs/ffs/ffs_snapshot.c Fri Sep 6 08:08:33 2019 (r351929) @@ -789,7 +789,6 @@ out1: for (loc = 0; loc < len; loc++) { error = bread(vp, blkno + loc, fs->fs_bsize, KERNCRED, &nbp); if (error) { - brelse(nbp); fs->fs_snapinum[snaploc] = 0; free(snapblklist, M_UFSMNT);
Re: svn commit: r351831 - in head: . stand/efi/boot1 stand/efi/gptboot tools/build/mk
> On 4 Sep 2019, at 21:55, Rebecca Cran wrote: > > Author: bcran > Date: Wed Sep 4 20:55:48 2019 > New Revision: 351831 > URL: https://svnweb.freebsd.org/changeset/base/351831 > > Log: > The efifat files are no longer used: remove the code to build them I use them in a Jenkins instance to test arm64. I specifically don’t give the Jenkins user any root access so am unable to use mdconfig to create the ESP image. I would use makefs however support for generating fat images hasn’t made it into a release yet, and it doesn’t build on 12 as many needed structs are protected by _KERNEL. I don’t care about the image being installed, but would like to be able to generate it when needed on the latest 12 release without needing root access. Andrew ___ 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-unsubscr...@freebsd.org"
svn commit: r351930 - in head: share/man/man4 sys/dev/acpi_support
Author: takawata Date: Fri Sep 6 10:12:05 2019 New Revision: 351930 URL: https://svnweb.freebsd.org/changeset/base/351930 Log: Add embedded Managed Object Format blob access to acpi_wmi(4). This blob is can be converted to human readable form by bmfdec. (http://github.com/pali/bmfdec) Differential Revision:https://reviews.freebsd.org/D21529 Modified: head/share/man/man4/acpi_wmi.4 head/sys/dev/acpi_support/acpi_wmi.c Modified: head/share/man/man4/acpi_wmi.4 == --- head/share/man/man4/acpi_wmi.4 Fri Sep 6 08:08:33 2019 (r351929) +++ head/share/man/man4/acpi_wmi.4 Fri Sep 6 10:12:05 2019 (r351930) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2011 +.Dd Sep 5, 2019 .Dt ACPI_WMI 4 .Os .Sh NAME @@ -56,6 +56,15 @@ information about GUIDs found in the system. .It Pa /dev/wmistat%d WMI status device. .El +.Sh SYSCTLS +The following sysctl node is currently implemented: +.Bl -tag +.It Va dev.acpi_wmi.%d.bmof +Managed Object Format (MOF) blob. +You can obtain human readable output by bmf2mof in bmfdec tool. +(https://github.com/pali/bmfdec) +.El + .Sh EXAMPLES .Bd -literal # cat /dev/wmistat0 @@ -72,6 +81,20 @@ GUID INST EXPE METH S {8232DE3D-663D-4327-A8F4-E293ADB9BF05} 0 NO NO NO NOBG {8F1F6436-9F42-42C8-BADC-0E9424F20C9A} 0 NO NO NO NOBH {8F1F6435-9F42-42C8-BADC-0E9424F20C9A} 0 NO NO NO NOBI +# sysctl -b dev.acpi_wmi.0.bmof |bmf2mof +[abstract] +class Lenovo_BIOSElement { +}; + +[WMI, Dynamic, Provider("WMIProv"), WmiExpense(1), Description("Bios Setting"), +GUID("{51F5230E-9677-46cd-A1CF-C0B23EE34DB7}"), Locale("MS\\0x409")] +class Lenovo_BiosSetting : Lenovo_BiosElement { + [key, read] String InstanceName; +[read] Boolean Active; + [WmiDataId(1), Description("BIOS setting")] String CurrentSetting; + }; + ... + .Ed .Sh SEE ALSO .Xr acpi 4 @@ -91,6 +114,9 @@ Work has been inspired by the Linux acpi-wmi driver wr .Pp See http://www.microsoft.com/whdc/system/pnppwr/wmi/wmi-acpi.mspx for the specification of ACPI-WMI. +.Pp +MOF part has been inspired by the Linux wmi-bmof driver +written by Andy Lutomirski. .Pp This manual page was written by .An Michael Gmelin Aq Mt free...@grem.de . Modified: head/sys/dev/acpi_support/acpi_wmi.c == --- head/sys/dev/acpi_support/acpi_wmi.cFri Sep 6 08:08:33 2019 (r351929) +++ head/sys/dev/acpi_support/acpi_wmi.cFri Sep 6 10:12:05 2019 (r351930) @@ -62,6 +62,7 @@ ACPI_MODULE_NAME("ACPI_WMI"); #define ACPI_WMI_REGFLAG_METHOD0x2 /* GUID flag: Method call */ #define ACPI_WMI_REGFLAG_STRING0x4 /* GUID flag: String */ #define ACPI_WMI_REGFLAG_EVENT 0x8 /* GUID flag: Event */ +#define ACPI_WMI_BMOF_UUID "05901221-D566-11D1-B2F0-00A0C9062910" /* * acpi_wmi driver private structure @@ -74,6 +75,8 @@ struct acpi_wmi_softc { struct sbuf wmistat_sbuf; /* sbuf for /dev/wmistat output */ pid_t wmistat_open_pid; /* pid operating on /dev/wmistat */ int wmistat_bufptr; /* /dev/wmistat ptr to buffer position */ + char*mofbuf; + TAILQ_HEAD(wmi_info_list_head, wmi_info) wmi_info_list; }; @@ -274,6 +277,29 @@ acpi_wmi_attach(device_t dev) } ACPI_SERIAL_END(acpi_wmi); + if (acpi_wmi_provides_guid_string_method(dev, ACPI_WMI_BMOF_UUID)) { + ACPI_BUFFER out = { ACPI_ALLOCATE_BUFFER, NULL }; + ACPI_OBJECT *obj; + + device_printf(dev, "Embedded MOF found\n"); + status = acpi_wmi_get_block_method(dev, ACPI_WMI_BMOF_UUID, + 0, &out); + if (ACPI_SUCCESS(status)) { + obj = out.Pointer; + if (obj && obj->Type == ACPI_TYPE_BUFFER) { + SYSCTL_ADD_OPAQUE(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN( + device_get_sysctl_tree(dev)), + OID_AUTO, "bmof", + CTLFLAG_RD | CTLFLAG_MPSAFE, + obj->Buffer.Pointer, + obj->Buffer.Length, + "A", "MOF Blob"); + } + } + sc->mofbuf = out.Pointer; + } + if (ret == 0) { bus_generic_probe(dev); ret = bus_generic_attach(dev); @@ -321,6 +347,7 @@ acpi_wmi_detach(device_t dev) sc->wmistat_open_pid = 0; destroy_dev(sc->wmistat_dev_t); ret = 0; + AcpiOsFree(sc->mofbuf); } ACPI_SE
svn commit: r351931 - head/share/mk
Author: manu Date: Fri Sep 6 12:26:45 2019 New Revision: 351931 URL: https://svnweb.freebsd.org/changeset/base/351931 Log: pkgbase: r351861 didn't solve everything, we need to default to the utilities package too Modified: head/share/mk/bsd.files.mk Modified: head/share/mk/bsd.files.mk == --- head/share/mk/bsd.files.mk Fri Sep 6 10:12:05 2019(r351930) +++ head/share/mk/bsd.files.mk Fri Sep 6 12:26:45 2019(r351931) @@ -39,7 +39,7 @@ ${group}DIR?= BINDIR STAGE_SETS+= ${group:C,[/*],_,g} .if ${group} == "FILES" -FILESPACKAGE= ${PACKAGE} +FILESPACKAGE= ${PACKAGE:Uutilities} .endif .if defined(NO_ROOT) ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r351918 - head/sys/kern
On Fri, Sep 06, 2019 at 12:15:07PM +0800, Philip Paeps wrote: > On 2019-09-06 11:15:12 (+0800), Ian Lepore wrote: > > On Fri, 2019-09-06 at 01:19 +, Philip Paeps wrote: > >> Author: philip > >> Date: Fri Sep 6 01:19:31 2019 > >> New Revision: 351918 > >> URL: https://svnweb.freebsd.org/changeset/base/351918 > >> > >> Log: > >> riscv: default to HZ=100 > >> > >> Most current RISC-V development platforms are not fast enough to > >> benefit > >> from the increased granularity provided by HZ=1000. > >> > >> Sponsored by:Axiado > >> > >> Modified: > >> head/sys/kern/subr_param.c > >> > >> Modified: head/sys/kern/subr_param.c > >> = > >> = > >> --- head/sys/kern/subr_param.c Fri Sep 6 00:06:55 2019(r351 > >> 917) > >> +++ head/sys/kern/subr_param.c Fri Sep 6 01:19:31 2019(r351 > >> 918) > >> @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); > >> */ > >> > >> #ifndef HZ > >> -# if defined(__mips__) || defined(__arm__) > >> +# if defined(__mips__) || defined(__arm__) || defined(__riscv) > >> #define HZ 100 > >> # else > >> #define HZ 1000 > >> > > > > This seems like a bad idea. I've run a 90mhz armv4 chip with HZ=1000 > > and didn't notice any performance hit from doing so. Almost all arm > > kernel config files set HZ as an option, so that define doesn't do > > much for arm these days. It probably does still set HZ for various > > mips platforms. > > > > I would think 1000 is appropriate for anything modern running at > > 200mhz or more. > > > > Setting it to 100 has the bad side effect of making things like > > msleep(), tsleep(), and pause() (which show up in plenty of drivers) > > all have a minimum timeout of 10ms, which is a long long time on > > modern hardware. > > > > What benefit do you think you'll get from the lower number? > > On systems running at 10s of MHz (or slower, ick), with HZ=1000 you > spend an awful lot of time servicing the timer interrupt and not very > much time doing anything else. > > My rationale was that most RISC-V systems (including emulation and FPGA > prototypes) I've encountered are running slower than the tipping point > where HZ=1000 makes sense. With the default of HZ=100, faster > exceptions can still set HZ=1000 in their individual configs. > > When the RISC-V world evolves to having more actual silicon and fewer > slow prototypes, I definitely agree this default should be flipped again > for HZ=1000 by default and HZ=100 in the config files for the > exceptions. > Hi Philip I only worry about HiFive Unleashed board, which is the only real hardware available at the moment for community and it does not require this change (it is 1.5 GHz clock). With an amount of real silicons growing we may want to keep HZ set to 1000 in GENERIC soon-ish so users download/build the GENERIC image and have immediate fun. For FPGA I usually tune (increase) timer clock frequency locally in the DTS file based on the timing of a synthesized core. Ruslan ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r351918 - head/sys/kern
On Fri, 2019-09-06 at 12:15 +0800, Philip Paeps wrote: > On 2019-09-06 11:15:12 (+0800), Ian Lepore wrote: > > On Fri, 2019-09-06 at 01:19 +, Philip Paeps wrote: > > > Author: philip > > > Date: Fri Sep 6 01:19:31 2019 > > > New Revision: 351918 > > > URL: https://svnweb.freebsd.org/changeset/base/351918 > > > > > > Log: > > > riscv: default to HZ=100 > > > > > > Most current RISC-V development platforms are not fast enough > > > to > > > benefit > > > from the increased granularity provided by HZ=1000. > > > > > > Sponsored by: Axiado > > > > > > Modified: > > > head/sys/kern/subr_param.c > > > > > > Modified: head/sys/kern/subr_param.c > > > = > > > > > > = > > > --- head/sys/kern/subr_param.cFri Sep 6 00:06:55 2019( > > > r351 > > > 917) > > > +++ head/sys/kern/subr_param.cFri Sep 6 01:19:31 2019( > > > r351 > > > 918) > > > @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); > > > */ > > > > > > #ifndef HZ > > > -# if defined(__mips__) || defined(__arm__) > > > +# if defined(__mips__) || defined(__arm__) || defined(__riscv) > > > #define HZ 100 > > > # else > > > #define HZ 1000 > > > > > > > This seems like a bad idea. I've run a 90mhz armv4 chip with > > HZ=1000 > > and didn't notice any performance hit from doing so. Almost all > > arm > > kernel config files set HZ as an option, so that define doesn't do > > much for arm these days. It probably does still set HZ for > > various > > mips platforms. > > > > I would think 1000 is appropriate for anything modern running at > > 200mhz or more. > > > > Setting it to 100 has the bad side effect of making things like > > msleep(), tsleep(), and pause() (which show up in plenty of > > drivers) > > all have a minimum timeout of 10ms, which is a long long time on > > modern hardware. > > > > What benefit do you think you'll get from the lower number? > > On systems running at 10s of MHz (or slower, ick), with HZ=1000 you > spend an awful lot of time servicing the timer interrupt and not > very > much time doing anything else. > > My rationale was that most RISC-V systems (including emulation and > FPGA > prototypes) I've encountered are running slower than the tipping > point > where HZ=1000 makes sense. With the default of HZ=100, faster > exceptions can still set HZ=1000 in their individual configs. > > When the RISC-V world evolves to having more actual silicon and > fewer > slow prototypes, I definitely agree this default should be flipped > again > for HZ=1000 by default and HZ=100 in the config files for the > exceptions. > > Philip > Wait a second... are you saying that the riscv implementation doesn't support event timers and uses an old-style periodic tick based on HZ? I thought only ancient mips and armv5 systems still did that. Event timer based (so-called "tickless") systems only take timer interrupts when actually necessary -- either because something needs to wake up at that time, or just often enough to prevent timer rollovers, which is typically a number like 2 or 4 hz. -- Ian ___ 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-unsubscr...@freebsd.org"
svn commit: r351934 - in head/sys: netinet netinet/tcp_stacks sys
Author: rrs Date: Fri Sep 6 14:25:41 2019 New Revision: 351934 URL: https://svnweb.freebsd.org/changeset/base/351934 Log: This adds the final tweaks to LRO that will now allow me to add BBR. These changes make it so you can get an array of timestamps instead of a compressed ack/data segment. BBR uses this to aid with its delivery estimates. We also now (via Drew's suggestions) will not go to the expense of the tcb lookup if no stack registers to want this feature. If HPTS is not present the feature is not present either and you just get the compressed behavior. Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D21127 Modified: head/sys/netinet/tcp_lro.c head/sys/netinet/tcp_lro.h head/sys/netinet/tcp_stacks/rack_bbr_common.c head/sys/sys/mbuf.h Modified: head/sys/netinet/tcp_lro.c == --- head/sys/netinet/tcp_lro.c Fri Sep 6 12:29:51 2019(r351933) +++ head/sys/netinet/tcp_lro.c Fri Sep 6 14:25:41 2019(r351934) @@ -44,6 +44,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -56,11 +58,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include #include - +#include +#include #include #include @@ -79,11 +84,47 @@ static int tcp_lro_rx2(struct lro_ctrl *lc, struct mbu SYSCTL_NODE(_net_inet_tcp, OID_AUTO, lro, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TCP LRO"); +static long tcplro_stacks_wanting_mbufq = 0; +counter_u64_t tcp_inp_lro_direct_queue; +counter_u64_t tcp_inp_lro_wokeup_queue; +counter_u64_t tcp_inp_lro_compressed; +counter_u64_t tcp_inp_lro_single_push; +counter_u64_t tcp_inp_lro_locks_taken; +counter_u64_t tcp_inp_lro_sack_wake; + static unsignedtcp_lro_entries = TCP_LRO_ENTRIES; +static int32_t hold_lock_over_compress = 0; +SYSCTL_INT(_net_inet_tcp_lro, OID_AUTO, hold_lock, CTLFLAG_RW, +&hold_lock_over_compress, 0, +"Do we hold the lock over the compress of mbufs?"); SYSCTL_UINT(_net_inet_tcp_lro, OID_AUTO, entries, CTLFLAG_RDTUN | CTLFLAG_MPSAFE, &tcp_lro_entries, 0, "default number of LRO entries"); +SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, fullqueue, CTLFLAG_RD, +&tcp_inp_lro_direct_queue, "Number of lro's fully queued to transport"); +SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, wokeup, CTLFLAG_RD, +&tcp_inp_lro_wokeup_queue, "Number of lro's where we woke up transport via hpts"); +SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, compressed, CTLFLAG_RD, +&tcp_inp_lro_compressed, "Number of lro's compressed and sent to transport"); +SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, single, CTLFLAG_RD, +&tcp_inp_lro_single_push, "Number of lro's sent with single segment"); +SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, lockcnt, CTLFLAG_RD, +&tcp_inp_lro_locks_taken, "Number of lro's inp_wlocks taken"); +SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, sackwakeups, CTLFLAG_RD, +&tcp_inp_lro_sack_wake, "Number of wakeups caused by sack/fin"); +void +tcp_lro_reg_mbufq(void) +{ + atomic_fetchadd_long(&tcplro_stacks_wanting_mbufq, 1); +} + +void +tcp_lro_dereg_mbufq(void) +{ + atomic_fetchadd_long(&tcplro_stacks_wanting_mbufq, -1); +} + static __inline void tcp_lro_active_insert(struct lro_ctrl *lc, struct lro_head *bucket, struct lro_entry *le) @@ -162,6 +203,36 @@ tcp_lro_init_args(struct lro_ctrl *lc, struct ifnet *i return (0); } +static struct tcphdr * +tcp_lro_get_th(struct lro_entry *le, struct mbuf *m) +{ + struct ether_header *eh; + struct tcphdr *th = NULL; +#ifdef INET6 + struct ip6_hdr *ip6 = NULL; /* Keep compiler happy. */ +#endif +#ifdef INET + struct ip *ip4 = NULL; /* Keep compiler happy. */ +#endif + + eh = mtod(m, struct ether_header *); + switch (le->eh_type) { +#ifdef INET6 + case ETHERTYPE_IPV6: + ip6 = (struct ip6_hdr *)(eh + 1); + th = (struct tcphdr *)(ip6 + 1); + break; +#endif +#ifdef INET + case ETHERTYPE_IP: + ip4 = (struct ip *)(eh + 1); + th = (struct tcphdr *)(ip4 + 1); + break; +#endif + } + return (th); +} + void tcp_lro_free(struct lro_ctrl *lc) { @@ -192,7 +263,6 @@ tcp_lro_free(struct lro_ctrl *lc) lc->lro_mbuf_data = NULL; } -#ifdef TCP_LRO_UPDATE_CSUM static uint16_t tcp_lro_csum_th(struct tcphdr *th) { @@ -275,7 +345,6 @@ tcp_lro_rx_csum_fixup(struct lro_entry *le, void *l3hd return (c & 0x); } -#endif static void tcp_lro_rx_done(struct lro_ctrl *lc) @@ -297,7 +366,7 @@ tcp_lro_flush_inactive(struct lro_ctrl *lc, const stru if (LIST_EMPTY(&lc->lro_active)) return; - getmicrotime(&tv); + getmicrouptime(&tv); timevalsub(&tv, timeout); LIST_FOREACH_SA
svn commit: r351935 - head/sys/netipsec
Author: fabient Date: Fri Sep 6 14:30:23 2019 New Revision: 351935 URL: https://svnweb.freebsd.org/changeset/base/351935 Log: Fix broken window replay check that will allow old packet to be accepted. This was introduced in r309144. Submitted by: Jean-Francois HREN Approved by: ae@ MFC after:3 days Modified: head/sys/netipsec/ipsec.c Modified: head/sys/netipsec/ipsec.c == --- head/sys/netipsec/ipsec.c Fri Sep 6 14:25:41 2019(r351934) +++ head/sys/netipsec/ipsec.c Fri Sep 6 14:30:23 2019(r351935) @@ -1323,6 +1323,8 @@ ok: __func__, replay->overflow, ipsec_sa2str(sav, buf, sizeof(buf; } + + replay->count++; return (0); } ___ 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-unsubscr...@freebsd.org"
svn commit: r351936 - head/sbin/ggate/shared
Author: imp Date: Fri Sep 6 15:01:47 2019 New Revision: 351936 URL: https://svnweb.freebsd.org/changeset/base/351936 Log: Fix typo not -> nor and add 'the' because we are talking about specific flags and make the punctuation parallel between the three cases. Submitted by: Yoshihiro Ota-san Differential Revision: https://reviews.freebsd.org/D21530 Modified: head/sbin/ggate/shared/ggate.h Modified: head/sbin/ggate/shared/ggate.h == --- head/sbin/ggate/shared/ggate.h Fri Sep 6 14:30:23 2019 (r351935) +++ head/sbin/ggate/shared/ggate.h Fri Sep 6 15:01:47 2019 (r351936) @@ -47,8 +47,8 @@ #defineGGATE_FLAG_RDONLY 0x0001 #defineGGATE_FLAG_WRONLY 0x0002 /* - * If GGATE_FLAG_SEND not GGATE_FLAG_RECV flag is set, this is initial - * connection. + * If neither the GGATE_FLAG_SEND nor the GGATE_FLAG_RECV flag is + * set - this is initial connection. * If GGATE_FLAG_SEND flag is set - this is socket to send data. * If GGATE_FLAG_RECV flag is set - this is socket to receive data. */ ___ 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-unsubscr...@freebsd.org"
svn commit: r351937 - in head/sys: compat/linuxkpi/common/include/linux sys
Author: johalun Date: Fri Sep 6 15:43:53 2019 New Revision: 351937 URL: https://svnweb.freebsd.org/changeset/base/351937 Log: LinuxKPI: Improve sysfs support. - Add functions for creating and merging sysfs groups. - Add sysfs_streq function to compare strings ignoring newline from the sysctl userland call. - Add a call to sysfs_create_groups in device_add. - Remove duplicate header include. - Bump __FreeBSD_version. Reviewed by: hselasky Approved by: imp (mentor), hselasky MFC after:4 days Differential Revision:D21542 Modified: head/sys/compat/linuxkpi/common/include/linux/device.h head/sys/compat/linuxkpi/common/include/linux/sysfs.h head/sys/sys/param.h Modified: head/sys/compat/linuxkpi/common/include/linux/device.h == --- head/sys/compat/linuxkpi/common/include/linux/device.h Fri Sep 6 15:01:47 2019(r351936) +++ head/sys/compat/linuxkpi/common/include/linux/device.h Fri Sep 6 15:43:53 2019(r351937) @@ -40,7 +40,6 @@ #include #include #include -#include #include #include @@ -316,6 +315,10 @@ device_add(struct device *dev) dev->devt = makedev(0, device_get_unit(dev->bsddev)); } kobject_add(&dev->kobj, &dev->class->kobj, dev_name(dev)); + + if (dev->groups) + return (sysfs_create_groups(&dev->kobj, dev->groups)); + return (0); } Modified: head/sys/compat/linuxkpi/common/include/linux/sysfs.h == --- head/sys/compat/linuxkpi/common/include/linux/sysfs.h Fri Sep 6 15:01:47 2019(r351936) +++ head/sys/compat/linuxkpi/common/include/linux/sysfs.h Fri Sep 6 15:43:53 2019(r351937) @@ -175,6 +175,27 @@ sysfs_remove_files(struct kobject *kobj, const struct sysfs_remove_file(kobj, attrs[i]); } +static inline int +sysfs_create_group(struct kobject *kobj, const struct attribute_group *grp) +{ + struct attribute **attr; + struct sysctl_oid *oidp; + + /* Don't create the group node if grp->name is undefined. */ + if (grp->name) + oidp = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(kobj->oidp), + OID_AUTO, grp->name, CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, grp->name); + else + oidp = kobj->oidp; + for (attr = grp->attrs; *attr != NULL; attr++) { + SYSCTL_ADD_OID(NULL, SYSCTL_CHILDREN(oidp), OID_AUTO, + (*attr)->name, CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_MPSAFE, + kobj, (uintptr_t)*attr, sysctl_handle_attr, "A", ""); + } + + return (0); +} + static inline void sysfs_remove_group(struct kobject *kobj, const struct attribute_group *grp) { @@ -184,20 +205,40 @@ sysfs_remove_group(struct kobject *kobj, const struct } static inline int -sysfs_create_group(struct kobject *kobj, const struct attribute_group *grp) +sysfs_create_groups(struct kobject *kobj, const struct attribute_group **grps) { + int error = 0; + int i; + + for (i = 0; grps[i] && !error; i++) + error = sysfs_create_group(kobj, grps[i]); + while (error && --i >= 0) + sysfs_remove_group(kobj, grps[i]); + + return (error); +} + +static inline int +sysfs_merge_group(struct kobject *kobj, const struct attribute_group *grp) +{ + + /* Really expected behavior is to return failure if group exists. */ + return (sysfs_create_group(kobj, grp)); +} + +static inline void +sysfs_unmerge_group(struct kobject *kobj, const struct attribute_group *grp) +{ struct attribute **attr; struct sysctl_oid *oidp; - oidp = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(kobj->oidp), - OID_AUTO, grp->name, CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, grp->name); - for (attr = grp->attrs; *attr != NULL; attr++) { - SYSCTL_ADD_OID(NULL, SYSCTL_CHILDREN(oidp), OID_AUTO, - (*attr)->name, CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_MPSAFE, - kobj, (uintptr_t)*attr, sysctl_handle_attr, "A", ""); + SLIST_FOREACH(oidp, SYSCTL_CHILDREN(kobj->oidp), oid_link) { + if (strcmp(oidp->oid_name, grp->name) != 0) + continue; + for (attr = grp->attrs; *attr != NULL; attr++) { + sysctl_remove_name(oidp, (*attr)->name, 1, 1); + } } - - return (0); } static inline int @@ -222,6 +263,22 @@ sysfs_remove_dir(struct kobject *kobj) if (kobj->oidp == NULL) return; sysctl_remove_oid(kobj->oidp, 1, 1); +} + +static inline bool +sysfs_streq(const char *s1, const char *s2) +{ + int l1, l2; + + l1 = strlen(s1); + l2 = strlen(s2); + + if (l1 != 0 && s1[l1-1] == '\n') + l1--; + if (l2 != 0 && s2[l2-1] == '\n') +
svn commit: r351938 - head/contrib/llvm/lib/CodeGen
Author: dim Date: Fri Sep 6 16:06:37 2019 New Revision: 351938 URL: https://svnweb.freebsd.org/changeset/base/351938 Log: Pull in r37 from upstream llvm trunk (by Eli Friedman): [IfConversion] Fix diamond conversion with unanalyzable branches. The code was incorrectly counting the number of identical instructions, and therefore tried to predicate an instruction which should not have been predicated. This could have various effects: a compiler crash, an assembler failure, a miscompile, or just generating an extra, unnecessary instruction. Instead of depending on TargetInstrInfo::removeBranch, which only works on analyzable branches, just remove all branch instructions. Fixes https://bugs.llvm.org/show_bug.cgi?id=43121 and https://bugs.llvm.org/show_bug.cgi?id=41121 . Differential Revision: https://reviews.llvm.org/D67203 This should fix "Unable to predicate BX killed renamable $r0" errors when building the lang/spidermonkey170 and lang/spidermonkey38 ports for armv7 and armv6. PR: 236567 MFC after:3 days Modified: head/contrib/llvm/lib/CodeGen/IfConversion.cpp Modified: head/contrib/llvm/lib/CodeGen/IfConversion.cpp == --- head/contrib/llvm/lib/CodeGen/IfConversion.cpp Fri Sep 6 15:43:53 2019(r351937) +++ head/contrib/llvm/lib/CodeGen/IfConversion.cpp Fri Sep 6 16:06:37 2019(r351938) @@ -1759,9 +1759,15 @@ bool IfConverter::IfConvertDiamondCommon( if (!BBI1->IsBrAnalyzable) verifySameBranchInstructions(&MBB1, &MBB2); #endif - BBI1->NonPredSize -= TII->removeBranch(*BBI1->BB); - // Remove duplicated instructions. + // Remove duplicated instructions from the tail of MBB1: any branch + // instructions, and the common instructions counted by NumDups2. DI1 = MBB1.end(); + while (DI1 != MBB1.begin()) { +MachineBasicBlock::iterator Prev = std::prev(DI1); +if (!Prev->isBranch() && !Prev->isDebugInstr()) + break; +DI1 = Prev; + } for (unsigned i = 0; i != NumDups2; ) { // NumDups2 only counted non-dbg_value instructions, so this won't // run off the head of the list. ___ 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-unsubscr...@freebsd.org"
svn commit: r351939 - head/share/misc
Author: scottl Date: Fri Sep 6 17:06:48 2019 New Revision: 351939 URL: https://svnweb.freebsd.org/changeset/base/351939 Log: Add myself as a mentor for Scott Phillip (scottph) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot == --- head/share/misc/committers-src.dot Fri Sep 6 16:06:37 2019 (r351938) +++ head/share/misc/committers-src.dot Fri Sep 6 17:06:48 2019 (r351939) @@ -841,6 +841,7 @@ scottl -> jimharris scottl -> pjd scottl -> sah scottl -> sbruno +scottl -> scottph scottl -> slm scottl -> yongari ___ 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-unsubscr...@freebsd.org"
svn commit: r351950 - head/sys/netinet
Author: imp Date: Fri Sep 6 18:25:42 2019 New Revision: 351950 URL: https://svnweb.freebsd.org/changeset/base/351950 Log: Initialize if_hw_tsomaxsegsize to 0 to appease gcc's flow analysis as a fail-safe. Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c == --- head/sys/netinet/tcp_output.c Fri Sep 6 18:23:00 2019 (r351949) +++ head/sys/netinet/tcp_output.c Fri Sep 6 18:25:42 2019 (r351950) @@ -195,7 +195,7 @@ tcp_output(struct tcpcb *tp) uint32_t recwin, sendwin; int off, flags, error = 0; /* Keep compiler happy */ u_int if_hw_tsomaxsegcount = 0; - u_int if_hw_tsomaxsegsize; + u_int if_hw_tsomaxsegsize = 0; struct mbuf *m; struct ip *ip = NULL; #ifdef TCPDEBUG ___ 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-unsubscr...@freebsd.org"
svn commit: r351951 - head/sys/netinet
Author: rrs Date: Fri Sep 6 18:29:48 2019 New Revision: 351951 URL: https://svnweb.freebsd.org/changeset/base/351951 Log: This adds in the missing counter initialization which I had forgotten to bring over.. opps. Differential Revision: https://reviews.freebsd.org/D21127 Modified: head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_subr.c == --- head/sys/netinet/tcp_subr.c Fri Sep 6 18:25:42 2019(r351950) +++ head/sys/netinet/tcp_subr.c Fri Sep 6 18:29:48 2019(r351951) @@ -1125,6 +1125,13 @@ tcp_init(void) SHUTDOWN_PRI_DEFAULT); EVENTHANDLER_REGISTER(maxsockets_change, tcp_zone_change, NULL, EVENTHANDLER_PRI_ANY); + + tcp_inp_lro_direct_queue = counter_u64_alloc(M_WAITOK); + tcp_inp_lro_wokeup_queue = counter_u64_alloc(M_WAITOK); + tcp_inp_lro_compressed = counter_u64_alloc(M_WAITOK); + tcp_inp_lro_single_push = counter_u64_alloc(M_WAITOK); + tcp_inp_lro_locks_taken = counter_u64_alloc(M_WAITOK); + tcp_inp_lro_sack_wake = counter_u64_alloc(M_WAITOK); #ifdef TCPPCAP tcp_pcap_init(); #endif Modified: head/sys/netinet/tcp_var.h == --- head/sys/netinet/tcp_var.h Fri Sep 6 18:25:42 2019(r351950) +++ head/sys/netinet/tcp_var.h Fri Sep 6 18:29:48 2019(r351951) @@ -887,6 +887,13 @@ struct tcp_function_block * find_and_ref_tcp_fb(struct tcp_function_block *fs); int tcp_default_ctloutput(struct socket *so, struct sockopt *sopt, struct inpcb *inp, struct tcpcb *tp); +extern counter_u64_t tcp_inp_lro_direct_queue; +extern counter_u64_t tcp_inp_lro_wokeup_queue; +extern counter_u64_t tcp_inp_lro_compressed; +extern counter_u64_t tcp_inp_lro_single_push; +extern counter_u64_t tcp_inp_lro_locks_taken; +extern counter_u64_t tcp_inp_lro_sack_wake; + uint32_t tcp_maxmtu(struct in_conninfo *, struct tcp_ifcap *); uint32_t tcp_maxmtu6(struct in_conninfo *, struct tcp_ifcap *); u_int tcp_maxseg(const struct tcpcb *); ___ 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-unsubscr...@freebsd.org"
svn commit: r351952 - head/sys/netinet
Author: cem Date: Fri Sep 6 18:33:39 2019 New Revision: 351952 URL: https://svnweb.freebsd.org/changeset/base/351952 Log: Fix build after r351934 tcp_queue_pkts() is only used if TCPHPTS is defined (and it is not by default). Reported by: gcc Modified: head/sys/netinet/tcp_lro.c Modified: head/sys/netinet/tcp_lro.c == --- head/sys/netinet/tcp_lro.c Fri Sep 6 18:29:48 2019(r351951) +++ head/sys/netinet/tcp_lro.c Fri Sep 6 18:33:39 2019(r351952) @@ -845,6 +845,7 @@ again: } } +#ifdef TCPHPTS static void tcp_queue_pkts(struct tcpcb *tp, struct lro_entry *le) { @@ -860,6 +861,7 @@ tcp_queue_pkts(struct tcpcb *tp, struct lro_entry *le) le->m_head = NULL; le->m_last_mbuf = NULL; } +#endif void tcp_lro_flush(struct lro_ctrl *lc, struct lro_entry *le) @@ -959,7 +961,7 @@ tcp_lro_flush(struct lro_ctrl *lc, struct lro_entry *l } if (can_queue == 0) { skip_lookup: -#endif +#endif /* TCPHPTS */ /* Old fashioned lro method */ if (le->m_head != le->m_last_mbuf) { counter_u64_add(tcp_inp_lro_compressed, 1); ___ 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-unsubscr...@freebsd.org"
svn commit: r351953 - head/share/man/man8
Author: 0mp (ports committer) Date: Fri Sep 6 18:51:41 2019 New Revision: 351953 URL: https://svnweb.freebsd.org/changeset/base/351953 Log: rc.8: Update documentation regarding old-style rc scripts The EXAMPLES section does not contain any examples of output formats for the old-style scripts. Remove the misleading bits stating otherwise. Reviewed by: bcr, imp Approved by: src (imp) Differential Revision:https://reviews.freebsd.org/D21552 Modified: head/share/man/man8/rc.8 Modified: head/share/man/man8/rc.8 == --- head/share/man/man8/rc.8Fri Sep 6 18:33:39 2019(r351952) +++ head/share/man/man8/rc.8Fri Sep 6 18:51:41 2019(r351953) @@ -31,7 +31,7 @@ .\" @(#)rc.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd August 7, 2019 +.Dd September 6, 2019 .Dt RC 8 .Os .Sh NAME @@ -396,9 +396,7 @@ without the numeric prefixes the opposite would be tru The output from each script is traditionally a space character, followed by the name of the software package being started or shut down, .Em without -a trailing newline character (see the -.Sx EXAMPLES -section). +a trailing newline character. .El .Sh SCRIPTS OF INTEREST When an automatic reboot is in progress, ___ 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-unsubscr...@freebsd.org"
svn commit: r351954 - head/share/mk
Author: sjg Date: Fri Sep 6 19:05:01 2019 New Revision: 351954 URL: https://svnweb.freebsd.org/changeset/base/351954 Log: Use file destdir for stage_as sets We cannot use file (without :T) to name targets but we can use the destination directory (with / replaced by _) This has the benefit of minimizing the targets created. Reviewed by: bdrewery MFC after:1 week Differential Revision:https://reviews.freebsd.org//D21283 Modified: head/share/mk/bsd.files.mk Modified: head/share/mk/bsd.files.mk == --- head/share/mk/bsd.files.mk Fri Sep 6 18:51:41 2019(r351953) +++ head/share/mk/bsd.files.mk Fri Sep 6 19:05:01 2019(r351954) @@ -101,11 +101,16 @@ ${group}NAME_${file}?=${${group}NAME} .else ${group}NAME_${file}?= ${file:T} .endif # defined(${group}NAME) -STAGE_AS_SETS+=${file} STAGE_AS_${file}= ${${group}NAME_${file}} -# XXX {group}OWN,GRP,MODE -STAGE_DIR.${file}= ${STAGE_OBJTOP}${${_${group}DIR_${file}}} -stage_as.${file}: ${file} +# we cannot use file safely as a set name +# since we cannot? apply :T +# but we can use the ${group}DIR_${file} +# as a set - meta.stage.mk will :O:u for us +# we need to expand ${group}DIR_${file} and replace +# all '/' and '*' with '_' to make a safe target name. +STAGE_AS_SETS+=${${_${group}DIR_${file}}:C,[/*],_,g} +STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR_${file}} +stage_as.${${_${group}DIR_${file}}:C,[/*],_,g}: ${file} installfiles-${group}: _${group}INS1_${file} _${group}INS1_${file}: installdirs-${_${group}DIR_${file}} _${group}INS_${file} @@ -122,12 +127,16 @@ realinstall: installfiles .ORDER: beforeinstall installfiles .if ${MK_STAGING} != "no" +.if ${FILESGROUPS:@g@${$g}@} != "" .if !empty(STAGE_SETS) buildfiles: stage_files STAGE_TARGETS+= stage_files +stage_files: .if !empty(STAGE_AS_SETS) buildfiles: stage_as STAGE_TARGETS+= stage_as +stage_as: +.endif .endif .endif .endif ___ 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-unsubscr...@freebsd.org"
svn commit: r351959 - head/stand/efi/libefi
Author: tsoome Date: Fri Sep 6 19:30:23 2019 New Revision: 351959 URL: https://svnweb.freebsd.org/changeset/base/351959 Log: loader.efi: UEFI text mode background colors are only using 3 bits Need to mask background colors to pass allowed value. Modified: head/stand/efi/libefi/efi_console.c Modified: head/stand/efi/libefi/efi_console.c == --- head/stand/efi/libefi/efi_console.c Fri Sep 6 19:29:02 2019 (r351958) +++ head/stand/efi/libefi/efi_console.c Fri Sep 6 19:30:23 2019 (r351959) @@ -159,7 +159,7 @@ efi_text_printchar(const teken_pos_t *p) } attr = EFI_TEXT_ATTR(teken_color_to_efi_color[fg], - teken_color_to_efi_color[bg]); + teken_color_to_efi_color[bg] & 0x7); conout->SetCursorPosition(conout, p->tp_col, p->tp_row); ___ 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-unsubscr...@freebsd.org"
svn commit: r351961 - head/sys/fs/fuse
Author: asomers Date: Fri Sep 6 19:40:11 2019 New Revision: 351961 URL: https://svnweb.freebsd.org/changeset/base/351961 Log: Coverity fixes in fusefs(5) CID 1404532 fixes a signed vs unsigned comparison error in fuse_vnop_bmap. It could potentially have resulted in VOP_BMAP reporting too many consecutive blocks. CID 1404364 is much worse. It was an array access by an untrusted, user-provided variable. It could potentially have resulted in a malicious file system crashing the kernel or worse. Reported by: Coverity Reviewed by: emaste MFC after:3 days Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D21466 Modified: head/sys/fs/fuse/fuse_internal.c head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_internal.c == --- head/sys/fs/fuse/fuse_internal.cFri Sep 6 19:36:41 2019 (r351960) +++ head/sys/fs/fuse/fuse_internal.cFri Sep 6 19:40:11 2019 (r351961) @@ -390,6 +390,9 @@ fuse_internal_invalidate_entry(struct mount *mp, struc if ((err = uiomove(&fnieo, sizeof(fnieo), uio)) != 0) return (err); + if (fnieo.namelen > sizeof(name)) + return (EINVAL); + if ((err = uiomove(name, fnieo.namelen, uio)) != 0) return (err); name[fnieo.namelen] = '\0'; Modified: head/sys/fs/fuse/fuse_vnops.c == --- head/sys/fs/fuse/fuse_vnops.c Fri Sep 6 19:36:41 2019 (r351960) +++ head/sys/fs/fuse/fuse_vnops.c Fri Sep 6 19:40:11 2019 (r351961) @@ -504,7 +504,7 @@ fuse_vnop_bmap(struct vop_bmap_args *ap) if (runp != NULL) { error = fuse_vnode_size(vp, &filesize, td->td_ucred, td); if (error == 0) - *runp = MIN(MAX(0, filesize / biosize - lbn - 1), + *runp = MIN(MAX(0, filesize / (off_t)biosize - lbn - 1), maxrun); else *runp = 0; ___ 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-unsubscr...@freebsd.org"
svn commit: r351963 - head/tests/sys/fs/fusefs
Author: asomers Date: Fri Sep 6 19:50:45 2019 New Revision: 351963 URL: https://svnweb.freebsd.org/changeset/base/351963 Log: fusefs: coverity cleanup in the tests Address the following defects reported by Coverity: * Structurally dead code (CID 1404366): set m_quit before FAIL, not after * Unchecked return value of sysctlbyname (CID 1404321) * Unchecked return value of stat(2) (CID 1404471) * Unchecked return value of open(2) (CID 1404402, 1404529) * Unchecked return value of dup(2) (CID 1404478) * Buffer overflows. These are all false positives caused by the fact that Coverity thinks I'm using a buffer to store strings, when in fact I'm really just using it to store a byte array that happens to be initialized with a string. I'm changing the type from char to uint8_t in the hopes that it will placate Coverity. (CID 1404338, 1404350, 1404367, 1404376, 1404379, 1404381, 1404388, 1404403, 1404425, 1404433, 1404434, 1404474, 1404480, 1404484, 1404503, 1404505) * False positive file descriptor leak. I'm going to try to fix this with Coverity modeling, but I'll also change an EXPECT to ASSERT so we don't perform meaningless assertions after the failure. (CID 1404320, 1404324, 1404440, 1404445). * Unannotated file descriptor leak. This will be followed up by a Coverity modeling change. (CID 1404326, 1404334, 1404336, 1404357, 1404361, 1404372, 1404391, 1404395, 1404409, 1404430, 1404448, 1404451, 1404455, 1404457, 1404458, 1404460) * Uninitialized variables in C++ constructors (CID 1404327, 1404346). In the case of m_maxphys, this actually led to part of the FUSE_INIT's response being set to stack garbage during the WriteCluster::clustering test. * Uninitialized sun_len field in struct sockaddr_un (CID 1404330, 1404371, 1404429). Reported by: Coverity Reviewed by: emaste MFC after:3 days Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D21457 Modified: head/tests/sys/fs/fusefs/allow_other.cc head/tests/sys/fs/fusefs/bmap.cc head/tests/sys/fs/fusefs/default_permissions.cc head/tests/sys/fs/fusefs/dev_fuse_poll.cc head/tests/sys/fs/fusefs/fifo.cc head/tests/sys/fs/fusefs/interrupt.cc head/tests/sys/fs/fusefs/io.cc head/tests/sys/fs/fusefs/mknod.cc head/tests/sys/fs/fusefs/mockfs.cc head/tests/sys/fs/fusefs/notify.cc head/tests/sys/fs/fusefs/open.cc head/tests/sys/fs/fusefs/opendir.cc head/tests/sys/fs/fusefs/read.cc head/tests/sys/fs/fusefs/release.cc head/tests/sys/fs/fusefs/setattr.cc head/tests/sys/fs/fusefs/utils.cc head/tests/sys/fs/fusefs/utils.hh head/tests/sys/fs/fusefs/write.cc Modified: head/tests/sys/fs/fusefs/allow_other.cc == --- head/tests/sys/fs/fusefs/allow_other.cc Fri Sep 6 19:46:27 2019 (r351962) +++ head/tests/sys/fs/fusefs/allow_other.cc Fri Sep 6 19:50:45 2019 (r351963) @@ -255,6 +255,8 @@ TEST_F(NoAllowOther, disallowed_beneath_root) } ); ASSERT_EQ(0, WEXITSTATUS(status)); + + leak(dfd); } /* Modified: head/tests/sys/fs/fusefs/bmap.cc == --- head/tests/sys/fs/fusefs/bmap.ccFri Sep 6 19:46:27 2019 (r351962) +++ head/tests/sys/fs/fusefs/bmap.ccFri Sep 6 19:50:45 2019 (r351963) @@ -158,4 +158,6 @@ TEST_F(Bmap, default_) EXPECT_EQ(arg.bn, lbn * m_maxbcachebuf / DEV_BSIZE); EXPECT_EQ(arg.runp, 0); EXPECT_EQ(arg.runb, m_maxphys / m_maxbcachebuf - 1); + + leak(fd); } Modified: head/tests/sys/fs/fusefs/default_permissions.cc == --- head/tests/sys/fs/fusefs/default_permissions.cc Fri Sep 6 19:46:27 2019(r351962) +++ head/tests/sys/fs/fusefs/default_permissions.cc Fri Sep 6 19:50:45 2019(r351963) @@ -503,7 +503,7 @@ TEST_F(Create, eacces) EXPECT_LOOKUP(FUSE_ROOT_ID, RELPATH) .WillOnce(Invoke(ReturnErrno(ENOENT))); - EXPECT_EQ(-1, open(FULLPATH, O_CREAT | O_EXCL, 0644)); + ASSERT_EQ(-1, open(FULLPATH, O_CREAT | O_EXCL, 0644)); EXPECT_EQ(EACCES, errno); } Modified: head/tests/sys/fs/fusefs/dev_fuse_poll.cc == --- head/tests/sys/fs/fusefs/dev_fuse_poll.cc Fri Sep 6 19:46:27 2019 (r351962) +++ head/tests/sys/fs/fusefs/dev_fuse_poll.cc Fri Sep 6 19:50:45 2019 (r351963) @@ -107,13 +107,12 @@ static void* statter(void* arg) { struct stat sb; name = (const char*)arg; - stat(name, &sb); - return 0; + return ((void*)(intptr_t)stat(name, &sb)); } /* * A kevent's data field should contain the number of operations available to - * be
svn commit: r351967 - head/sys/dev/usb
Author: imp Date: Sat Sep 7 03:51:26 2019 New Revision: 351967 URL: https://svnweb.freebsd.org/changeset/base/351967 Log: Some newer HID devices have descriptors that are larger than 1k. Bump this to 2k to prevent them from being truncated and ignored. It appears to be a sanity check only, but bumping it to 2k allows both of my iic hid devices to be parsed and the second one to work... Modified: head/sys/dev/usb/usb_hid.c Modified: head/sys/dev/usb/usb_hid.c == --- head/sys/dev/usb/usb_hid.c Fri Sep 6 21:53:04 2019(r351966) +++ head/sys/dev/usb/usb_hid.c Sat Sep 7 03:51:26 2019(r351967) @@ -74,7 +74,7 @@ static uint8_t hid_get_byte(struct hid_data *s, const #defineMAXUSAGE 64 #defineMAXPUSH 4 #defineMAXID 16 -#defineMAXLOCCNT 1024 +#defineMAXLOCCNT 2048 struct hid_pos_data { int32_t rid; ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r351918 - head/sys/kern
On 2019-09-06 22:18:36 (+0800), Ian Lepore wrote: On Fri, 2019-09-06 at 12:15 +0800, Philip Paeps wrote: On 2019-09-06 11:15:12 (+0800), Ian Lepore wrote: On Fri, 2019-09-06 at 01:19 +, Philip Paeps wrote: Log: riscv: default to HZ=100 This seems like a bad idea. I've run a 90mhz armv4 chip with HZ=1000 and didn't notice any performance hit from doing so. Almost all arm kernel config files set HZ as an option, so that define doesn't do much for arm these days. It probably does still set HZ for various mips platforms. I would think 1000 is appropriate for anything modern running at 200mhz or more. Setting it to 100 has the bad side effect of making things like msleep(), tsleep(), and pause() (which show up in plenty of drivers) all have a minimum timeout of 10ms, which is a long long time on modern hardware. What benefit do you think you'll get from the lower number? On systems running at 10s of MHz (or slower, ick), with HZ=1000 you spend an awful lot of time servicing the timer interrupt and not very much time doing anything else. My rationale was that most RISC-V systems (including emulation and FPGA prototypes) I've encountered are running slower than the tipping point where HZ=1000 makes sense. With the default of HZ=100, faster exceptions can still set HZ=1000 in their individual configs. When the RISC-V world evolves to having more actual silicon and fewer slow prototypes, I definitely agree this default should be flipped again for HZ=1000 by default and HZ=100 in the config files for the exceptions. Wait a second... are you saying that the riscv implementation doesn't support event timers and uses an old-style periodic tick based on HZ? Depending on the hardware, there may not be an event timer (yet)... As I wrote: I would be more than happy to revert this change when more silicon becomes available. Presently, there is exactly one silicon RISC-V implementation commercially available (HiFive FU540) and even that one is kind of difficult to source. Most people running RISC-V are doing so in emulation or on FPGAs. Given how long these things take to boot to userland (where you really notice how slow things are), HZ=100 feels like a more sensible default than HZ=1000. I don't feel terribly strongly about this though. I've just been bitten several times in the last week on a <15MHz FPGA forgetting to set HZ=100 in config and figured I'd save others the trouble. ;-) Philip -- Philip Paeps Senior Reality Engineer Alternative Enterprises ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r351918 - head/sys/kern
On Fri, Sep 6, 2019 at 9:54 PM Philip Paeps wrote: > On 2019-09-06 22:18:36 (+0800), Ian Lepore wrote: > > On Fri, 2019-09-06 at 12:15 +0800, Philip Paeps wrote: > >> On 2019-09-06 11:15:12 (+0800), Ian Lepore wrote: > >>> On Fri, 2019-09-06 at 01:19 +, Philip Paeps wrote: > Log: > riscv: default to HZ=100 > >>> > >>> This seems like a bad idea. I've run a 90mhz armv4 chip with > >>> HZ=1000 and didn't notice any performance hit from doing so. Almost > >>> all arm kernel config files set HZ as an option, so that define > >>> doesn't do much for arm these days. It probably does still set HZ > >>> for various mips platforms. > >>> > >>> I would think 1000 is appropriate for anything modern running at > >>> 200mhz or more. > >>> > >>> Setting it to 100 has the bad side effect of making things like > >>> msleep(), tsleep(), and pause() (which show up in plenty of drivers) > >>> all have a minimum timeout of 10ms, which is a long long time on > >>> modern hardware. > >>> > >>> What benefit do you think you'll get from the lower number? > >> > >> On systems running at 10s of MHz (or slower, ick), with HZ=1000 you > >> spend an awful lot of time servicing the timer interrupt and not very > >> much time doing anything else. > >> > >> My rationale was that most RISC-V systems (including emulation and > >> FPGA prototypes) I've encountered are running slower than the tipping > >> point where HZ=1000 makes sense. With the default of HZ=100, faster > >> exceptions can still set HZ=1000 in their individual configs. > >> > >> When the RISC-V world evolves to having more actual silicon and fewer > >> slow prototypes, I definitely agree this default should be flipped > >> again for HZ=1000 by default and HZ=100 in the config files for the > >> exceptions. > > > > Wait a second... are you saying that the riscv implementation doesn't > > support event timers and uses an old-style periodic tick based on HZ? > > Depending on the hardware, there may not be an event timer (yet)... > > As I wrote: I would be more than happy to revert this change when more > silicon becomes available. Presently, there is exactly one silicon > RISC-V implementation commercially available (HiFive FU540) and even > that one is kind of difficult to source. Most people running RISC-V are > doing so in emulation or on FPGAs. > > Given how long these things take to boot to userland (where you really > notice how slow things are), HZ=100 feels like a more sensible default > than HZ=1000. > I think it show more that the defaults are bad for MIPS and ARM. All the MIPS files, except BERI/CHERI are 1000Hz. Well, Octeon is also 100Hz, due to the defaults, but it will be fine at 1000Hz, so maybe we need to attend to this as well. Arm !=v5 is also 1000Hz, so it should be changed... > I don't feel terribly strongly about this though. I've just been bitten > several times in the last week on a <15MHz FPGA forgetting to set HZ=100 > in config and figured I'd save others the trouble. ;-) > 15MHz FPGA? FreeBSD 1.0 barely ran on 25MHz i386 machines of the time How common are these beasts and how well does FreeBSD do on them. I assume these are early prototypes? I have no strong opinion on riscv, but do think mips and arm should change. Warner ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r351918 - head/sys/kern
On 2019-09-07 12:06:32 (+0800), Warner Losh wrote: On Fri, Sep 6, 2019 at 9:54 PM Philip Paeps wrote: On 2019-09-06 22:18:36 (+0800), Ian Lepore wrote: On Fri, 2019-09-06 at 12:15 +0800, Philip Paeps wrote: On 2019-09-06 11:15:12 (+0800), Ian Lepore wrote: On Fri, 2019-09-06 at 01:19 +, Philip Paeps wrote: Log: riscv: default to HZ=100 This seems like a bad idea. I've run a 90mhz armv4 chip with HZ=1000 and didn't notice any performance hit from doing so. Almost all arm kernel config files set HZ as an option, so that define doesn't do much for arm these days. It probably does still set HZ for various mips platforms. I would think 1000 is appropriate for anything modern running at 200mhz or more. Setting it to 100 has the bad side effect of making things like msleep(), tsleep(), and pause() (which show up in plenty of drivers) all have a minimum timeout of 10ms, which is a long long time on modern hardware. What benefit do you think you'll get from the lower number? On systems running at 10s of MHz (or slower, ick), with HZ=1000 you spend an awful lot of time servicing the timer interrupt and not very much time doing anything else. My rationale was that most RISC-V systems (including emulation and FPGA prototypes) I've encountered are running slower than the tipping point where HZ=1000 makes sense. With the default of HZ=100, faster exceptions can still set HZ=1000 in their individual configs. When the RISC-V world evolves to having more actual silicon and fewer slow prototypes, I definitely agree this default should be flipped again for HZ=1000 by default and HZ=100 in the config files for the exceptions. Wait a second... are you saying that the riscv implementation doesn't support event timers and uses an old-style periodic tick based on HZ? Depending on the hardware, there may not be an event timer (yet)... As I wrote: I would be more than happy to revert this change when more silicon becomes available. Presently, there is exactly one silicon RISC-V implementation commercially available (HiFive FU540) and even that one is kind of difficult to source. Most people running RISC-V are doing so in emulation or on FPGAs. Given how long these things take to boot to userland (where you really notice how slow things are), HZ=100 feels like a more sensible default than HZ=1000. I think it show more that the defaults are bad for MIPS and ARM. All the MIPS files, except BERI/CHERI are 1000Hz. Well, Octeon is also 100Hz, due to the defaults, but it will be fine at 1000Hz, so maybe we need to attend to this as well. Arm !=v5 is also 1000Hz, so it should be changed... I don't feel terribly strongly about this though. I've just been bitten several times in the last week on a <15MHz FPGA forgetting to set HZ=100 in config and figured I'd save others the trouble. ;-) 15MHz FPGA? FreeBSD 1.0 barely ran on 25MHz i386 machines of the time How common are these beasts and how well does FreeBSD do on them. I assume these are early prototypes? These are early prototypes indeed. FreeBSD runs remarkably well on them. Slowly of course. Booting takes several minutes and running anything non-trivial can be frustrating. I have no strong opinion on riscv, but do think mips and arm should change. I will revert r351918 and r351919 since there is clearly no consensus. Let's take this discussion to arch@? Philip -- Philip Paeps Senior Reality Engineer Alternative Enterprises ___ 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-unsubscr...@freebsd.org"
svn commit: r351969 - in head/sys: kern riscv/conf
Author: philip Date: Sat Sep 7 05:13:31 2019 New Revision: 351969 URL: https://svnweb.freebsd.org/changeset/base/351969 Log: riscv: restore default HZ=1000, keep QEMU at HZ=100 This reverts r351918 and r351919. Discussed with: br, ian, imp Modified: head/sys/kern/subr_param.c head/sys/riscv/conf/QEMU Modified: head/sys/kern/subr_param.c == --- head/sys/kern/subr_param.c Sat Sep 7 04:09:43 2019(r351968) +++ head/sys/kern/subr_param.c Sat Sep 7 05:13:31 2019(r351969) @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); */ #ifndef HZ -# if defined(__mips__) || defined(__arm__) || defined(__riscv) +# if defined(__mips__) || defined(__arm__) #defineHZ 100 # else #defineHZ 1000 Modified: head/sys/riscv/conf/QEMU == --- head/sys/riscv/conf/QEMUSat Sep 7 04:09:43 2019(r351968) +++ head/sys/riscv/conf/QEMUSat Sep 7 05:13:31 2019(r351969) @@ -6,4 +6,5 @@ include "GENERIC" ident QEMU +optionsHZ=100 optionsROOTDEVNAME=\"ufs:/dev/vtbd0\" ___ 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-unsubscr...@freebsd.org"