Re: svn commit: r356758 - in head/usr.sbin/bsdinstall: . scripts
On 2020-01-15 21:07, Philip Paeps wrote: > On 2020-01-16 04:57:28 (+1000), Oliver Pinter wrote: >> On Wednesday, January 15, 2020, Ben Woods wrote: >>> bsdinstall: Change "default" (first) Partitioning method to ZFS > >> Plus I miss from here the relontes tag. > > I'm not sure if this merits a release notes entry but ... sure. > > There is not actually a functional change here. It's just a defaults change. I'd say that a change in defaults is far more deserving of being mentioned in the release notes than, say, adding a new feature. Nobody will trip over new features by mistake, but there's probably someone out there who is used to holding down the Enter key in the installer and expects to get UFS. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid ___ 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: r356758 - in head/usr.sbin/bsdinstall: . scripts
On 16/01/2020 7:27 pm, Colin Percival wrote: On 2020-01-15 21:07, Philip Paeps wrote: On 2020-01-16 04:57:28 (+1000), Oliver Pinter wrote: On Wednesday, January 15, 2020, Ben Woods wrote: bsdinstall: Change "default" (first) Partitioning method to ZFS Plus I miss from here the relontes tag. I'm not sure if this merits a release notes entry but ... sure. There is not actually a functional change here. It's just a defaults change. I'd say that a change in defaults is far more deserving of being mentioned in the release notes than, say, adding a new feature. Nobody will trip over new features by mistake, but there's probably someone out there who is used to holding down the Enter key in the installer and expects to get UFS. +1 on changing the default. This doesn't preclude UFS systems or reduce choice (we value choice). +0 on tweaking it or setting exceptions if and where necessary, as long as it doesn't result in more than minimal fragmentation between versions/archs/install types: this is also a POLA issue. I don't oin its own consider "4gb systems" as necessary. +1 RELNOTES, we value POLA. More things in RELNOTES not less ___ 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: r356786 - head/sys/kern
Author: mjg Date: Thu Jan 16 10:44:02 2020 New Revision: 356786 URL: https://svnweb.freebsd.org/changeset/base/356786 Log: vfs: reimplement vlrureclaim to actually use LRU Take advantage of global ordering introduced in r356672. Reviewed by: mckusick (previous version) Differential Revision:https://reviews.freebsd.org/D23067 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c == --- head/sys/kern/vfs_subr.cThu Jan 16 10:35:47 2020(r356785) +++ head/sys/kern/vfs_subr.cThu Jan 16 10:44:02 2020(r356786) @@ -166,6 +166,7 @@ int vttoif_tab[10] = { */ static TAILQ_HEAD(freelst, vnode) vnode_list; static struct vnode *vnode_list_free_marker; +static struct vnode *vnode_list_reclaim_marker; /* * "Free" vnode target. Free vnodes are rarely completely free, but are @@ -653,6 +654,8 @@ vntblinit(void *dummy __unused) mtx_unlock(&vnode_list_mtx); vnode_list_free_marker = vn_alloc_marker(NULL); TAILQ_INSERT_HEAD(&vnode_list, vnode_list_free_marker, v_vnodelist); + vnode_list_reclaim_marker = vn_alloc_marker(NULL); + TAILQ_INSERT_HEAD(&vnode_list, vnode_list_reclaim_marker, v_vnodelist); vnode_zone = uma_zcreate("VNODE", sizeof (struct vnode), NULL, NULL, vnode_init, vnode_fini, UMA_ALIGN_PTR, 0); vnodepoll_zone = uma_zcreate("VNODEPOLL", sizeof (struct vpollinfo), @@ -1057,6 +1060,17 @@ vattr_null(struct vattr *vap) } /* + * Try to reduce the total number of vnodes. + * + * This routine (and its user) are buggy in at least the following ways: + * - all parameters were picked years ago when RAM sizes were significantly + * smaller + * - it can pick vnodes based on pages used by the vm object, but filesystems + * like ZFS don't use it making the pick broken + * - since ZFS has its own aging policy it gets partially combated by this one + * - a dedicated method should be provided for filesystems to let them decide + * whether the vnode should be recycled + * * This routine is called when we have too many vnodes. It attempts * to free vnodes and will potentially free vnodes that still * have VM backing store (VM backing store is typically the cause @@ -1071,118 +1085,116 @@ vattr_null(struct vattr *vap) * number of vnodes to reach some minimum value regardless of what * you set kern.maxvnodes to. Do not set kern.maxvnodes too low. * - * @param mpTry to reclaim vnodes from this mountpoint * @param reclaim_nc_src Only reclaim directories with outgoing namecache * entries if this argument is strue * @param trigger Only reclaim vnodes with fewer than this many resident * pages. + * @param targetHow many vnodes to reclaim. * @return The number of vnodes that were reclaimed. */ static int -vlrureclaim(struct mount *mp, bool reclaim_nc_src, int trigger) +vlrureclaim(bool reclaim_nc_src, int trigger, u_long target) { - struct vnode *vp; - int count, done, target; + struct vnode *vp, *mvp; + struct mount *mp; + u_long done; + bool retried; + mtx_assert(&vnode_list_mtx, MA_OWNED); + + retried = false; done = 0; - vn_start_write(NULL, &mp, V_WAIT); - MNT_ILOCK(mp); - count = mp->mnt_nvnodelistsize; - target = count * (int64_t)gapvnodes / imax(desiredvnodes, 1); - target = target / 10 + 1; - while (count != 0 && done < target) { - vp = TAILQ_FIRST(&mp->mnt_nvnodelist); - while (vp != NULL && vp->v_type == VMARKER) - vp = TAILQ_NEXT(vp, v_nmntvnodes); - if (vp == NULL) + + mvp = vnode_list_reclaim_marker; +restart: + vp = mvp; + while (done < target) { + vp = TAILQ_NEXT(vp, v_vnodelist); + if (__predict_false(vp == NULL)) break; + + if (__predict_false(vp->v_type == VMARKER)) + continue; + /* -* XXX LRU is completely broken for non-free vnodes. First -* by calling here in mountpoint order, then by moving -* unselected vnodes to the end here, and most grossly by -* removing the vlruvp() function that was supposed to -* maintain the order. (This function was born broken -* since syncer problems prevented it doing anything.) The -* order is closer to LRC (C = Created). -* -* LRU reclaiming of vnodes seems to have last worked in -* FreeBSD-3 where LRU wasn't mentioned under any spelling. -* Then there was no hold count, and inactive vnodes were -* simply put on the free list in LRU order. The separate -* lists also break LR
svn commit: r356788 - in head: share/man/man4 sys/modules sys/powerpc/conf
Author: luporl Date: Thu Jan 16 11:33:15 2020 New Revision: 356788 URL: https://svnweb.freebsd.org/changeset/base/356788 Log: [PowerPC64] Enable virtio drivers This enables virtio modules on PowerPC* target. On PowerPC64, drivers are also kernel builtin. QEMU currently needs to be patched to in order to work on LE hosts due to known issue affecting pre-1.0 (legacy) virtio drivers. The patch was submitted to QEMU mail list by @afscoelho_gmail.com, available at https://lists.nongnu.org/archive/html/qemu-devel/2020-01/msg01496.html Submitted by: Alfredo Dal'Ava Junior Reviewed by: luporl Differential Revision:https://reviews.freebsd.org/D22833 Modified: head/share/man/man4/Makefile head/sys/modules/Makefile head/sys/powerpc/conf/GENERIC64 Modified: head/share/man/man4/Makefile == --- head/share/man/man4/MakefileThu Jan 16 10:51:32 2020 (r356787) +++ head/share/man/man4/MakefileThu Jan 16 11:33:15 2020 (r356788) @@ -868,8 +868,16 @@ _nvram2env.4= nvram2env.4 .endif .if ${MACHINE_CPUARCH} == "powerpc" +_if_vtnet.4=if_vtnet.4 _nvd.4=nvd.4 _nvme.4= nvme.4 +_virtio.4= virtio.4 +_virtio_balloon.4=virtio_balloon.4 +_virtio_blk.4= virtio_blk.4 +_virtio_console.4=virtio_console.4 +_virtio_random.4= virtio_random.4 +_virtio_scsi.4=virtio_scsi.4 +_vtnet.4= vtnet.4 .endif .if empty(MAN_ARCH) Modified: head/sys/modules/Makefile == --- head/sys/modules/Makefile Thu Jan 16 10:51:32 2020(r356787) +++ head/sys/modules/Makefile Thu Jan 16 11:33:15 2020(r356788) @@ -761,6 +761,7 @@ _nvd= nvd _nvme= nvme _pccard= pccard _wi= wi +_virtio= virtio .endif .if ${MACHINE_ARCH} == "powerpc64" Modified: head/sys/powerpc/conf/GENERIC64 == --- head/sys/powerpc/conf/GENERIC64 Thu Jan 16 10:51:32 2020 (r356787) +++ head/sys/powerpc/conf/GENERIC64 Thu Jan 16 11:33:15 2020 (r356788) @@ -256,3 +256,12 @@ device netmap # netmap(4) support optionsEVDEV_SUPPORT # evdev support in legacy drivers device evdev # input event device support device uinput # install /dev/uinput cdev + +# VirtIO support +device virtio # Generic VirtIO bus (required) +device virtio_pci # VirtIO PCI device +device vtnet # VirtIO Ethernet device +device virtio_blk # VirtIO Block device +device virtio_scsi # VirtIO SCSI device +device virtio_balloon # VirtIO Memory Balloon device + ___ 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: r356790 - head/usr.bin/mkimg
Author: arichardson Date: Thu Jan 16 14:14:55 2020 New Revision: 356790 URL: https://svnweb.freebsd.org/changeset/base/356790 Log: Allow bootstrapping mkimg on macOS/Linux On these systems the (u)int64_t typedefs will not be implicitly defined by the previous includes, so include in the header that uses uint64_t. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D23202 Modified: head/usr.bin/mkimg/image.h Modified: head/usr.bin/mkimg/image.h == --- head/usr.bin/mkimg/image.h Thu Jan 16 14:14:50 2020(r356789) +++ head/usr.bin/mkimg/image.h Thu Jan 16 14:14:55 2020(r356790) @@ -29,6 +29,8 @@ #ifndef _MKIMG_IMAGE_H_ #define_MKIMG_IMAGE_H_ +#include + typedef int64_t lba_t; int image_copyin(lba_t blk, int fd, uint64_t *sizep); ___ 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: r356789 - in head/contrib/llvm-project/llvm/lib: MC Object Target/Mips
Author: arichardson Date: Thu Jan 16 14:14:50 2020 New Revision: 356789 URL: https://svnweb.freebsd.org/changeset/base/356789 Log: Merge commit 894f742acb from llvm git (by me): [MIPS][ELF] Use PC-relative relocations in .eh_frame when possible When compiling position-independent executables, we now use DW_EH_PE_pcrel | DW_EH_PE_sdata4. However, the MIPS ABI does not define a 64-bit PC-relative ELF relocation so we cannot use sdata8 for the large code model case. When using the large code model, we fall back to the previous behaviour of generating absolute relocations. With this change clang-generated .o files can be linked by LLD without having to pass -Wl,-z,notext (which creates text relocations). This is simpler than the approach used by ld.bfd, which rewrites the .eh_frame section to convert absolute relocations into relative references. I saw in D13104 that apparently ld.bfd did not accept pc-relative relocations for MIPS ouput at some point. However, I also checked that recent ld.bfd can process the clang-generated .o files so this no longer seems true. Reviewed By: atanasyan Differential Revision: https://reviews.llvm.org/D72228 Merge commit 8e8ccf47 from llvm git (by me) [MIPS] Don't emit R_(MICRO)MIPS_JALR relocations against data symbols The R_(MICRO)MIPS_JALR optimization only works when used against functions. Using the relocation against a data symbol (e.g. function pointer) will cause some linkers that don't ignore the hint in this case (e.g. LLD prior to commit 5bab291) to generate a relative branch to the data symbol which crashes at run time. Before this patch, LLVM was erroneously emitting these relocations against local-dynamic TLS function pointers and global function pointers with internal visibility. Reviewers: atanasyan, jrtc27, vstefanovic Reviewed By: atanasyan Differential Revision: https://reviews.llvm.org/D72571 These two changes should allow using lld for MIPS64 (and maybe also MIPS32) by default. The second commit is not strictly necessary for clang+lld since LLD9 will not perform the R_MIPS_JALR optimization (it was only added for 10) but it is probably required in order to use recent ld.bfd. Reviewed By: dim, emaste MFC after:1 week Differential Revision: https://reviews.freebsd.org/D23203 Modified: head/contrib/llvm-project/llvm/lib/MC/MCObjectFileInfo.cpp head/contrib/llvm-project/llvm/lib/Object/RelocationResolver.cpp head/contrib/llvm-project/llvm/lib/Target/Mips/MipsISelLowering.cpp Modified: head/contrib/llvm-project/llvm/lib/MC/MCObjectFileInfo.cpp == --- head/contrib/llvm-project/llvm/lib/MC/MCObjectFileInfo.cpp Thu Jan 16 11:33:15 2020(r356788) +++ head/contrib/llvm-project/llvm/lib/MC/MCObjectFileInfo.cpp Thu Jan 16 14:14:50 2020(r356789) @@ -303,9 +303,14 @@ void MCObjectFileInfo::initELFMCObjectFileInfo(const T case Triple::mipsel: case Triple::mips64: case Triple::mips64el: -FDECFIEncoding = Ctx->getAsmInfo()->getCodePointerSize() == 4 - ? dwarf::DW_EH_PE_sdata4 - : dwarf::DW_EH_PE_sdata8; +// We cannot use DW_EH_PE_sdata8 for the large PositionIndependent case +// since there is no R_MIPS_PC64 relocation (only a 32-bit version). +if (PositionIndependent && !Large) + FDECFIEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4; +else + FDECFIEncoding = Ctx->getAsmInfo()->getCodePointerSize() == 4 + ? dwarf::DW_EH_PE_sdata4 + : dwarf::DW_EH_PE_sdata8; break; case Triple::ppc64: case Triple::ppc64le: Modified: head/contrib/llvm-project/llvm/lib/Object/RelocationResolver.cpp == --- head/contrib/llvm-project/llvm/lib/Object/RelocationResolver.cppThu Jan 16 11:33:15 2020(r356788) +++ head/contrib/llvm-project/llvm/lib/Object/RelocationResolver.cppThu Jan 16 14:14:50 2020(r356789) @@ -103,6 +103,7 @@ static bool supportsMips64(uint64_t Type) { case ELF::R_MIPS_32: case ELF::R_MIPS_64: case ELF::R_MIPS_TLS_DTPREL64: + case ELF::R_MIPS_PC32: return true; default: return false; @@ -117,6 +118,8 @@ static uint64_t resolveMips64(RelocationRef R, uint64_ return S + getELFAddend(R); case ELF::R_MIPS_TLS_DTPREL64: return S + getELFAddend(R) - 0x8000; + case ELF::R_MIPS_PC32: +return S + getELFAddend(R) - R.getOffset(); default: llvm_unreachable("Invalid relocation type"); } Modified: head/contrib/llvm-project/llvm/lib/Target/Mips/MipsISelLowering.cpp == --- head/contrib/llvm-project/llvm/lib/Target/Mips/MipsISelLowering.cpp Thu Jan 1
svn commit: r356791 - head/bin/cat
Author: arichardson Date: Thu Jan 16 14:15:00 2020 New Revision: 356791 URL: https://svnweb.freebsd.org/changeset/base/356791 Log: Allow building bin/cat on non-FreeBSD systems `cat -l` is needed during the installworld phase and other system's cat don't support that flag. To avoid portability issues when compiling on Linux/macOS (such as the the direct access to &fp->_mbstate), we disable the entire multibyte support when building as a boostrap tool. Reviewed By: brooks, emaste Differential Revision: https://reviews.freebsd.org/D13939 Modified: head/bin/cat/Makefile head/bin/cat/cat.c Modified: head/bin/cat/Makefile == --- head/bin/cat/Makefile Thu Jan 16 14:14:55 2020(r356790) +++ head/bin/cat/Makefile Thu Jan 16 14:15:00 2020(r356791) @@ -6,6 +6,12 @@ PACKAGE=runtime PROG= cat +.ifdef BOOTSTRAPPING +# For the bootstrap cat we disable all wide char support to allow building +# on Linux/macOS +CFLAGS+=-DBOOTSTRAP_CAT +.endif + HAS_TESTS= SUBDIR.${MK_TESTS}+= tests Modified: head/bin/cat/cat.c == --- head/bin/cat/cat.c Thu Jan 16 14:14:55 2020(r356790) +++ head/bin/cat/cat.c Thu Jan 16 14:15:00 2020(r356791) @@ -96,6 +96,20 @@ static int udom_open(const char *path, int flags); */ #defineBUFSIZE_SMALL (MAXPHYS) + +/* + * For the bootstrapped cat binary (needed for locked appending to METALOG), we + * disable all flags except -l and -u to avoid non-portable function calls. + * In the future we may instead want to write a small portable bootstrap tool + * that locks the output file before writing to it. However, for now + * bootstrapping cat without multibyte support is the simpler solution. + */ +#ifdef BOOTSTRAP_CAT +#define SUPPORTED_FLAGS "lu" +#else +#define SUPPORTED_FLAGS "belnstuv" +#endif + int main(int argc, char *argv[]) { @@ -104,7 +118,7 @@ main(int argc, char *argv[]) setlocale(LC_CTYPE, ""); - while ((ch = getopt(argc, argv, "belnstuv")) != -1) + while ((ch = getopt(argc, argv, SUPPORTED_FLAGS)) != -1) switch (ch) { case 'b': bflag = nflag = 1; /* -b implies -n */ @@ -158,7 +172,7 @@ static void usage(void) { - fprintf(stderr, "usage: cat [-belnstuv] [file ...]\n"); + fprintf(stderr, "usage: cat [-" SUPPORTED_FLAGS "] [file ...]\n"); exit(1); /* NOTREACHED */ } @@ -187,6 +201,7 @@ scanfiles(char *argv[], int cooked) if (fd < 0) { warn("%s", path); rval = 1; +#ifndef BOOTSTRAP_CAT } else if (cooked) { if (fd == STDIN_FILENO) cook_cat(stdin); @@ -195,6 +210,7 @@ scanfiles(char *argv[], int cooked) cook_cat(fp); fclose(fp); } +#endif } else { raw_cat(fd); if (fd != STDIN_FILENO) @@ -206,6 +222,7 @@ scanfiles(char *argv[], int cooked) } } +#ifndef BOOTSTRAP_CAT static void cook_cat(FILE *fp) { @@ -295,6 +312,7 @@ ilseq: if (ferror(stdout)) err(1, "stdout"); } +#endif /* BOOTSTRAP_CAT */ static void raw_cat(int rfd) ___ 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: r356792 - head/share/man/man7
Author: gjb Date: Thu Jan 16 15:07:52 2020 New Revision: 356792 URL: https://svnweb.freebsd.org/changeset/base/356792 Log: Update release(7) to note OSRELEASE is only relevant when the 'install' target is invoked. While here, bump the sample output version name, and explicitly add the 'obj' target to avoid polluting the src checkout. Submitted by: Trond Endrestol PR: 243287 (related) MFC after:3 days Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: head/share/man/man7/release.7 Modified: head/share/man/man7/release.7 == --- head/share/man/man7/release.7 Thu Jan 16 14:15:00 2020 (r356791) +++ head/share/man/man7/release.7 Thu Jan 16 15:07:52 2020 (r356792) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 28, 2018 +.Dd January 16, 2020 .Dt RELEASE 7 .Os .Sh NAME @@ -570,8 +570,10 @@ target invoked by Optional variables: .Bl -tag -width ".Ev TARGET_ARCH" .It Ev OSRELEASE -Optional base name for generated media images -.Pq e.g., FreeBSD-9.0-RC2-amd64 . +Optional base name for generated media images when invoking the +.Cm install +target +.Pq e.g., FreeBSD-12.1-RELEASE-amd64 . Defaults to the output of .Ic `uname -s`-`uname -r`-`uname -p` within the chroot. @@ -659,6 +661,7 @@ svn co svn://svn.freebsd.org/base/head src cd src make buildworld buildkernel cd release +make obj make release make install DESTDIR=/var/freebsd-snapshot .Ed ___ 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: r356796 - head/sys/netinet
Author: tuexen Date: Thu Jan 16 17:15:06 2020 New Revision: 356796 URL: https://svnweb.freebsd.org/changeset/base/356796 Log: Remove debug code not needed anymore. Submitted by: Richard Scheffenegger Reviewed by: tuexen@ MFC after:1 week Differential Revision:https://reviews.freebsd.org/D23208 Modified: head/sys/netinet/tcp_sack.c Modified: head/sys/netinet/tcp_sack.c == --- head/sys/netinet/tcp_sack.c Thu Jan 16 16:01:03 2020(r356795) +++ head/sys/netinet/tcp_sack.c Thu Jan 16 17:15:06 2020(r356796) @@ -165,11 +165,6 @@ tcp_update_dsack_list(struct tcpcb *tp, tcp_seq rcv_st KASSERT(SEQ_LT(rcv_start, rcv_end), ("rcv_start < rcv_end")); - if (tp->t_inpcb->inp_socket->so_options & SO_DEBUG) { - log(LOG_DEBUG, "\nDSACK update: %d..%d, rcv_nxt: %u\n", - rcv_start, rcv_end, tp->rcv_nxt); - } - if (SEQ_LT(rcv_end, tp->rcv_nxt) || ((rcv_end == tp->rcv_nxt) && (tp->rcv_numsacks > 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: r356797 - head/share/mk
Author: emaste Date: Thu Jan 16 17:27:08 2020 New Revision: 356797 URL: https://svnweb.freebsd.org/changeset/base/356797 Log: pkgbase: move profiling _p.a libs into -development packages Profiling library archives are part of the development environment; they don't need to be in separate -profile packages. (In fact we can probably just eliminate the _p.a archives assuming that profiling will be done using hwpmc etc., but that is a change for later.) Discussed with: bapt, manu Sponsored by: The FreeBSD Foundation Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk == --- head/share/mk/bsd.lib.mkThu Jan 16 17:15:06 2020(r356796) +++ head/share/mk/bsd.lib.mkThu Jan 16 17:27:08 2020(r356797) @@ -437,7 +437,7 @@ _libinstall: ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}.a ${DESTDIR}${_LIBDIR}/ .endif .if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},profile} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}_p.a ${DESTDIR}${_LIBDIR}/ .endif .if defined(SHLIB_NAME) ___ 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: r356755 - in head/sys: net netinet netinet6 netpfil/ipfw/nat64 sys
On 1/15/20 2:38 PM, Gleb Smirnoff wrote: > On Wed, Jan 15, 2020 at 09:44:53AM -1000, Jeff Roberson wrote: > J> On Wed, 15 Jan 2020, Gleb Smirnoff wrote: > J> > J> > Author: glebius > J> > Date: Wed Jan 15 06:05:20 2020 > J> > New Revision: 356755 > J> > URL: https://svnweb.freebsd.org/changeset/base/356755 > J> > > J> > Log: > J> > Introduce NET_EPOCH_CALL() macro and use it everywhere where we free > J> > data based on the network epoch. The macro reverses the argument > J> > order of epoch_call(9) - first function, then its argument. NFC > J> > J> Is there some practical impact of changing the argument order or does it > J> just seem more natural to you? > > It is just more natural. I'm suggesting to change prototype of epoch_call() > to the same order as well. +1 for fn, arg. -- John Baldwin ___ 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: r356797 - head/share/mk
On 1/16/20 9:27 AM, Ed Maste wrote: > Author: emaste > Date: Thu Jan 16 17:27:08 2020 > New Revision: 356797 > URL: https://svnweb.freebsd.org/changeset/base/356797 > > Log: > pkgbase: move profiling _p.a libs into -development packages > > Profiling library archives are part of the development environment; they > don't need to be in separate -profile packages. > > (In fact we can probably just eliminate the _p.a archives assuming that > profiling will be done using hwpmc etc., but that is a change for later.) I would support having MK_PROFILE default to off for 13. WITHOUT_PROFILE=yes is something I've been adding to make.conf (or src.conf) for 2 decades. The mcount-based stuff does not seem compelling compared to sampling via hardware counters. It also requires MD code that doesn't even work on all platforms (e.g. I think the mcount bits for MIPS only work for o32 and are completely broken for n64). Do we know if any other systems still ship -pg libraries as an option? Also, is anyone still using them? -- John Baldwin ___ 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: r356758 - in head/usr.sbin/bsdinstall: . scripts
> On Jan 16, 2020, at 01:01, Kubilay Kocak wrote: > > On 16/01/2020 7:27 pm, Colin Percival wrote: >> On 2020-01-15 21:07, Philip Paeps wrote: >>> On 2020-01-16 04:57:28 (+1000), Oliver Pinter wrote: On Wednesday, January 15, 2020, Ben Woods wrote: > bsdinstall: Change "default" (first) Partitioning method to ZFS >>> Plus I miss from here the relontes tag. >>> >>> I'm not sure if this merits a release notes entry but ... sure. >>> >>> There is not actually a functional change here. It's just a defaults >>> change. >> I'd say that a change in defaults is far more deserving of being mentioned >> in the release notes than, say, adding a new feature. Nobody will trip over >> new features by mistake, but there's probably someone out there who is used >> to holding down the Enter key in the installer and expects to get UFS. > > +1 on changing the default. This doesn't preclude UFS systems or reduce > choice (we value choice). > > +0 on tweaking it or setting exceptions if and where necessary, as long as it > doesn't result in more than minimal fragmentation between > versions/archs/install types: this is also a POLA issue. I don't oin its own > consider "4gb systems" as necessary. > > +1 RELNOTES, we value POLA. > -1 on (mentioned somewhere in the thread) dynamic menu items that change based on hardware. Muscle memory is not bad. — Devin ___ 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: r356797 - head/share/mk
On Thu, 16 Jan 2020 at 12:34, John Baldwin wrote: > > I would support having MK_PROFILE default to off for 13. I agree. > Do we know if any other systems still > ship -pg libraries as an option? Also, is anyone still using them? I'll try to check some representative Linux distributions, and later post a question on appropriate mailing lists to see if anyone's using them. ___ 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: r356797 - head/share/mk
On Thu, Jan 16, 2020, 12:18 PM Ed Maste wrote: > On Thu, 16 Jan 2020 at 12:34, John Baldwin wrote: > > > > I would support having MK_PROFILE default to off for 13. > > I agree. > > > Do we know if any other systems still > > ship -pg libraries as an option? Also, is anyone still using them? > > I'll try to check some representative Linux distributions, and later > post a question on appropriate mailing lists to see if anyone's using > them. > I think you'll find they haven't been shipped in over a decade. Maybe two. I'd turn them off by default as they have been overtaken by better, hardware assisted means. I've not used them in at least 15 years. 25-30 years ago I used them all the time. 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"
svn commit: r356798 - head/sys/arm/allwinner
Author: manu Date: Thu Jan 16 19:57:38 2020 New Revision: 356798 URL: https://svnweb.freebsd.org/changeset/base/356798 Log: axp8xx: Add missing voltage regulators offset This lead to writing the desired voltage value to the wrong register. MFC after:2 weeks Modified: head/sys/arm/allwinner/axp81x.c Modified: head/sys/arm/allwinner/axp81x.c == --- head/sys/arm/allwinner/axp81x.c Thu Jan 16 17:27:08 2020 (r356797) +++ head/sys/arm/allwinner/axp81x.c Thu Jan 16 19:57:38 2020 (r356798) @@ -437,6 +437,7 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .enable_reg = AXP_POWERCTL3, .enable_mask = (uint8_t) AXP_POWERCTL3_ALDO1, .enable_value = AXP_POWERCTL3_ALDO1, + .voltage_reg = AXP_VOLTCTL_ALDO1, .voltage_min = 700, .voltage_max = 3300, .voltage_step1 = 100, @@ -448,6 +449,7 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .enable_reg = AXP_POWERCTL3, .enable_mask = (uint8_t) AXP_POWERCTL3_ALDO2, .enable_value = AXP_POWERCTL3_ALDO2, + .voltage_reg = AXP_VOLTCTL_ALDO2, .voltage_min = 700, .voltage_max = 3300, .voltage_step1 = 100, @@ -459,6 +461,7 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .enable_reg = AXP_POWERCTL3, .enable_mask = (uint8_t) AXP_POWERCTL3_ALDO3, .enable_value = AXP_POWERCTL3_ALDO3, + .voltage_reg = AXP_VOLTCTL_ALDO3, .voltage_min = 700, .voltage_max = 3300, .voltage_step1 = 100, @@ -470,6 +473,7 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .enable_reg = AXP_POWERCTL2, .enable_mask = (uint8_t) AXP_POWERCTL2_ELDO1, .enable_value = AXP_POWERCTL2_ELDO1, + .voltage_reg = AXP_VOLTCTL_ELDO1, .voltage_min = 700, .voltage_max = 1900, .voltage_step1 = 50, @@ -481,6 +485,7 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .enable_reg = AXP_POWERCTL2, .enable_mask = (uint8_t) AXP_POWERCTL2_ELDO2, .enable_value = AXP_POWERCTL2_ELDO2, + .voltage_reg = AXP_VOLTCTL_ELDO2, .voltage_min = 700, .voltage_max = 1900, .voltage_step1 = 50, @@ -492,6 +497,7 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .enable_reg = AXP_POWERCTL2, .enable_mask = (uint8_t) AXP_POWERCTL2_ELDO3, .enable_value = AXP_POWERCTL2_ELDO3, + .voltage_reg = AXP_VOLTCTL_ELDO3, .voltage_min = 700, .voltage_max = 1900, .voltage_step1 = 50, @@ -503,6 +509,7 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .enable_reg = AXP_POWERCTL3, .enable_mask = (uint8_t) AXP_POWERCTL3_FLDO1, .enable_value = AXP_POWERCTL3_FLDO1, + .voltage_reg = AXP_VOLTCTL_FLDO1, .voltage_min = 700, .voltage_max = 1450, .voltage_step1 = 50, @@ -514,6 +521,7 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .enable_reg = AXP_POWERCTL3, .enable_mask = (uint8_t) AXP_POWERCTL3_FLDO2, .enable_value = AXP_POWERCTL3_FLDO2, + .voltage_reg = AXP_VOLTCTL_FLDO2, .voltage_min = 700, .voltage_max = 1450, .voltage_step1 = 50, ___ 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: r356799 - head/sys/arm/allwinner
Author: manu Date: Thu Jan 16 19:59:00 2020 New Revision: 356799 URL: https://svnweb.freebsd.org/changeset/base/356799 Log: axp8xx: Add a regnode_init method This method will set the desired voltaged based on values in the DTS. It will not enable the regulator, this is the job of either a consumer or regnode_set_constraint SYSINIT if the regulator is boot_on or always_on. MFC after:2 weeks Modified: head/sys/arm/allwinner/axp81x.c Modified: head/sys/arm/allwinner/axp81x.c == --- head/sys/arm/allwinner/axp81x.c Thu Jan 16 19:57:38 2020 (r356798) +++ head/sys/arm/allwinner/axp81x.c Thu Jan 16 19:59:00 2020 (r356799) @@ -710,6 +710,8 @@ struct axp8xx_softc { #defineAXP_LOCK(sc)mtx_lock(&(sc)->mtx) #defineAXP_UNLOCK(sc) mtx_unlock(&(sc)->mtx) +static int axp8xx_regnode_set_voltage(struct regnode *regnode, int min_uvolt, +int max_uvolt, int *udelay); static int axp8xx_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) @@ -754,6 +756,31 @@ axp8xx_write(device_t dev, uint8_t reg, uint8_t val) } static int +axp8xx_regnode_init(struct regnode *regnode) +{ + struct axp8xx_reg_sc *sc; + struct regnode_std_param *param; + int rv, udelay; + + sc = regnode_get_softc(regnode); + param = regnode_get_stdparam(regnode); + if (param->min_uvolt == 0) + return (0); + + /* +* Set the regulator at the correct voltage +* Do not enable it, this is will be done either by a +* consumer or by regnode_set_constraint if boot_on is true +*/ + rv = axp8xx_regnode_set_voltage(regnode, param->min_uvolt, + param->max_uvolt, &udelay); + if (rv != 0) + DELAY(udelay); + + return (rv); +} + +static int axp8xx_regnode_enable(struct regnode *regnode, bool enable, int *udelay) { struct axp8xx_reg_sc *sc; @@ -870,6 +897,7 @@ axp8xx_regnode_get_voltage(struct regnode *regnode, in static regnode_method_t axp8xx_regnode_methods[] = { /* Regulator interface */ + REGNODEMETHOD(regnode_init, axp8xx_regnode_init), REGNODEMETHOD(regnode_enable, axp8xx_regnode_enable), REGNODEMETHOD(regnode_set_voltage, axp8xx_regnode_set_voltage), REGNODEMETHOD(regnode_get_voltage, axp8xx_regnode_get_voltage), ___ 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: r356800 - head/sys/arm/allwinner
Author: manu Date: Thu Jan 16 20:02:41 2020 New Revision: 356800 URL: https://svnweb.freebsd.org/changeset/base/356800 Log: arm: allwinner: Add support for bank supply Each GPIO bank is powered by a different pin and so can be powered at different voltage from different regulators. Add a new config that now hold the pinmux data and the banks available on each SoCs. Since the aw_gpio driver being also the pinmux one it's attached before the PMIC so add a config_intrhook_oneshot function that will enable the needed regulators when the system is fully functional. MFC after:2 weeks Modified: head/sys/arm/allwinner/aw_gpio.c Modified: head/sys/arm/allwinner/aw_gpio.c == --- head/sys/arm/allwinner/aw_gpio.cThu Jan 16 19:59:00 2020 (r356799) +++ head/sys/arm/allwinner/aw_gpio.cThu Jan 16 20:02:41 2020 (r356800) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #if defined(__aarch64__) #include "opt_soc.h" @@ -78,102 +79,167 @@ __FBSDID("$FreeBSD$"); #defineAW_PINCTRL 1 #defineAW_R_PINCTRL2 +struct aw_gpio_conf { + struct allwinner_padconf *padconf; + const char *banks; +}; + /* Defined in aw_padconf.c */ #ifdef SOC_ALLWINNER_A10 -extern const struct allwinner_padconf a10_padconf; +extern struct allwinner_padconf a10_padconf; +struct aw_gpio_conf a10_gpio_conf = { + .padconf = &a10_padconf, + .banks = "abcdefghi", +}; #endif /* Defined in a13_padconf.c */ #ifdef SOC_ALLWINNER_A13 -extern const struct allwinner_padconf a13_padconf; +extern struct allwinner_padconf a13_padconf; +struct aw_gpio_conf a13_gpio_conf = { + .padconf = &a13_padconf, + .banks = "bcdefg", +}; #endif /* Defined in a20_padconf.c */ #ifdef SOC_ALLWINNER_A20 -extern const struct allwinner_padconf a20_padconf; +extern struct allwinner_padconf a20_padconf; +struct aw_gpio_conf a20_gpio_conf = { + .padconf = &a20_padconf, + .banks = "abcdefghi", +}; #endif /* Defined in a31_padconf.c */ #ifdef SOC_ALLWINNER_A31 -extern const struct allwinner_padconf a31_padconf; +extern struct allwinner_padconf a31_padconf; +struct aw_gpio_conf a31_gpio_conf = { + .padconf = &a31_padconf, + .banks = "abcdefgh", +}; #endif /* Defined in a31s_padconf.c */ #ifdef SOC_ALLWINNER_A31S -extern const struct allwinner_padconf a31s_padconf; +extern struct allwinner_padconf a31s_padconf; +struct aw_gpio_conf a31s_gpio_conf = { + .padconf = &a31s_padconf, + .banks = "abcdefgh", +}; #endif #if defined(SOC_ALLWINNER_A31) || defined(SOC_ALLWINNER_A31S) -extern const struct allwinner_padconf a31_r_padconf; +extern struct allwinner_padconf a31_r_padconf; +struct aw_gpio_conf a31_r_gpio_conf = { + .padconf = &a31_r_padconf, + .banks = "lm", +}; #endif /* Defined in a33_padconf.c */ #ifdef SOC_ALLWINNER_A33 -extern const struct allwinner_padconf a33_padconf; +extern struct allwinner_padconf a33_padconf; +struct aw_gpio_conf a33_gpio_conf = { + .padconf = &a33_padconf, + .banks = "bcdefgh", +}; #endif /* Defined in h3_padconf.c */ #if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) -extern const struct allwinner_padconf h3_padconf; -extern const struct allwinner_padconf h3_r_padconf; +extern struct allwinner_padconf h3_padconf; +extern struct allwinner_padconf h3_r_padconf; +struct aw_gpio_conf h3_gpio_conf = { + .padconf = &h3_padconf, + .banks = "acdefg", +}; +struct aw_gpio_conf h3_r_gpio_conf = { + .padconf = &h3_r_padconf, + .banks = "l", +}; #endif /* Defined in a83t_padconf.c */ #ifdef SOC_ALLWINNER_A83T -extern const struct allwinner_padconf a83t_padconf; -extern const struct allwinner_padconf a83t_r_padconf; +extern struct allwinner_padconf a83t_padconf; +extern struct allwinner_padconf a83t_r_padconf; +struct aw_gpio_conf a83t_gpio_conf = { + .padconf = &a83t_padconf, + .banks = "bcdefgh" +}; +struct aw_gpio_conf a83t_r_gpio_conf = { + .padconf = &a83t_r_padconf, + .banks = "l", +}; #endif /* Defined in a64_padconf.c */ #ifdef SOC_ALLWINNER_A64 -extern const struct allwinner_padconf a64_padconf; -extern const struct allwinner_padconf a64_r_padconf; +extern struct allwinner_padconf a64_padconf; +extern struct allwinner_padconf a64_r_padconf; +struct aw_gpio_conf a64_gpio_conf = { + .padconf = &a64_padconf, + .banks = "bcdefgh", +}; +struct aw_gpio_conf a64_r_gpio_conf = { + .padconf = &a64_r_padconf, + .banks = "l", +}; #endif /* Defined in h6_padconf.c */ #ifdef SOC_ALLWINNER_H6 -extern const struct allwinner_padconf h6_padconf; -extern const struct allwinner_padconf h6_r_padconf; +extern struct allwinner_padconf h6_padconf; +extern struct allwinner_padconf h6_r_padconf; +struct aw_gpio_conf h6_gpio_conf = { + .padconf = &h6_padconf, + .bank
Re: svn commit: r356755 - in head/sys: net netinet netinet6 netpfil/ipfw/nat64 sys
On January 15, 2020 2:38:05 PM PST, Gleb Smirnoff wrote: >On Wed, Jan 15, 2020 at 09:44:53AM -1000, Jeff Roberson wrote: >J> On Wed, 15 Jan 2020, Gleb Smirnoff wrote: >J> >J> > Author: glebius >J> > Date: Wed Jan 15 06:05:20 2020 >J> > New Revision: 356755 >J> > URL: https://svnweb.freebsd.org/changeset/base/356755 >J> > >J> > Log: >J> > Introduce NET_EPOCH_CALL() macro and use it everywhere where we >free >J> > data based on the network epoch. The macro reverses the >argument >J> > order of epoch_call(9) - first function, then its argument. NFC >J> >J> Is there some practical impact of changing the argument order or >does it >J> just seem more natural to you? > >It is just more natural. I'm suggesting to change prototype of >epoch_call() >to the same order as well. Yes. Are there any ports that might be affected, such as kms-drm or virtualbox-ose-kmod? -- Pardon the typos and autocorrect, small keyboard in use. Cy Schubert FreeBSD UNIX: Web: https://www.FreeBSD.org The need of the many outweighs the greed of the few. Sent from my Android device with K-9 Mail. Please excuse my brevity. ___ 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: r356801 - head/sys/netgraph
Author: krion (ports committer) Date: Thu Jan 16 20:12:15 2020 New Revision: 356801 URL: https://svnweb.freebsd.org/changeset/base/356801 Log: Generate MAC address from the FreeBSD OUI range. Submitted by: aleksandr.fedorov_vstack_com Approved by: kevans Differential Revision:https://reviews.freebsd.org/D23168 Modified: head/sys/netgraph/ng_eiface.c Modified: head/sys/netgraph/ng_eiface.c == --- head/sys/netgraph/ng_eiface.c Thu Jan 16 20:02:41 2020 (r356800) +++ head/sys/netgraph/ng_eiface.c Thu Jan 16 20:12:15 2020 (r356801) @@ -385,7 +385,7 @@ ng_eiface_constructor(node_p node) { struct ifnet *ifp; priv_p priv; - u_char eaddr[6] = {0,0,0,0,0,0}; + struct ether_addr eaddr; /* Allocate node and interface private structures */ priv = malloc(sizeof(*priv), M_NETGRAPH, M_WAITOK | M_ZERO); @@ -435,7 +435,8 @@ ng_eiface_constructor(node_p node) ifp->if_xname); /* Attach the interface */ - ether_ifattach(ifp, eaddr); + ether_gen_addr(ifp, &eaddr); + ether_ifattach(ifp, eaddr.octet); ifp->if_baudrate = ifmedia_baudrate(IFM_ETHER | IFM_1000_T); /* Done */ ___ 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: r356801 - head/sys/netgraph
On Thu, Jan 16, 2020 at 2:12 PM Kirill Ponomarev wrote: > > Author: krion (ports committer) > Date: Thu Jan 16 20:12:15 2020 > New Revision: 356801 > URL: https://svnweb.freebsd.org/changeset/base/356801 > > Log: > Generate MAC address from the FreeBSD OUI range. > > Submitted by: aleksandr.fedorov_vstack_com > Approved by: kevans > Differential Revision:https://reviews.freebsd.org/D23168 > Err, I was kinda wanting to get a sanity check from Julian before proceeding on this... I've CC'd him here, patch included below since it's minimal. Thanks, Kyle Evans > Modified: > head/sys/netgraph/ng_eiface.c > > Modified: head/sys/netgraph/ng_eiface.c > == > --- head/sys/netgraph/ng_eiface.c Thu Jan 16 20:02:41 2020 > (r356800) > +++ head/sys/netgraph/ng_eiface.c Thu Jan 16 20:12:15 2020 > (r356801) > @@ -385,7 +385,7 @@ ng_eiface_constructor(node_p node) > { > struct ifnet *ifp; > priv_p priv; > - u_char eaddr[6] = {0,0,0,0,0,0}; > + struct ether_addr eaddr; > > /* Allocate node and interface private structures */ > priv = malloc(sizeof(*priv), M_NETGRAPH, M_WAITOK | M_ZERO); > @@ -435,7 +435,8 @@ ng_eiface_constructor(node_p node) > ifp->if_xname); > > /* Attach the interface */ > - ether_ifattach(ifp, eaddr); > + ether_gen_addr(ifp, &eaddr); > + ether_ifattach(ifp, eaddr.octet); > ifp->if_baudrate = ifmedia_baudrate(IFM_ETHER | IFM_1000_T); > > /* Done */ > ___ > 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-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: r356802 - head/sys/arm/allwinner
Author: manu Date: Thu Jan 16 20:19:20 2020 New Revision: 356802 URL: https://svnweb.freebsd.org/changeset/base/356802 Log: arm: allwinner: ahci: target-supply is optional The target-supply regulator is optional so don't fail if it's not present. While here disable the clock on detach. MFC after:2 weeks X-MFC-With: 356600 Modified: head/sys/arm/allwinner/a10_ahci.c Modified: head/sys/arm/allwinner/a10_ahci.c == --- head/sys/arm/allwinner/a10_ahci.c Thu Jan 16 20:12:15 2020 (r356801) +++ head/sys/arm/allwinner/a10_ahci.c Thu Jan 16 20:19:20 2020 (r356802) @@ -122,6 +122,8 @@ __FBSDID("$FreeBSD$"); struct ahci_a10_softc { struct ahci_controller ahci_ctlr; regulator_t ahci_reg; + clk_t clk_pll; + clk_t clk_gate; }; static void inline @@ -303,11 +305,9 @@ ahci_a10_attach(device_t dev) int error; struct ahci_a10_softc *sc; struct ahci_controller *ctlr; - clk_t clk_pll, clk_gate; sc = device_get_softc(dev); ctlr = &sc->ahci_ctlr; - clk_pll = clk_gate = NULL; ctlr->quirks = AHCI_Q_NOPMP; ctlr->vendorid = 0; @@ -319,41 +319,38 @@ ahci_a10_attach(device_t dev) &ctlr->r_rid, RF_ACTIVE))) return (ENXIO); - /* Enable the regulator */ - error = regulator_get_by_ofw_property(dev, 0, "target-supply", - &sc->ahci_reg); - if (error != 0) { - device_printf(dev, "Cannot get regulator\n"); - goto fail; + /* Enable the (optional) regulator */ + if (regulator_get_by_ofw_property(dev, 0, "target-supply", + &sc->ahci_reg) == 0) { + error = regulator_enable(sc->ahci_reg); + if (error != 0) { + device_printf(dev, "Could not enable regulator\n"); + goto fail; + } } - error = regulator_enable(sc->ahci_reg); - if (error != 0) { - device_printf(dev, "Could not enable regulator\n"); - goto fail; - } /* Enable clocks */ - error = clk_get_by_ofw_index(dev, 0, 0, &clk_gate); + error = clk_get_by_ofw_index(dev, 0, 0, &sc->clk_gate); if (error != 0) { device_printf(dev, "Cannot get gate clock\n"); goto fail; } - error = clk_get_by_ofw_index(dev, 0, 1, &clk_pll); + error = clk_get_by_ofw_index(dev, 0, 1, &sc->clk_pll); if (error != 0) { device_printf(dev, "Cannot get PLL clock\n"); goto fail; } - error = clk_set_freq(clk_pll, PLL_FREQ, CLK_SET_ROUND_DOWN); + error = clk_set_freq(sc->clk_pll, PLL_FREQ, CLK_SET_ROUND_DOWN); if (error != 0) { device_printf(dev, "Cannot set PLL frequency\n"); goto fail; } - error = clk_enable(clk_pll); + error = clk_enable(sc->clk_pll); if (error != 0) { device_printf(dev, "Cannot enable PLL\n"); goto fail; } - error = clk_enable(clk_gate); + error = clk_enable(sc->clk_gate); if (error != 0) { device_printf(dev, "Cannot enable clk gate\n"); goto fail; @@ -378,12 +375,12 @@ ahci_a10_attach(device_t dev) return (ahci_attach(dev)); fail: - if (sc->ahci_reg != 0) + if (sc->ahci_reg != NULL) regulator_disable(sc->ahci_reg); - if (clk_gate != NULL) - clk_release(clk_gate); - if (clk_pll != NULL) - clk_release(clk_pll); + if (sc->clk_gate != NULL) + clk_release(sc->clk_gate); + if (sc->clk_pll != NULL) + clk_release(sc->clk_pll); bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); return (error); } @@ -391,7 +388,19 @@ fail: static int ahci_a10_detach(device_t dev) { + struct ahci_a10_softc *sc; + struct ahci_controller *ctlr; + sc = device_get_softc(dev); + ctlr = &sc->ahci_ctlr; + + if (sc->ahci_reg != NULL) + regulator_disable(sc->ahci_reg); + if (sc->clk_gate != NULL) + clk_release(sc->clk_gate); + if (sc->clk_pll != NULL) + clk_release(sc->clk_pll); + bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); return (ahci_detach(dev)); } ___ 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: r356755 - in head/sys: net netinet netinet6 netpfil/ipfw/nat64 sys
On Thu, Jan 16, 2020 at 12:06:17PM -0800, Cy Schubert wrote: C> On January 15, 2020 2:38:05 PM PST, Gleb Smirnoff wrote: C> >On Wed, Jan 15, 2020 at 09:44:53AM -1000, Jeff Roberson wrote: C> >J> On Wed, 15 Jan 2020, Gleb Smirnoff wrote: C> >J> C> >J> > Author: glebius C> >J> > Date: Wed Jan 15 06:05:20 2020 C> >J> > New Revision: 356755 C> >J> > URL: https://svnweb.freebsd.org/changeset/base/356755 C> >J> > C> >J> > Log: C> >J> > Introduce NET_EPOCH_CALL() macro and use it everywhere where we C> >free C> >J> > data based on the network epoch. The macro reverses the C> >argument C> >J> > order of epoch_call(9) - first function, then its argument. NFC C> >J> C> >J> Is there some practical impact of changing the argument order or C> >does it C> >J> just seem more natural to you? C> > C> >It is just more natural. I'm suggesting to change prototype of C> >epoch_call() C> >to the same order as well. C> C> Yes. C> C> Are there any ports that might be affected, such as kms-drm or virtualbox-ose-kmod? I'm not aware of any software outside /usr/src/sys that uses epoch. -- Gleb Smirnoff ___ 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: r356803 - head/sys/dev/extres/regulator
Author: manu Date: Thu Jan 16 20:52:26 2020 New Revision: 356803 URL: https://svnweb.freebsd.org/changeset/base/356803 Log: regulator_fixed: Add a get_voltage method Some consumer cannot know the voltage of the regulator without it. While here, refuse to attach is min_voltage != max_voltage, it shouldn't happens anyway. Reviewed by: mmel MFC after:1 month Differential Revision:https://reviews.freebsd.org/D23003 Modified: head/sys/dev/extres/regulator/regulator_fixed.c Modified: head/sys/dev/extres/regulator/regulator_fixed.c == --- head/sys/dev/extres/regulator/regulator_fixed.c Thu Jan 16 20:19:20 2020(r356802) +++ head/sys/dev/extres/regulator/regulator_fixed.c Thu Jan 16 20:52:26 2020(r356803) @@ -73,6 +73,7 @@ static int regnode_fixed_enable(struct regnode *regnod int *udelay); static int regnode_fixed_status(struct regnode *regnode, int *status); static int regnode_fixed_stop(struct regnode *regnode, int *udelay); +static int regnode_fixed_get_voltage(struct regnode *regnode, int *uvolt); static regnode_method_t regnode_fixed_methods[] = { /* Regulator interface */ @@ -80,6 +81,7 @@ static regnode_method_t regnode_fixed_methods[] = { REGNODEMETHOD(regnode_enable, regnode_fixed_enable), REGNODEMETHOD(regnode_status, regnode_fixed_status), REGNODEMETHOD(regnode_stop, regnode_fixed_stop), + REGNODEMETHOD(regnode_get_voltage, regnode_fixed_get_voltage), REGNODEMETHOD(regnode_check_voltage,regnode_method_check_voltage), REGNODEMETHOD_END }; @@ -280,6 +282,16 @@ regnode_fixed_status(struct regnode *regnode, int *sta return (rv); } +static int +regnode_fixed_get_voltage(struct regnode *regnode, int *uvolt) +{ + struct regnode_fixed_sc *sc; + + sc = regnode_get_softc(regnode); + *uvolt = sc->param->min_uvolt; + return (0); +} + int regnode_fixed_register(device_t dev, struct regnode_fixed_init_def *init_def) { @@ -382,6 +394,10 @@ regfix_parse_fdt(struct regfix_softc * sc) return(rv); } + if (init_def->std_param.min_uvolt != init_def->std_param.max_uvolt) { + device_printf(sc->dev, "min_uvolt != max_uvolt\n"); + return (ENXIO); + } /* Fixed regulator uses 'startup-delay-us' property for enable_delay */ rv = OF_getencprop(node, "startup-delay-us", &init_def->std_param.enable_delay, ___ 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: r356806 - in head: share/man/man9 sys/dev/fdt
Author: manu Date: Thu Jan 16 21:19:27 2020 New Revision: 356806 URL: https://svnweb.freebsd.org/changeset/base/356806 Log: fdt_pinctrl: Add new methods for gpios Most of the gpio controller cannot configure or get the configuration of the pin muxing as it's usually handled in the pinctrl driver. But they can know what is the pinmuxing driver either because they are child of it or via the gpio-range property. Add some new methods to fdt_pinctrl that a pin controller can implement. Some methods are : fdt_pinctrl_is_gpio: Use to know if the pin in the gpio mode fdt_pinctrl_set_flags: Set the flags of the pin (pullup/pulldown etc ...) fdt_pinctrl_get_flags: Get the flags of the pin (pullup/pulldown etc ...) The defaults method returns EOPNOTSUPP. Reviewed by: ian, bcr (manpages) MFC after:1 month Differential Revision:https://reviews.freebsd.org/D23093 Modified: head/share/man/man9/fdt_pinctrl.9 head/sys/dev/fdt/fdt_pinctrl_if.m Modified: head/share/man/man9/fdt_pinctrl.9 == --- head/share/man/man9/fdt_pinctrl.9 Thu Jan 16 20:57:29 2020 (r356805) +++ head/share/man/man9/fdt_pinctrl.9 Thu Jan 16 21:19:27 2020 (r356806) @@ -125,6 +125,36 @@ foo_configure_pins(device_t dev, phandle_t cfgxref) } static int +foo_is_gpio(device_t dev, device_t gpiodev, bool *is_gpio) +{ + return (foo_is_pin_func_gpio(is_gpio)); +} + +static int +foo_set_flags(device_t dev, device_t gpiodev, uint32_t pin, uint32_t flags) +{ + int rv; + + rv = foo_is_pin_func_gpio(is_gpio); + if (rv != 0) + return (rv); + foo_set_flags(pin, flags); + return (0); +} + +static int +foo_get_flags(device_t dev, device_t gpiodev, uint32_t pin, uint32_t *flags) +{ + int rv; + + rv = foo_is_pin_func_gpio(is_gpio); + if (rv != 0) + return (rv); + foo_get_flags(pin, flags); + return (0); +} + +static int foo_attach(device_t dev) { ... @@ -144,6 +174,9 @@ static device_method_t foo_methods[] = { /* fdt_pinctrl interface */ DEVMETHOD(fdt_pinctrl_configure, foo_configure_pins), + DEVMETHOD(fdt_pinctrl_is_gpio, foo_is_gpio), + DEVMETHOD(fdt_pinctrl_set_flags, foo_set_flags), + DEVMETHOD(fdt_pinctrl_get_flags, foo_get_flags), /* Terminate method list */ DEVMETHOD_END Modified: head/sys/dev/fdt/fdt_pinctrl_if.m == --- head/sys/dev/fdt/fdt_pinctrl_if.m Thu Jan 16 20:57:29 2020 (r356805) +++ head/sys/dev/fdt/fdt_pinctrl_if.m Thu Jan 16 21:19:27 2020 (r356806) @@ -36,6 +36,31 @@ INTERFACE fdt_pinctrl; +CODE { + static int + fdt_pinctrl_default_is_gpio(device_t pinctrl, device_t gpio, bool *is_gpio) + { + + return (EOPNOTSUPP); + } + + static int + fdt_pinctrl_default_set_flags(device_t pinctrl, device_t gpio, uint32_t pin, + uint32_t flags) + { + + return (EOPNOTSUPP); + } + + static int + fdt_pinctrl_default_get_flags(device_t pinctrl, device_t gpio, uint32_t pin, + uint32_t *flags) + { + + return (EOPNOTSUPP); + } +}; + # Needed for timestamping device probe/attach calls HEADER { #include @@ -57,3 +82,36 @@ METHOD int configure { phandle_t cfgxref; }; + +# +# Test if the pin is in gpio mode +# Called from a gpio device +# +METHOD int is_gpio { + device_t pinctrl; + device_t gpio; + uint32_t pin; + bool *is_gpio; +} DEFAULT fdt_pinctrl_default_is_gpio; + +# +# Set the flags of a pin +# Called from a gpio device +# +METHOD int set_flags { + device_t pinctrl; + device_t gpio; + uint32_t pin; + uint32_t flags; +} DEFAULT fdt_pinctrl_default_set_flags; + +# +# Get the flags of a pin +# Called from a gpio device +# +METHOD int get_flags { + device_t pinctrl; + device_t gpio; + uint32_t pin; + uint32_t *flags; +} DEFAULT fdt_pinctrl_default_get_flags; ___ 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: r356807 - head/sys/arm64/rockchip
Author: manu Date: Thu Jan 16 21:21:20 2020 New Revision: 356807 URL: https://svnweb.freebsd.org/changeset/base/356807 Log: arm64: rockchip: Add new interface for rk_pinctrl The gpio controller in rockchips SoC in a child of the pinctrl driver and cannot control pullups and pulldowns. Use the new fdt_pinctrl interface for accessing pin capabilities and setting them. We can now report that every pins is capable of being IN or OUT function and PULLUP PULLDOWN. If the pin isn't in gpio mode no changes will be allowed. Reviewed by: ganbold (previous version) MFC after:1 month Differential Revision:https://reviews.freebsd.org/D22849 Modified: head/sys/arm64/rockchip/rk_gpio.c head/sys/arm64/rockchip/rk_pinctrl.c Modified: head/sys/arm64/rockchip/rk_gpio.c == --- head/sys/arm64/rockchip/rk_gpio.c Thu Jan 16 21:19:27 2020 (r356806) +++ head/sys/arm64/rockchip/rk_gpio.c Thu Jan 16 21:21:20 2020 (r356807) @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); #include "gpio_if.h" +#include "fdt_pinctrl_if.h" + #defineRK_GPIO_SWPORTA_DR 0x00/* Data register */ #defineRK_GPIO_SWPORTA_DDR 0x04/* Data direction register */ @@ -68,6 +70,9 @@ __FBSDID("$FreeBSD$"); #defineRK_GPIO_LS_SYNC 0x60/* Level sensitive syncronization enable register */ +#defineRK_GPIO_DEFAULT_CAPS(GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ +GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN) + struct rk_gpio_softc { device_tsc_dev; device_tsc_busdev; @@ -76,6 +81,7 @@ struct rk_gpio_softc { bus_space_tag_t sc_bst; bus_space_handle_t sc_bsh; clk_t clk; + device_tpinctrl; }; static struct ofw_compat_data compat_data[] = { @@ -123,6 +129,7 @@ rk_gpio_attach(device_t dev) sc = device_get_softc(dev); sc->sc_dev = dev; + sc->pinctrl = device_get_parent(dev); node = ofw_bus_get_node(sc->sc_dev); if (!OF_hasprop(node, "gpio-controller")) @@ -220,18 +227,30 @@ rk_gpio_pin_getflags(device_t dev, uint32_t pin, uint3 { struct rk_gpio_softc *sc; uint32_t reg; + int rv; + bool is_gpio; sc = device_get_softc(dev); - /* XXX Combine this with parent (pinctrl) */ + rv = FDT_PINCTRL_IS_GPIO(sc->pinctrl, dev, pin, &is_gpio); + if (rv != 0) + return (rv); + if (!is_gpio) + return (EINVAL); + + *flags = 0; + rv = FDT_PINCTRL_GET_FLAGS(sc->pinctrl, dev, pin, flags); + if (rv != 0) + return (rv); + RK_GPIO_LOCK(sc); reg = RK_GPIO_READ(sc, RK_GPIO_SWPORTA_DDR); RK_GPIO_UNLOCK(sc); if (reg & (1 << pin)) - *flags = GPIO_PIN_OUTPUT; + *flags |= GPIO_PIN_OUTPUT; else - *flags = GPIO_PIN_INPUT; + *flags |= GPIO_PIN_INPUT; return (0); } @@ -240,9 +259,7 @@ static int rk_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) { - /* Caps are managed by the pinctrl device */ - /* XXX Pass this to parent (pinctrl) */ - *caps = 0; + *caps = RK_GPIO_DEFAULT_CAPS; return (0); } @@ -251,10 +268,21 @@ rk_gpio_pin_setflags(device_t dev, uint32_t pin, uint3 { struct rk_gpio_softc *sc; uint32_t reg; + int rv; + bool is_gpio; sc = device_get_softc(dev); - /* XXX Combine this with parent (pinctrl) */ + rv = FDT_PINCTRL_IS_GPIO(sc->pinctrl, dev, pin, &is_gpio); + if (rv != 0) + return (rv); + if (!is_gpio) + return (EINVAL); + + rv = FDT_PINCTRL_SET_FLAGS(sc->pinctrl, dev, pin, flags); + if (rv != 0) + return (rv); + RK_GPIO_LOCK(sc); reg = RK_GPIO_READ(sc, RK_GPIO_SWPORTA_DDR); Modified: head/sys/arm64/rockchip/rk_pinctrl.c == --- head/sys/arm64/rockchip/rk_pinctrl.cThu Jan 16 21:19:27 2020 (r356806) +++ head/sys/arm64/rockchip/rk_pinctrl.cThu Jan 16 21:21:20 2020 (r356807) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include "gpio_if.h" #include "syscon_if.h" +#include "fdt_pinctrl_if.h" struct rk_pinctrl_pin_drive { uint32_tbank; @@ -101,6 +102,8 @@ struct rk_pinctrl_conf { uint32_t(*get_pd_offset)(struct rk_pinctrl_softc *, uint32_t); struct syscon *(*get_syscon)(struct rk_pinctrl_softc *, uint32_t); int (*parse_bias)(phandle_t, int); + int (*resolv_bias_value)(int, int); + int (*get_bias_value)(int, int); }; struct rk_pinctrl_softc { @@ -109,8 +112,13 @@ struct rk_pinctrl_softc { struct syscon
svn commit: r356808 - in head/sys: arm64/conf arm64/rockchip arm64/rockchip/clk conf
Author: manu Date: Thu Jan 16 21:25:13 2020 New Revision: 356808 URL: https://svnweb.freebsd.org/changeset/base/356808 Log: arm64: rockchip: Add RK3399 PWM driver Add a driver for the pwm controller in the RK3399 SoC Submitted by: bdragon (original version) Reviewed by: ganbold (previous version) MFC after:1 month Differential Revision:https://reviews.freebsd.org/D19046 Added: head/sys/arm64/rockchip/rk_pwm.c (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/arm64/rockchip/clk/rk3399_pmucru.c head/sys/conf/files.arm64 Modified: head/sys/arm64/conf/GENERIC == --- head/sys/arm64/conf/GENERIC Thu Jan 16 21:21:20 2020(r356807) +++ head/sys/arm64/conf/GENERIC Thu Jan 16 21:25:13 2020(r356808) @@ -297,6 +297,7 @@ device rk_spi # RockChip SPI controller # PWM device pwm device aw_pwm +device rk_pwm # Console device vt Modified: head/sys/arm64/rockchip/clk/rk3399_pmucru.c == --- head/sys/arm64/rockchip/clk/rk3399_pmucru.c Thu Jan 16 21:21:20 2020 (r356807) +++ head/sys/arm64/rockchip/clk/rk3399_pmucru.c Thu Jan 16 21:25:13 2020 (r356808) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #definePCLK_I2C0_PMU 27 #definePCLK_I2C4_PMU 28 #definePCLK_I2C8_PMU 29 +#definePCLK_RKPWM_PMU 30 static struct rk_cru_gate rk3399_pmu_gates[] = { /* PMUCRU_CLKGATE_CON1 */ @@ -67,8 +68,8 @@ static struct rk_cru_gate rk3399_pmu_gates[] = { CRU_GATE(PCLK_I2C0_PMU, "pclk_i2c0_pmu", "pclk_pmu_src", 0x104, 7) CRU_GATE(PCLK_I2C4_PMU, "pclk_i2c4_pmu", "pclk_pmu_src", 0x104, 8) CRU_GATE(PCLK_I2C8_PMU, "pclk_i2c8_pmu", "pclk_pmu_src", 0x104, 9) + CRU_GATE(PCLK_RKPWM_PMU, "pclk_rkpwm_pmu", "pclk_pmu_src", 0x104, 10) }; - /* * PLLs Added: head/sys/arm64/rockchip/rk_pwm.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/rk_pwm.cThu Jan 16 21:25:13 2020 (r356808) @@ -0,0 +1,403 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Emmanuel Vadot + * Copyright (c) 2019 Brandon Bergren + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include "pwmbus_if.h" + +/* Register offsets. */ +#defineRK_PWM_COUNTER 0x00 +#defineRK_PWM_PERIOD 0x04 +#defineRK_PWM_DUTY 0x08 +#defineRK_PWM_CTRL 0x0c + +#defineSET(reg,mask,val) reg = ((reg & ~mask) | val) + +#defineRK_PWM_CTRL_ENABLE_MASK (1 << 0) +#define RK_PWM_CTRL_ENABLED(1 << 0) +#define RK_PWM_CTRL_DISABLED (0) + +#defineRK_PWM_CTRL_MODE_MASK (3 << 1) +#define RK_PWM_CTRL_MODE_ONESHOT (0) +#define RK_PWM_CTRL_MODE_CONTINUOUS(1 << 1) +#define RK_PWM_CTRL_MODE_CAPTURE (1 << 2) + +#defineRK_PWM_CTRL_DUTY_MASK (1 << 3) +#define RK_PWM_CTRL_DUTY_POSITIVE (1 << 3) +#define RK_PWM_CTRL_DUTY_NEGATIVE (0) + +#defineRK_PWM_CTRL_INACTIVE_MASK (1 << 4) +#define RK_PWM_CTRL_INACTIVE_POSITIVE (1 << 4) +#define RK_PWM_CTRL_INACTIVE_NE
svn commit: r356809 - head/usr.sbin/extattr
Author: asomers Date: Thu Jan 16 21:31:56 2020 New Revision: 356809 URL: https://svnweb.freebsd.org/changeset/base/356809 Log: setextattr: Increase stdin buffer size to 4096 Extended attribute values can potentially be quite large. One test for ZFS is supposed to set a 200MB xattr. However, the buffer size for reading values from stdin with setextattr -i is so small that the test times out waiting for tiny chunks of data to be buffered and appended to an sbuf. Increasing the buffer size should help alleviate some of the burden of reallocating larger sbufs when writing large extended attributes. Submitted by: Ryan Moeller MFC after:2 weeks Sponsored by: iXsystems, Inc. Differential Revision:https://reviews.freebsd.org/D23211 Modified: head/usr.sbin/extattr/rmextattr.c Modified: head/usr.sbin/extattr/rmextattr.c == --- head/usr.sbin/extattr/rmextattr.c Thu Jan 16 21:25:13 2020 (r356808) +++ head/usr.sbin/extattr/rmextattr.c Thu Jan 16 21:31:56 2020 (r356809) @@ -104,7 +104,7 @@ mkbuf(char **buf, int *oldlen, int newlen) int main(int argc, char *argv[]) { -#define STDIN_BUF_SZ 1024 +#define STDIN_BUF_SZ 4096 char stdin_data[STDIN_BUF_SZ]; char*p; ___ 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: r356810 - head/usr.bin/random
Author: cem Date: Thu Jan 16 21:38:44 2020 New Revision: 356810 URL: https://svnweb.freebsd.org/changeset/base/356810 Log: random(6): Fix off-by-one After r355693, random(6) -f sometimes fail to output all the lines of the input file. This is because the range from which random indices are chosen is too big, so occasionally the random selection doesn't correspond to any line and nothing gets printed. (Ed. note: Mea culpa. Working on r355693, I was confused by the sometime use of 1-indexing, sometimes 0-indexing in randomize_fd().) Submitted by: Ryan Moeller X-MFC-With: r355693 Sponsored by: iXsystems, Inc. Differential Revision:https://reviews.freebsd.org/D23199 Modified: head/usr.bin/random/randomize_fd.c Modified: head/usr.bin/random/randomize_fd.c == --- head/usr.bin/random/randomize_fd.c Thu Jan 16 21:31:56 2020 (r356809) +++ head/usr.bin/random/randomize_fd.c Thu Jan 16 21:38:44 2020 (r356810) @@ -211,7 +211,7 @@ make_token: free(buf); for (i = numnode; i > 0; i--) { - selected = arc4random_uniform(numnode + 1); + selected = arc4random_uniform(numnode); for (j = 0, prev = n = rand_root; n != NULL; j++, prev = n, n = n->next) { if (j == selected) { ___ 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: r356811 - head/sys/kern
Author: mjg Date: Thu Jan 16 21:43:13 2020 New Revision: 356811 URL: https://svnweb.freebsd.org/changeset/base/356811 Log: vfs: refcator vnode allocation Semantics are almost identical. Some code is deduplicated and there are fewer memory accesses. Reviewed by: kib, jeff Differential Revision:https://reviews.freebsd.org/D23158 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c == --- head/sys/kern/vfs_subr.cThu Jan 16 21:38:44 2020(r356810) +++ head/sys/kern/vfs_subr.cThu Jan 16 21:43:13 2020(r356811) @@ -1275,23 +1275,6 @@ vnlru_recalc(void) vlowat = vhiwat / 2; } -/* XXX some names and initialization are bad for limits and watermarks. */ -static int -vspace(void) -{ - u_long rnumvnodes, rfreevnodes; - int space; - - rnumvnodes = atomic_load_long(&numvnodes); - rfreevnodes = atomic_load_long(&freevnodes); - if (rnumvnodes > desiredvnodes) - return (0); - space = desiredvnodes - rnumvnodes; - if (freevnodes > wantfreevnodes) - space += rfreevnodes - wantfreevnodes; - return (space); -} - /* * Attempt to recycle vnodes in a context that is always safe to block. * Calling vlrurecycle() from the bowels of filesystem code has some @@ -1300,12 +1283,40 @@ vspace(void) static struct proc *vnlruproc; static int vnlruproc_sig; +static bool +vnlru_under(u_long rnumvnodes, u_long limit) +{ + u_long rfreevnodes, space; + + if (__predict_false(rnumvnodes > desiredvnodes)) + return (true); + + space = desiredvnodes - rnumvnodes; + if (space < limit) { + rfreevnodes = atomic_load_long(&freevnodes); + if (rfreevnodes > wantfreevnodes) + space += rfreevnodes - wantfreevnodes; + } + return (space < limit); +} + static void +vnlru_kick(void) +{ + + mtx_assert(&vnode_list_mtx, MA_OWNED); + if (vnlruproc_sig == 0) { + vnlruproc_sig = 1; + wakeup(vnlruproc); + } +} + +static void vnlru_proc(void) { u_long rnumvnodes, rfreevnodes, target; unsigned long onumvnodes; - int done, force, trigger, usevnodes, vsp; + int done, force, trigger, usevnodes; bool reclaim_nc_src; EVENTHANDLER_REGISTER(shutdown_pre_sync, kproc_shutdown, vnlruproc, @@ -1321,8 +1332,10 @@ vnlru_proc(void) * adjusted using its sysctl, or emergency growth), first * try to reduce it by discarding from the free list. */ - if (rnumvnodes > desiredvnodes) + if (rnumvnodes > desiredvnodes) { vnlru_free_locked(rnumvnodes - desiredvnodes, NULL); + rnumvnodes = atomic_load_long(&numvnodes); + } /* * Sleep if the vnode cache is in a good state. This is * when it is not over-full and has space for about a 4% @@ -1334,8 +1347,7 @@ vnlru_proc(void) force = 1; vstir = 0; } - vsp = vspace(); - if (vsp >= vlowat && force == 0) { + if (force == 0 && !vnlru_under(rnumvnodes, vlowat)) { vnlruproc_sig = 0; wakeup(&vnlruproc_sig); msleep(vnlruproc, &vnode_list_mtx, @@ -1394,8 +1406,7 @@ vnlru_proc(void) * After becoming active to expand above low water, keep * active until above high water. */ - vsp = vspace(); - force = vsp < vhiwat; + force = vnlru_under(numvnodes, vhiwat) ? 1 : 0; } } @@ -1471,58 +1482,35 @@ vtryrecycle(struct vnode *vp) return (0); } -static void -vcheckspace(void) -{ - int vsp; - - vsp = vspace(); - if (vsp < vlowat && vnlruproc_sig == 0) { - vnlruproc_sig = 1; - wakeup(vnlruproc); - } -} - /* - * Wait if necessary for space for a new vnode. + * Allocate a new vnode. + * + * The operation never returns an error. Returning an error was disabled + * in r145385 (dated 2005) with the following comment: + * + * XXX Not all VFS_VGET/ffs_vget callers check returns. + * + * Given the age of this commit (almost 15 years at the time of writing this + * comment) restoring the ability to fail requires a significant audit of + * all codepaths. + * + * The routine can try to free a vnode or stall for up to 1 second waiting for + * vnlru to clear things up, but ultimately always performs a M_WAITOK allocation. */ -static int -vn_alloc_wait(int suspended) -{ - - mtx_assert(&vnode_list_mtx, MA_OWNED); - if (numvnodes >= desiredvnodes) { - if (suspended) { - /* -
svn commit: r356812 - head/sys/kern
Author: mjg Date: Thu Jan 16 21:45:21 2020 New Revision: 356812 URL: https://svnweb.freebsd.org/changeset/base/356812 Log: vfs: increment numvnodes without the vnode list lock unless under pressure The vnode list lock is only needed to reclaim free vnodes or kick the vnlru thread (or to block and not miss a wake up (but note the sleep has a timeout so this would not be a correctness issue)). Try to get away without the lock by just doing an atomic increment. The lock is contended e.g., during poudriere -j 104 where about half of all acquires come from vnode allocation code. Note the entire scheme needs a rewrite, the above just reduces it's SMP impact. Reviewed by: kib Differential Revision:https://reviews.freebsd.org/D23140 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c == --- head/sys/kern/vfs_subr.cThu Jan 16 21:43:13 2020(r356811) +++ head/sys/kern/vfs_subr.cThu Jan 16 21:45:21 2020(r356812) @@ -1497,21 +1497,22 @@ vtryrecycle(struct vnode *vp) * The routine can try to free a vnode or stall for up to 1 second waiting for * vnlru to clear things up, but ultimately always performs a M_WAITOK allocation. */ -static struct vnode * -vn_alloc(struct mount *mp) +static u_long vn_alloc_cyclecount; + +static struct vnode * __noinline +vn_alloc_hard(struct mount *mp) { u_long rnumvnodes, rfreevnodes; - static u_long cyclecount; mtx_lock(&vnode_list_mtx); rnumvnodes = atomic_load_long(&numvnodes); if (rnumvnodes + 1 < desiredvnodes) { - cyclecount = 0; + vn_alloc_cyclecount = 0; goto alloc; } rfreevnodes = atomic_load_long(&freevnodes); - if (cyclecount++ >= rfreevnodes) { - cyclecount = 0; + if (vn_alloc_cyclecount++ >= rfreevnodes) { + vn_alloc_cyclecount = 0; vstir = 1; } /* @@ -1543,6 +1544,22 @@ alloc: if (vnlru_under(rnumvnodes, vlowat)) vnlru_kick(); mtx_unlock(&vnode_list_mtx); + return (uma_zalloc(vnode_zone, M_WAITOK)); +} + +static struct vnode * +vn_alloc(struct mount *mp) +{ + u_long rnumvnodes; + + if (__predict_false(vn_alloc_cyclecount != 0)) + return (vn_alloc_hard(mp)); + rnumvnodes = atomic_fetchadd_long(&numvnodes, 1) + 1; + if (__predict_false(vnlru_under(rnumvnodes, vlowat))) { + atomic_subtract_long(&numvnodes, 1); + return (vn_alloc_hard(mp)); + } + return (uma_zalloc(vnode_zone, M_WAITOK)); } ___ 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: r356813 - head/sys/dev/mmc/host
Author: manu Date: Thu Jan 16 21:50:53 2020 New Revision: 356813 URL: https://svnweb.freebsd.org/changeset/base/356813 Log: dwmmc: Remove max_hz from the softc We never use it so directly set the value to the mmc host structure. Modified: head/sys/dev/mmc/host/dwmmc.c head/sys/dev/mmc/host/dwmmc_var.h Modified: head/sys/dev/mmc/host/dwmmc.c == --- head/sys/dev/mmc/host/dwmmc.c Thu Jan 16 21:45:21 2020 (r356812) +++ head/sys/dev/mmc/host/dwmmc.c Thu Jan 16 21:50:53 2020 (r356813) @@ -484,8 +484,8 @@ parse_fdt(struct dwmmc_softc *sc) sc->host.caps |= MMC_CAP_8_BIT_DATA; /* max-frequency */ - if (OF_getencprop(node, "max-frequency", &sc->max_hz, sizeof(uint32_t)) <= 0) - sc->max_hz = 2; + if (OF_getencprop(node, "max-frequency", &sc->host.f_max, sizeof(uint32_t)) <= 0) + sc->host.f_max = 2; /* fifo-depth */ if ((len = OF_getproplen(node, "fifo-depth")) > 0) { @@ -726,7 +726,6 @@ dwmmc_attach(device_t dev) WRITE4(sc, SDMMC_CTRL, SDMMC_CTRL_INT_ENABLE); sc->host.f_min = 40; - sc->host.f_max = sc->max_hz; sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; sc->host.caps |= MMC_CAP_HSPEED; sc->host.caps |= MMC_CAP_SIGNALING_330; Modified: head/sys/dev/mmc/host/dwmmc_var.h == --- head/sys/dev/mmc/host/dwmmc_var.h Thu Jan 16 21:45:21 2020 (r356812) +++ head/sys/dev/mmc/host/dwmmc_var.h Thu Jan 16 21:50:53 2020 (r356813) @@ -79,7 +79,6 @@ struct dwmmc_softc { uint32_tacd_rcvd; uint32_tcmd_done; uint64_tbus_hz; - uint32_tmax_hz; uint32_tfifo_depth; uint32_tnum_slots; uint32_tsdr_timing; ___ 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: r356816 - head/usr.sbin/periodic/etc/security
Author: kp Date: Thu Jan 16 22:08:05 2020 New Revision: 356816 URL: https://svnweb.freebsd.org/changeset/base/356816 Log: Fix pfdenied not returning any results When _a is empty we end up with an invalid invocation of pfctl, and no output. We must add quotes to make it clear to pfctl that we're passing an empty anchor name. PR: 224415 Submitted by: sigsys AT gmail.com MFC after:2 weeks Modified: head/usr.sbin/periodic/etc/security/520.pfdenied Modified: head/usr.sbin/periodic/etc/security/520.pfdenied == --- head/usr.sbin/periodic/etc/security/520.pfdeniedThu Jan 16 21:53:37 2020(r356815) +++ head/usr.sbin/periodic/etc/security/520.pfdeniedThu Jan 16 22:08:05 2020(r356816) @@ -46,7 +46,7 @@ then TMP=`mktemp -t security` for _a in "" $(pfctl -a "blacklistd" -sA 2>/dev/null) do - pfctl -a ${_a} -sr -v -z 2>/dev/null | \ + pfctl -a "${_a}" -sr -v -z 2>/dev/null | \ nawk '{if (/^block/) {buf=$0; getline; gsub(" +"," ",$0); if ($5 > 0) print buf$0;} }' >> ${TMP} done if [ -s ${TMP} ]; then ___ 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: r356817 - head/sys/fs/unionfs
Author: mjg Date: Thu Jan 16 22:45:08 2020 New Revision: 356817 URL: https://svnweb.freebsd.org/changeset/base/356817 Log: unionfs: use MNTK_NOMSYNC Modified: head/sys/fs/unionfs/union_vfsops.c Modified: head/sys/fs/unionfs/union_vfsops.c == --- head/sys/fs/unionfs/union_vfsops.c Thu Jan 16 22:08:05 2020 (r356816) +++ head/sys/fs/unionfs/union_vfsops.c Thu Jan 16 22:45:08 2020 (r356817) @@ -296,6 +296,7 @@ unionfs_domount(struct mount *mp) if ((ump->um_lowervp->v_mount->mnt_flag & MNT_LOCAL) && (ump->um_uppervp->v_mount->mnt_flag & MNT_LOCAL)) mp->mnt_flag |= MNT_LOCAL; + mp->mnt_kern_flag |= MNTK_NOMSYNC; MNT_IUNLOCK(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-unsubscr...@freebsd.org"
Re: svn commit: r356758 - in head/usr.sbin/bsdinstall: . scripts
On Thu, Jan 16, 2020 at 02:43:37PM +0700, Eugene Grosbein wrote: > 16.01.2020 4:41, Ed Maste wrote: > > > On Wed, 15 Jan 2020 at 16:10, Eugene Grosbein wrote: > >> > >> There are multiple scenarios there ZFS may be sub-optimal at least: small > >> i386 virtual guests > >> or 32-bit only hardware like AMD Geode, or big amd64 SSD-only systems with > >> bhyve and multiple guests > >> that need lots of memory and should not fight with ZFS for RAM etc. > > > > That may well be the case, but our defaults should represent the > > configuration that's desirable to the largest set of users, and IMO > > that's ZFS in most cases today. > > > > It might be that we should default to UFS on i386 and ZFS on amd64? > > UFS may be better for any virtual guest having RAM less or equal to 4GB. Why? ___ 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: r356818 - in head/sys/geom: . concat eli gate journal linux_lvm mirror nop part raid raid3 shsec stripe
Author: imp Date: Fri Jan 17 01:15:55 2020 New Revision: 356818 URL: https://svnweb.freebsd.org/changeset/base/356818 Log: Pass BIO_SPEEDUP through all the geom layers While some geom layers pass unknown commands down, not all do. For the ones that don't, pass BIO_SPEEDUP down to the providers that constittue the geom, as applicable. No changes to vinum or virstor because I was unsure how to add this support, and I'm also unsure how to test these. gvinum doesn't implement BIO_FLUSH either, so it may just be poorly maintained. gvirstor is for testing and not supportig BIO_SPEEDUP is fine. Reviewed by: chs Differential Revision: https://reviews.freebsd.org/D23183 Modified: head/sys/geom/concat/g_concat.c head/sys/geom/eli/g_eli.c head/sys/geom/gate/g_gate.c head/sys/geom/geom_disk.c head/sys/geom/geom_io.c head/sys/geom/geom_slice.c head/sys/geom/journal/g_journal.c head/sys/geom/linux_lvm/g_linux_lvm.c head/sys/geom/mirror/g_mirror.c head/sys/geom/nop/g_nop.c head/sys/geom/nop/g_nop.h head/sys/geom/part/g_part.c head/sys/geom/raid/g_raid.c head/sys/geom/raid/tr_concat.c head/sys/geom/raid/tr_raid0.c head/sys/geom/raid/tr_raid1.c head/sys/geom/raid/tr_raid1e.c head/sys/geom/raid/tr_raid5.c head/sys/geom/raid3/g_raid3.c head/sys/geom/shsec/g_shsec.c head/sys/geom/stripe/g_stripe.c Modified: head/sys/geom/concat/g_concat.c == --- head/sys/geom/concat/g_concat.c Thu Jan 16 22:45:08 2020 (r356817) +++ head/sys/geom/concat/g_concat.c Fri Jan 17 01:15:55 2020 (r356818) @@ -279,8 +279,11 @@ g_concat_done(struct bio *bp) g_destroy_bio(bp); } +/* + * Called for both BIO_FLUSH and BIO_SPEEDUP. Just pass the call down + */ static void -g_concat_flush(struct g_concat_softc *sc, struct bio *bp) +g_concat_passdown(struct g_concat_softc *sc, struct bio *bp) { struct bio_queue_head queue; struct g_consumer *cp; @@ -340,8 +343,9 @@ g_concat_start(struct bio *bp) case BIO_WRITE: case BIO_DELETE: break; + case BIO_SPEEDUP: case BIO_FLUSH: - g_concat_flush(sc, bp); + g_concat_passdown(sc, bp); return; case BIO_GETATTR: if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) { Modified: head/sys/geom/eli/g_eli.c == --- head/sys/geom/eli/g_eli.c Thu Jan 16 22:45:08 2020(r356817) +++ head/sys/geom/eli/g_eli.c Fri Jan 17 01:15:55 2020(r356818) @@ -429,6 +429,7 @@ g_eli_start(struct bio *bp) case BIO_GETATTR: case BIO_FLUSH: case BIO_ZONE: + case BIO_SPEEDUP: break; case BIO_DELETE: /* @@ -468,6 +469,7 @@ g_eli_start(struct bio *bp) case BIO_GETATTR: case BIO_FLUSH: case BIO_DELETE: + case BIO_SPEEDUP: case BIO_ZONE: if (bp->bio_cmd == BIO_GETATTR) cbp->bio_done = g_eli_getattr_done; Modified: head/sys/geom/gate/g_gate.c == --- head/sys/geom/gate/g_gate.c Thu Jan 16 22:45:08 2020(r356817) +++ head/sys/geom/gate/g_gate.c Fri Jan 17 01:15:55 2020(r356818) @@ -285,6 +285,7 @@ g_gate_start(struct bio *pbp) case BIO_DELETE: case BIO_WRITE: case BIO_FLUSH: + case BIO_SPEEDUP: /* XXX: Hack to allow read-only mounts. */ if ((sc->sc_flags & G_GATE_FLAG_READONLY) != 0) { g_io_deliver(pbp, EPERM); @@ -871,6 +872,7 @@ g_gate_ioctl(struct cdev *dev, u_long cmd, caddr_t add case BIO_READ: case BIO_DELETE: case BIO_FLUSH: + case BIO_SPEEDUP: break; case BIO_WRITE: error = copyout(bp->bio_data, ggio->gctl_data, @@ -935,6 +937,7 @@ start_end: case BIO_DELETE: case BIO_WRITE: case BIO_FLUSH: + case BIO_SPEEDUP: break; } } Modified: head/sys/geom/geom_disk.c == --- head/sys/geom/geom_disk.c Thu Jan 16 22:45:08 2020(r356817) +++ head/sys/geom/geom_disk.c Fri Jan 17 01:15:55 2020(r356818) @@ -560,6 +560,17 @@ g_disk_start(struct bio *bp) devstat_start_transaction_bio(dp->d_devstat, bp2); dp->d_strategy(bp2); break; + case BIO_SPEEDUP: + bp2 = g_clone_bio(bp); + if (bp2 == NULL) { + g_io_deli
svn commit: r356820 - head/sys/ufs/ffs
Author: imp Date: Fri Jan 17 01:16:23 2020 New Revision: 356820 URL: https://svnweb.freebsd.org/changeset/base/356820 Log: We only want to send the speedup to the lower layers when there's a shortage. Only send a speedup when there's a shortage. While this is a little racy, lost races aren't a big deal for this function. If there's a shorage just popping up after we check these values, then we'll catch it next time. If there's a shortage that's just clearing up, we may do some work at the lower layers a little sooner than we otherwise would have. Sicne shortages are relatively rare events, both races are acceptable. Reviewed by: chs Differential Revision: https://reviews.freebsd.org/D23182 Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c == --- head/sys/ufs/ffs/ffs_softdep.c Fri Jan 17 01:16:19 2020 (r356819) +++ head/sys/ufs/ffs/ffs_softdep.c Fri Jan 17 01:16:23 2020 (r356820) @@ -13771,23 +13771,28 @@ check_clear_deps(mp) struct mount *mp; { struct ufsmount *ump; + bool suj_susp; /* -* Tell the lower layers that any TRIM or WRITE transactions -* that have been delayed for performance reasons should -* proceed to help alleviate the shortage faster. +* Tell the lower layers that any TRIM or WRITE transactions that have +* been delayed for performance reasons should proceed to help alleviate +* the shortage faster. The race between checking req_* and the softdep +* mutex (lk) is fine since this is an advisory operation that at most +* causes deferred work to be done sooner. */ ump = VFSTOUFS(mp); - FREE_LOCK(ump); - softdep_send_speedup(ump, 0, BIO_SPEEDUP_TRIM | BIO_SPEEDUP_WRITE); - ACQUIRE_LOCK(ump); + suj_susp = MOUNTEDSUJ(mp) && ump->softdep_jblocks->jb_suspended; + if (req_clear_remove || req_clear_inodedeps || suj_susp) { + FREE_LOCK(ump); + softdep_send_speedup(ump, 0, BIO_SPEEDUP_TRIM | BIO_SPEEDUP_WRITE); + ACQUIRE_LOCK(ump); + } - /* * If we are suspended, it may be because of our using * too many inodedeps, so help clear them out. */ - if (MOUNTEDSUJ(mp) && VFSTOUFS(mp)->softdep_jblocks->jb_suspended) + if (suj_susp) clear_inodedeps(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-unsubscr...@freebsd.org"
svn commit: r356819 - in head/sys: geom ufs/ffs
Author: imp Date: Fri Jan 17 01:16:19 2020 New Revision: 356819 URL: https://svnweb.freebsd.org/changeset/base/356819 Log: Use buf to send speedup It turns out there's a problem with using g_io to send the speedup. It leads to a race when there's a resource shortage when a disk fails. Instead, send BIO_SPEEDUP via struct buf. This is pretty straight forward, except we need to transfer the bio_flags from b_ioflags for BIO_SPEEDUP commands in g_vfs_strategy. Reviewed by: kirk, chs Differential Revision: https://reviews.freebsd.org/D23117 Modified: head/sys/geom/geom_vfs.c head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/geom/geom_vfs.c == --- head/sys/geom/geom_vfs.cFri Jan 17 01:15:55 2020(r356818) +++ head/sys/geom/geom_vfs.cFri Jan 17 01:16:19 2020(r356819) @@ -191,6 +191,8 @@ g_vfs_strategy(struct bufobj *bo, struct buf *bp) bip->bio_flags |= BIO_ORDERED; bp->b_flags &= ~B_BARRIER; } + if (bp->b_iocmd == BIO_SPEEDUP) + bip->bio_flags |= bp->b_ioflags; bip->bio_done = g_vfs_done; bip->bio_caller2 = bp; #if defined(BUF_TRACKING) || defined(FULL_BUF_TRACKING) Modified: head/sys/ufs/ffs/ffs_softdep.c == --- head/sys/ufs/ffs/ffs_softdep.c Fri Jan 17 01:15:55 2020 (r356818) +++ head/sys/ufs/ffs/ffs_softdep.c Fri Jan 17 01:16:19 2020 (r356819) @@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include @@ -1452,6 +1453,20 @@ worklist_speedup(mp) wakeup(&ump->softdep_flushtd); } +static void +softdep_send_speedup(struct ufsmount *ump, size_t shortage, u_int flags) +{ + struct buf *bp; + + bp = malloc(sizeof(*bp), M_TRIM, M_WAITOK | M_ZERO); + bp->b_iocmd = BIO_SPEEDUP; + bp->b_ioflags = flags; + bp->b_bcount = shortage; + g_vfs_strategy(ump->um_bo, bp); + bufwait(bp); + free(bp, M_TRIM); +} + static int softdep_speedup(ump) struct ufsmount *ump; @@ -13364,7 +13379,6 @@ softdep_request_cleanup(fs, vp, cred, resource) struct ufsmount *ump; struct mount *mp; long starttime; - size_t resid; ufs2_daddr_t needed; int error, failed_vnode; @@ -13442,8 +13456,8 @@ softdep_request_cleanup(fs, vp, cred, resource) retry: if (resource == FLUSH_BLOCKS_WAIT && fs->fs_cstotal.cs_nbfree <= needed) - g_io_speedup(needed * fs->fs_bsize, BIO_SPEEDUP_TRIM, &resid, - ump->um_cp); + softdep_send_speedup(ump, needed * fs->fs_bsize, + BIO_SPEEDUP_TRIM); if ((resource == FLUSH_BLOCKS_WAIT && ump->softdep_on_worklist > 0 && fs->fs_cstotal.cs_nbfree <= needed) || (resource == FLUSH_INODES_WAIT && fs->fs_pendinginodes > 0 && @@ -13757,7 +13771,6 @@ check_clear_deps(mp) struct mount *mp; { struct ufsmount *ump; - size_t resid; /* * Tell the lower layers that any TRIM or WRITE transactions @@ -13766,7 +13779,7 @@ check_clear_deps(mp) */ ump = VFSTOUFS(mp); FREE_LOCK(ump); - g_io_speedup(0, BIO_SPEEDUP_TRIM | BIO_SPEEDUP_WRITE, &resid, ump->um_cp); + softdep_send_speedup(ump, 0, BIO_SPEEDUP_TRIM | BIO_SPEEDUP_WRITE); ACQUIRE_LOCK(ump); ___ 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: r356821 - in head/sbin: init shutdown
Author: imp Date: Fri Jan 17 01:20:48 2020 New Revision: 356821 URL: https://svnweb.freebsd.org/changeset/base/356821 Log: Small tweak to the default behavior of shutdown -c 'shutdown -c' is supposed to power cycle the system rather than doing a normal reboot. However, when that fails, it halts the system. This is not quite right since the intent isn't to halt the system but to restart. Make the default init behavior be to restart the system. The halt(8) interface can be used if you'd like to powercycle or halt. MFC After: 1 week Differential Revision: https://reviews.freebsd.org/D23129 Modified: head/sbin/init/init.c head/sbin/shutdown/shutdown.8 Modified: head/sbin/init/init.c == --- head/sbin/init/init.c Fri Jan 17 01:16:23 2020(r356820) +++ head/sbin/init/init.c Fri Jan 17 01:20:48 2020(r356821) @@ -1629,12 +1629,14 @@ transition_handler(int sig) current_state == clean_ttys || current_state == catatonia) requested_transition = clean_ttys; break; - case SIGWINCH: case SIGUSR2: - howto = sig == SIGUSR2 ? RB_POWEROFF : RB_POWERCYCLE; + howto = RB_POWEROFF; case SIGUSR1: howto |= RB_HALT; + case SIGWINCH: case SIGINT: + if (sig == SIGWINCH) + howto |= RB_POWERCYCLE; Reboot = TRUE; case SIGTERM: if (current_state == read_ttys || current_state == multi_user || Modified: head/sbin/shutdown/shutdown.8 == --- head/sbin/shutdown/shutdown.8 Fri Jan 17 01:16:23 2020 (r356820) +++ head/sbin/shutdown/shutdown.8 Fri Jan 17 01:20:48 2020 (r356821) @@ -28,7 +28,7 @@ .\" @(#)shutdown.8 8.2 (Berkeley) 4/27/95 .\" $FreeBSD$ .\" -.Dd January 1, 2018 +.Dd January 11, 2020 .Dt SHUTDOWN 8 .Os .Sh NAME @@ -63,7 +63,7 @@ The following options are available: The system is power cycled (power turned off and then back on) at the specified time. If the hardware doesn't support power cycle, the system will be -halted. +rebooted. At the present time, only systems with BMC supported by the .Xr ipmi 4 driver that implement this functionality support this flag. ___ 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: r356822 - head/sys/vm
Author: jeff Date: Fri Jan 17 03:44:04 2020 New Revision: 356822 URL: https://svnweb.freebsd.org/changeset/base/356822 Log: Fix a long standing bug that was made worse in r355765. When we are cowing a page that was previously mapped read-only it exists in pmap until pmap_enter() returns. However, we held no reference to the original page after the copy was complete. This allowed vm_object_scan_all_shadowed() to collapse an object that still had pages mapped. To resolve this, add another page pointer to the faultstate so we can keep the page xbusy until we're done with pmap_enter(). Handle busy pages in scan_all_shadowed. This is already done in vm_object_collapse_scan(). Reviewed by: kib, markj Differential Revision:https://reviews.freebsd.org/D23155 Modified: head/sys/vm/vm_fault.c head/sys/vm/vm_object.c Modified: head/sys/vm/vm_fault.c == --- head/sys/vm/vm_fault.c Fri Jan 17 01:20:48 2020(r356821) +++ head/sys/vm/vm_fault.c Fri Jan 17 03:44:04 2020(r356822) @@ -121,6 +121,7 @@ __FBSDID("$FreeBSD$"); struct faultstate { vm_page_t m; + vm_page_t m_cow; vm_object_t object; vm_pindex_t pindex; vm_page_t first_m; @@ -208,6 +209,7 @@ static void fault_deallocate(struct faultstate *fs) { + fault_page_release(&fs->m_cow); fault_page_release(&fs->m); vm_object_pip_wakeup(fs->object); if (fs->object != fs->first_object) { @@ -818,7 +820,7 @@ RetryFault_oom: fs.lookup_still_valid = true; - fs.m = fs.first_m = NULL; + fs.m_cow = fs.m = fs.first_m = NULL; /* * Search for the page at object/offset. @@ -1254,9 +1256,11 @@ readrest: vm_page_unwire(fs.m, PQ_INACTIVE); } /* -* We no longer need the old page or object. +* Save the cow page to be released after +* pmap_enter is complete. */ - fault_page_release(&fs.m); + fs.m_cow = fs.m; + fs.m = NULL; } /* * fs.object != fs.first_object due to above Modified: head/sys/vm/vm_object.c == --- head/sys/vm/vm_object.c Fri Jan 17 01:20:48 2020(r356821) +++ head/sys/vm/vm_object.c Fri Jan 17 03:44:04 2020(r356822) @@ -1605,6 +1605,14 @@ vm_object_scan_all_shadowed(vm_object_t object) break; /* +* If the backing object page is busy a grandparent or older +* page may still be undergoing CoW. It is not safe to +* collapse the backing object until it is quiesced. +*/ + if (p != NULL && vm_page_busied(p)) + return (false); + + /* * See if the parent has the page or if the parent's object * pager has the page. If the parent has the page but the page * is not valid, the parent's object pager must have the page. @@ -1907,8 +1915,7 @@ vm_object_collapse(vm_object_t object) * If we do not entirely shadow the backing object, * there is nothing we can do so we give up. */ - if (object->resident_page_count != object->size && - !vm_object_scan_all_shadowed(object)) { + if (!vm_object_scan_all_shadowed(object)) { VM_OBJECT_WUNLOCK(backing_object); break; } ___ 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: r356758 - in head/usr.sbin/bsdinstall: . scripts
17.01.2020 7:03, Slawa Olhovchenkov write: There are multiple scenarios there ZFS may be sub-optimal at least: small i386 virtual guests or 32-bit only hardware like AMD Geode, or big amd64 SSD-only systems with bhyve and multiple guests that need lots of memory and should not fight with ZFS for RAM etc. >>> >>> That may well be the case, but our defaults should represent the >>> configuration that's desirable to the largest set of users, and IMO >>> that's ZFS in most cases today. >>> >>> It might be that we should default to UFS on i386 and ZFS on amd64? >> >> UFS may be better for any virtual guest having RAM less or equal to 4GB. > > Why? Considering /usr/ports, /usr/src and /usr/obj and amount of RAM needed to keep metadata in ZFS ARC plus standard daily periodic scripts traveling filesystems, low-RAM virtual machine utilizing its RAM to full amount can work reliably with UFS and hang at nights due to extra ZFS overhead in default install (not tuned). Been there, seen that. ___ 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: r356826 - in head/sys: kern net sys
Author: glebius Date: Fri Jan 17 06:10:24 2020 New Revision: 356826 URL: https://svnweb.freebsd.org/changeset/base/356826 Log: Change argument order of epoch_call() to more natural, first function, then its argument. Reviewed by: imp, cem, jhb Modified: head/sys/kern/subr_epoch.c head/sys/net/pfil.c head/sys/sys/epoch.h Modified: head/sys/kern/subr_epoch.c == --- head/sys/kern/subr_epoch.c Fri Jan 17 04:13:16 2020(r356825) +++ head/sys/kern/subr_epoch.c Fri Jan 17 06:10:24 2020(r356826) @@ -664,7 +664,7 @@ epoch_wait(epoch_t epoch) } void -epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)) +epoch_call(epoch_t epoch, epoch_callback_t callback, epoch_context_t ctx) { epoch_record_t er; ck_epoch_entry_t *cb; @@ -819,7 +819,7 @@ epoch_drain_callbacks(epoch_t epoch) CPU_FOREACH(cpu) { er = zpcpu_get_cpu(epoch->e_pcpu_record, cpu); sched_bind(td, cpu); - epoch_call(epoch, &er->er_drain_ctx, &epoch_drain_cb); + epoch_call(epoch, &epoch_drain_cb, &er->er_drain_ctx); } /* restore CPU binding, if any */ Modified: head/sys/net/pfil.c == --- head/sys/net/pfil.c Fri Jan 17 04:13:16 2020(r356825) +++ head/sys/net/pfil.c Fri Jan 17 06:10:24 2020(r356826) @@ -313,9 +313,9 @@ pfil_unlink(struct pfil_link_args *pa, pfil_head_t hea PFIL_UNLOCK(); if (in != NULL) - epoch_call(PFIL_EPOCH, &in->link_epoch_ctx, pfil_link_free); + epoch_call(PFIL_EPOCH, pfil_link_free, &in->link_epoch_ctx); if (out != NULL) - epoch_call(PFIL_EPOCH, &out->link_epoch_ctx, pfil_link_free); + epoch_call(PFIL_EPOCH, pfil_link_free, &out->link_epoch_ctx); if (in == NULL && out == NULL) return (ENOENT); @@ -443,15 +443,15 @@ retry: if (in != NULL) { head->head_nhooksin--; hook->hook_links--; - epoch_call(PFIL_EPOCH, &in->link_epoch_ctx, - pfil_link_free); + epoch_call(PFIL_EPOCH, pfil_link_free, + &in->link_epoch_ctx); } out = pfil_link_remove(&head->head_out, hook); if (out != NULL) { head->head_nhooksout--; hook->hook_links--; - epoch_call(PFIL_EPOCH, &out->link_epoch_ctx, - pfil_link_free); + epoch_call(PFIL_EPOCH, pfil_link_free, + &out->link_epoch_ctx); } if (in != NULL || out != NULL) /* What if some stupid admin put same filter twice? */ Modified: head/sys/sys/epoch.h == --- head/sys/sys/epoch.hFri Jan 17 04:13:16 2020(r356825) +++ head/sys/sys/epoch.hFri Jan 17 06:10:24 2020(r356826) @@ -35,6 +35,7 @@ struct epoch_context { } __aligned(sizeof(void *)); typedef struct epoch_context *epoch_context_t; +typedefvoid epoch_callback_t(epoch_context_t); #ifdef _KERNEL #include @@ -68,7 +69,7 @@ void epoch_free(epoch_t epoch); void epoch_wait(epoch_t epoch); void epoch_wait_preempt(epoch_t epoch); void epoch_drain_callbacks(epoch_t epoch); -void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)); +void epoch_call(epoch_t epoch, epoch_callback_t cb, epoch_context_t ctx); intin_epoch(epoch_t epoch); int in_epoch_verbose(epoch_t epoch, int dump_onfail); DPCPU_DECLARE(int, epoch_cb_count); @@ -101,7 +102,7 @@ extern epoch_t net_epoch_preempt; #defineNET_EPOCH_ENTER(et) epoch_enter_preempt(net_epoch_preempt, &(et)) #defineNET_EPOCH_EXIT(et) epoch_exit_preempt(net_epoch_preempt, &(et)) #defineNET_EPOCH_WAIT()epoch_wait_preempt(net_epoch_preempt) -#defineNET_EPOCH_CALL(f, c)epoch_call(net_epoch_preempt, (c), (f)) +#defineNET_EPOCH_CALL(f, c)epoch_call(net_epoch_preempt, (f), (c)) #defineNET_EPOCH_ASSERT() MPASS(in_epoch(net_epoch_preempt)) #endif /* _KERNEL */ ___ 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: r356797 - head/share/mk
On Thu, Jan 16, 2020 at 02:18:14PM -0500, Ed Maste wrote: > On Thu, 16 Jan 2020 at 12:34, John Baldwin wrote: > > > > I would support having MK_PROFILE default to off for 13. > > I agree. I'd suggest we got further and turn them off in 13 and announce that we will remove support after the branch. -- Brooks signature.asc Description: PGP signature