Re: svn commit: r339516 - head/sys/cddl/dev/dtrace/powerpc
On Wed, Nov 21, 2018 at 10:02:15PM -0600, Kyle Evans wrote: > On Wed, Nov 21, 2018 at 9:42 PM Kyle Evans wrote: > > > > On Sat, Oct 20, 2018 at 9:09 PM Justin Hibbits wrote: > > > > > > Author: jhibbits > > > Date: Sun Oct 21 02:08:57 2018 > > > New Revision: 339516 > > > URL: https://svnweb.freebsd.org/changeset/base/339516 > > > > > > Log: > > > powerpc/dtrace: Use explicit bit numbers to mask out PSL_EE > > > > > > There seems to be a race in CI, such that dtrace_asm.S might be > > > assembled > > > before the genassym is completed. This causes a build failure when > > > PSL_EE > > > doesn't exist, and is read as 0. Get around this by explicitly > > > specifying > > > the bits in the mask instead. > > > > > > > Hi, > > > > CI on the stable/12 branch still hits this, so I'm tempted to MFC this > > if you don't object. OTOH, the correct solution should be a > > `dependency "genassym.o"` in ^/sys/conf/files.powerpc for > > dtrace_asm.S, no? I believe that dtrace_asm.S will be built as part of dtrace.ko, not the kernel. dtrace/Makefile already specifies a dependency on assym.inc. Maybe this is the same issue as PR 29? > Sorry, that should have read "genassym.inc" -- my naive understanding > of 'dependency' is that config(8) will turn it directly into a > makefile dependency that will alleviate this. > ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r339516 - head/sys/cddl/dev/dtrace/powerpc
On Wed, Nov 21, 2018 at 9:42 PM Kyle Evans wrote: > > On Sat, Oct 20, 2018 at 9:09 PM Justin Hibbits wrote: > > > > Author: jhibbits > > Date: Sun Oct 21 02:08:57 2018 > > New Revision: 339516 > > URL: https://svnweb.freebsd.org/changeset/base/339516 > > > > Log: > > powerpc/dtrace: Use explicit bit numbers to mask out PSL_EE > > > > There seems to be a race in CI, such that dtrace_asm.S might be assembled > > before the genassym is completed. This causes a build failure when PSL_EE > > doesn't exist, and is read as 0. Get around this by explicitly specifying > > the bits in the mask instead. > > > > Hi, > > CI on the stable/12 branch still hits this, so I'm tempted to MFC this > if you don't object. OTOH, the correct solution should be a > `dependency "genassym.o"` in ^/sys/conf/files.powerpc for > dtrace_asm.S, no? > Sorry, that should have read "genassym.inc" -- my naive understanding of 'dependency' is that config(8) will turn it directly into a makefile dependency that will alleviate this. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r339516 - head/sys/cddl/dev/dtrace/powerpc
On Wed, Nov 21, 2018 at 10:02 PM Kyle Evans wrote: > > On Wed, Nov 21, 2018 at 9:42 PM Kyle Evans wrote: > > > > On Sat, Oct 20, 2018 at 9:09 PM Justin Hibbits wrote: > > > > > > Author: jhibbits > > > Date: Sun Oct 21 02:08:57 2018 > > > New Revision: 339516 > > > URL: https://svnweb.freebsd.org/changeset/base/339516 > > > > > > Log: > > > powerpc/dtrace: Use explicit bit numbers to mask out PSL_EE > > > > > > There seems to be a race in CI, such that dtrace_asm.S might be > > > assembled > > > before the genassym is completed. This causes a build failure when > > > PSL_EE > > > doesn't exist, and is read as 0. Get around this by explicitly > > > specifying > > > the bits in the mask instead. > > > > > > > Hi, > > > > CI on the stable/12 branch still hits this, so I'm tempted to MFC this > > if you don't object. OTOH, the correct solution should be a > > `dependency "genassym.o"` in ^/sys/conf/files.powerpc for > > dtrace_asm.S, no? > > > > Sorry, that should have read "genassym.inc" -- my naive understanding > of 'dependency' is that config(8) will turn it directly into a > makefile dependency that will alleviate this. Hm, I'm surprised we don't have a rule for all kernel .S files, even modules, being dependent on that. Should we add one? - Justin ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340754 - head/libexec/rc/rc.d
Author: cy Date: Thu Nov 22 04:48:27 2018 New Revision: 340754 URL: https://svnweb.freebsd.org/changeset/base/340754 Log: Allow forced start of ipmon in special cases where testing is desired (or other special cases) and when ipfilter is disabled in rc.conf but started by other means. MFC after:1 week Modified: head/libexec/rc/rc.d/ipmon Modified: head/libexec/rc/rc.d/ipmon == --- head/libexec/rc/rc.d/ipmon Thu Nov 22 04:39:06 2018(r340753) +++ head/libexec/rc/rc.d/ipmon Thu Nov 22 04:48:27 2018(r340754) @@ -21,7 +21,7 @@ ipmon_precmd() # Continue only if ipfilter or ipnat is enabled and the # ipfilter module is loaded. # - if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable ; then + if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable && ! checkyesno rc_force ; then err 1 "${name} requires either ipfilter or ipnat enabled" fi if ! ${ipfilter_program:-/sbin/ipf} -V | grep -q 'Running: yes' >/dev/null 2>&1; then ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340753 - in releng/12.0: etc/mtree lib/libbe sbin/bectl sbin/bectl/tests
Author: kevans Date: Thu Nov 22 04:39:06 2018 New Revision: 340753 URL: https://svnweb.freebsd.org/changeset/base/340753 Log: MFC r340507-r340508, r340592-r340594, r340635-r340636: bectl(8) fixes r340507: libbe(3): rewrite init to support chroot usage libbe(3) currently uses zfs_be_root and locates which of its children is currently mounted at "/". This is reasonable, but not correct in the case of a chroot, for two reasons: - chroot root may be of a different zpool than zfs_be_root - chroot root will not show up as mounted at "/" Fix both of these by rewriting libbe_init to work from the rootfs down. zfs_path_to_zhandle on / will resolve to the dataset mounted at the new root, rather than the real root. From there, we can derive the BE root/pool and grab the bootfs off of the new pool. This does no harm in the average case, and opens up bectl to operating on different pools for scenarios where one may be, for instance, updating a pool that generally gets re-rooted into from a separate UFS root or zfs bootpool. While here, I've also: - Eliminated the check for /boot and / to be on the same partition. This leaves one open to a setup where /boot (and consequently, kernel/modules) are not included in the boot environment. This may very well be an intentional setup done by someone that knows what they're doing, we should not kill BE usage because of it. - Eliminated the validation bits of BEs and snapshots that enforced 'mountpoint' to be "/" -- this broke when trying to operate on an imported pool with an altroot, but we need not be this picky. Reported by: philip Reviewed by: philip, allanjude (previous version) Tested by:philip Differential Revision:https://reviews.freebsd.org/D18012 r340508: libbe(3): Rewrite be_unmount to stop mucking with getmntinfo(2) Go through the ZFS layer instead; given a BE, we can derive the dataset, zfs_open it, then zfs_unmount. ZFS takes care of the dirty details and likely gets it more correct than we did for more interesting setups. r340592: bectl(3)/libbe(3): Allow BE root to be specified Add an undocumented -r option preceding the bectl subcommand to specify a BE root to operate out of. This will remain undocumented for now, as some caveats apply: - BEs cannot be activated in the pool that doesn't contain the rootfs - bectl create cannot work out of the box without the -e option right now, since it defaults to the rootfs and cross-pool cloning doesn't work like that (IIRC) Plumb the BE root through to libbe(3) so that some things -can- be done to it, e.g. bectl -r tank/ROOT create -e default upgrade bectl -r tank/ROOT mount upgrade /mnt this aides in some upgrade setups where rootfs is not necessarily ZFS, and also makes it easier/possible to regression-test bectl when combined with a file-backed zpool. Differential Revision:https://reviews.freebsd.org/D18029 r340593: libbe(3): Properly account for altroot when creating new BEs Previously we would blindly copy the 'mountpoint' property, which includes the altroot. The altroot needs to be snipped off prior to setting it on the new BE, though, or you'll end up with a new BE and a mountpoint of /mnt with altroot=/mnt r340594: bectl(8): Add some regression tests These tests operate on a file-backed zpool that gets created in the kyua temp dir. root and ZFS support are both required for these tests. Current tests cover create, destroy, export/import, jail, list (kind of), mount, rename, and jail. List tests should later be extended to cover formatting and the different list flags, but for now only covers basic "are create/destroy actually reflected properly" r340635: libbe(3): Handle non-ZFS rootfs better If rootfs isn't ZFS, current version will emit an error claiming so and fail to initialize libbe. As a consumer, bectl -r (undocumented) can be specified to operate on a BE independently of whether on a UFS or ZFS root. Unbreak this for the UFS case by only erroring out the init if we can't determine a ZFS dataset for rootfs and no BE root was specified. Consumers of libbe should take care to ensure that rootfs is non-empty if they're trying to use it, because this could certainly be the case. Some check is needed before zfs_path_to_zhandle because it will unconditionally emit to stderr if the path isn't a ZFS filesystem, which is unhelpful for our purposes. This should also unbreak the bectl(8) tests on a UFS root, as is the case in Jenkins' -test runs. r340636: bectl(8) tests: attempt to load the ZFS module Observed in a CI test image, bectl_create test will run and be marked as skipped because the module is not loaded. The first zpool invocation will automagically load the module, but bectl_create is still skipped. Subsequent tests all
svn commit: r340752 - stable/12/tools/boot
Author: kevans Date: Thu Nov 22 03:04:13 2018 New Revision: 340752 URL: https://svnweb.freebsd.org/changeset/base/340752 Log: MFC r339701: Update lualoader test script a little bit Use userboot.so from the test directory if possible, fall back to .OBJDIR. This avoids a problem that we've had since userboot coexistence was added, where userboot.so alone no longer exists in the .OBJDIR but is instead just a link installed later. Update lualo Modified: stable/12/tools/boot/lua-test.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/boot/lua-test.sh == --- stable/12/tools/boot/lua-test.shThu Nov 22 01:25:44 2018 (r340751) +++ stable/12/tools/boot/lua-test.shThu Nov 22 03:04:13 2018 (r340752) @@ -13,13 +13,16 @@ scriptdir=$(dirname $(realpath $0)) cd $(make -V SRCTOP)/stand obj=$(make -V .OBJDIR) t=$obj/userboot/test/test -u=$obj/userboot/userboot/userboot.so [ -n "$dir" ] || dir=/tmp/loadertest [ -d "$dir" ] || ${scriptdir}/lua-img.sh ${dir} +# We'll try userboot.so from the test directory before plucking it straight out +# of .OBJDIR. +u=$dir/boot/userboot.so +[ -f "$u" ] || u=$obj/userboot/userboot_lua/userboot_lua.so [ -f "$dir/boot/lua/loader.lua" ] || die "No boot/lua/loader.lua found" [ -f "$dir/boot/kernel/kernel" ] || die "No kernel to load" [ -x "$t" ] || die "no userboot test jig found ($t)" -[ -x "$u" ] || die "no userboot.so ($u) found" +[ -f "$u" ] || die "no userboot.so ($u) found" $t -h $dir -b $u ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r339516 - head/sys/cddl/dev/dtrace/powerpc
On Sat, Oct 20, 2018 at 9:09 PM Justin Hibbits wrote: > > Author: jhibbits > Date: Sun Oct 21 02:08:57 2018 > New Revision: 339516 > URL: https://svnweb.freebsd.org/changeset/base/339516 > > Log: > powerpc/dtrace: Use explicit bit numbers to mask out PSL_EE > > There seems to be a race in CI, such that dtrace_asm.S might be assembled > before the genassym is completed. This causes a build failure when PSL_EE > doesn't exist, and is read as 0. Get around this by explicitly specifying > the bits in the mask instead. > Hi, CI on the stable/12 branch still hits this, so I'm tempted to MFC this if you don't object. OTOH, the correct solution should be a `dependency "genassym.o"` in ^/sys/conf/files.powerpc for dtrace_asm.S, no? Thanks, Kyle Evans ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340751 - in stable/12: etc/mtree lib/libbe sbin/bectl sbin/bectl/tests
Author: kevans Date: Thu Nov 22 01:25:44 2018 New Revision: 340751 URL: https://svnweb.freebsd.org/changeset/base/340751 Log: MFC r340507-r340508, r340592-r340594, r340635-r340636: bectl(8) fixes r340507: libbe(3): rewrite init to support chroot usage libbe(3) currently uses zfs_be_root and locates which of its children is currently mounted at "/". This is reasonable, but not correct in the case of a chroot, for two reasons: - chroot root may be of a different zpool than zfs_be_root - chroot root will not show up as mounted at "/" Fix both of these by rewriting libbe_init to work from the rootfs down. zfs_path_to_zhandle on / will resolve to the dataset mounted at the new root, rather than the real root. From there, we can derive the BE root/pool and grab the bootfs off of the new pool. This does no harm in the average case, and opens up bectl to operating on different pools for scenarios where one may be, for instance, updating a pool that generally gets re-rooted into from a separate UFS root or zfs bootpool. While here, I've also: - Eliminated the check for /boot and / to be on the same partition. This leaves one open to a setup where /boot (and consequently, kernel/modules) are not included in the boot environment. This may very well be an intentional setup done by someone that knows what they're doing, we should not kill BE usage because of it. - Eliminated the validation bits of BEs and snapshots that enforced 'mountpoint' to be "/" -- this broke when trying to operate on an imported pool with an altroot, but we need not be this picky. Reported by: philip Reviewed by: philip, allanjude (previous version) Tested by:philip Differential Revision:https://reviews.freebsd.org/D18012 r340508: libbe(3): Rewrite be_unmount to stop mucking with getmntinfo(2) Go through the ZFS layer instead; given a BE, we can derive the dataset, zfs_open it, then zfs_unmount. ZFS takes care of the dirty details and likely gets it more correct than we did for more interesting setups. r340592: bectl(3)/libbe(3): Allow BE root to be specified Add an undocumented -r option preceding the bectl subcommand to specify a BE root to operate out of. This will remain undocumented for now, as some caveats apply: - BEs cannot be activated in the pool that doesn't contain the rootfs - bectl create cannot work out of the box without the -e option right now, since it defaults to the rootfs and cross-pool cloning doesn't work like that (IIRC) Plumb the BE root through to libbe(3) so that some things -can- be done to it, e.g. bectl -r tank/ROOT create -e default upgrade bectl -r tank/ROOT mount upgrade /mnt this aides in some upgrade setups where rootfs is not necessarily ZFS, and also makes it easier/possible to regression-test bectl when combined with a file-backed zpool. Differential Revision:https://reviews.freebsd.org/D18029 r340593: libbe(3): Properly account for altroot when creating new BEs Previously we would blindly copy the 'mountpoint' property, which includes the altroot. The altroot needs to be snipped off prior to setting it on the new BE, though, or you'll end up with a new BE and a mountpoint of /mnt with altroot=/mnt r340594: bectl(8): Add some regression tests These tests operate on a file-backed zpool that gets created in the kyua temp dir. root and ZFS support are both required for these tests. Current tests cover create, destroy, export/import, jail, list (kind of), mount, rename, and jail. List tests should later be extended to cover formatting and the different list flags, but for now only covers basic "are create/destroy actually reflected properly" r340635: libbe(3): Handle non-ZFS rootfs better If rootfs isn't ZFS, current version will emit an error claiming so and fail to initialize libbe. As a consumer, bectl -r (undocumented) can be specified to operate on a BE independently of whether on a UFS or ZFS root. Unbreak this for the UFS case by only erroring out the init if we can't determine a ZFS dataset for rootfs and no BE root was specified. Consumers of libbe should take care to ensure that rootfs is non-empty if they're trying to use it, because this could certainly be the case. Some check is needed before zfs_path_to_zhandle because it will unconditionally emit to stderr if the path isn't a ZFS filesystem, which is unhelpful for our purposes. This should also unbreak the bectl(8) tests on a UFS root, as is the case in Jenkins' -test runs. r340636: bectl(8) tests: attempt to load the ZFS module Observed in a CI test image, bectl_create test will run and be marked as skipped because the module is not loaded. The first zpool invocation will automagically load the module, but bectl_create is still skipped. Subsequent tests all
svn commit: r340750 - head/contrib/elftoolchain/strings
Author: mjg Date: Wed Nov 21 22:37:49 2018 New Revision: 340750 URL: https://svnweb.freebsd.org/changeset/base/340750 Log: strings: unbreak the build after r340746 Discussed with: oshogbo Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/strings/strings.c Modified: head/contrib/elftoolchain/strings/strings.c == --- head/contrib/elftoolchain/strings/strings.c Wed Nov 21 22:25:05 2018 (r340749) +++ head/contrib/elftoolchain/strings/strings.c Wed Nov 21 22:37:49 2018 (r340750) @@ -350,7 +350,7 @@ find_strings(const char *name, off_t offset, off_t siz (void)fseeko(stdin, offset, SEEK_SET); cur_off = offset; start_off = 0; - while (true) { + for (;;) { if ((offset + size) && (cur_off >= offset + size)) break; start_off = cur_off; @@ -395,7 +395,7 @@ find_strings(const char *name, off_t offset, off_t siz } printf("%s", obuf); - while (true) { + for (;;) { if ((offset + size) && (cur_off >= offset + size)) break; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r340722 - head/lib/libbe
Hello, On Wed, 21 Nov 2018 at 17:54, Rodney W. Grimes < free...@pdx.rh.cn85.dnsmgr.net> wrote: > > On Wed, Nov 21, 2018 at 10:19 AM Rodney W. Grimes > > wrote: > > > > > > > Author: 0mp (ports committer) > > > > Date: Wed Nov 21 11:22:44 2018 > > > > New Revision: 340722 > > > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > > > > > Log: > > > > libbe(3): Put each error value in separate line. > > > > > > > > As requested by a TODO in the source code. > > > > > > > > Reviewed by:bcr > > > > Approved by:krion (mentor, implicit), mat (mentor, > implicit) > > > > Differential Revision: https://reviews.freebsd.org/D18063 > > > > > > Who with a src bit approved the commit to src? > > > > > > > I do want to clarify- bcr approved it in the review (explicitly with > > "... hereby approved!") -- are you mainly pointing out that he failed > > to annotate this properly in the commit, or is doc bit approval for a > > commit to a manpage in src insufficient? > > That is defanitly a bit of a grey area, from reading and re-reading > the commit bit page it is clear that a doc committer can commit > to src documentation, it is not clear if they can approve a commit > by someone else to the src tree, it does say > ""Approved by" from a non-mentored committer > with the appropriate bit" > > It probably would be fine to have said Approved by: bcr. > True. Perhaps as a ports committer I should even write "Approved by: bcr (doc)" to make it clear that I collected appropriate approvals before committing. I've been committing small patches to the src tree for a couple of months now and I've heard that "Reviewed by: bcr" is sufficient. I guess that now I understand that "Reviewed by" is for listing people and teams who reviewed the code and "Approved by" is for listing all the necessary approvals one has to collect in order to commit. I still question what a out of scope commit that is > approved by: (mentor, implicit). I am not even sure > what that means in this context. Have his mentors > said he can commit anything anyplace without them > seeing it? If so then release the mentor/mentee bit > would be more appropriate? > mat@ and krion@ told me that I don't have to ask them about explicit approval before committing to doc or src. If I gather all the necessary approvals from doc and src committers then I am able to commit with an implicit approval from my mentors. > > As an aside, happy to approve any changes to these manpages as the > > current bectl/libbe maintainer for anyone that wants to improve them. > > =) > I'm really sorry, this is my fault. Usually, I request people, who recently contributed to a certain part of a tree or who are listed in the MAINTAINERS file, to review my changes. This time it was only meant to be a small improvement to our documentation without any actual content changes to the manual page itself so I only notified bcr. Regards, Mateusz ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340749 - head/sys/kern
Author: mjg Date: Wed Nov 21 22:25:05 2018 New Revision: 340749 URL: https://svnweb.freebsd.org/changeset/base/340749 Log: uipc_usrreq: fix inode number assignment The code was incrementing a global variable in an unsafe manner. Two different threads stating two different sockets could have resulted in the same inode numbers assigned to both. Creation is protected with a global lock, move the assigment there. Since inode numbers are 64-bit now drop the check for overflows. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c == --- head/sys/kern/uipc_usrreq.c Wed Nov 21 22:16:10 2018(r340748) +++ head/sys/kern/uipc_usrreq.c Wed Nov 21 22:25:05 2018(r340749) @@ -530,6 +530,7 @@ uipc_attach(struct socket *so, int proto, struct threa UNP_LINK_WLOCK(); unp->unp_gencnt = ++unp_gencnt; + unp->unp_ino = ++unp_ino; unp_count++; switch (so->so_type) { case SOCK_STREAM: @@ -1302,12 +1303,8 @@ uipc_sense(struct socket *so, struct stat *sb) KASSERT(unp != NULL, ("uipc_sense: unp == NULL")); sb->st_blksize = so->so_snd.sb_hiwat; - UNP_PCB_LOCK(unp); sb->st_dev = NODEV; - if (unp->unp_ino == 0) - unp->unp_ino = (++unp_ino == 0) ? ++unp_ino : unp_ino; sb->st_ino = unp->unp_ino; - UNP_PCB_UNLOCK(unp); return (0); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340748 - head/sys/kern
Author: mjg Date: Wed Nov 21 22:16:10 2018 New Revision: 340748 URL: https://svnweb.freebsd.org/changeset/base/340748 Log: proc: update list manipulation comment on process exit Processes stay in the hash until they get reaped. This code does not unlink the child from the parent, so remove the claim that it does. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c == --- head/sys/kern/kern_exit.c Wed Nov 21 22:01:06 2018(r340747) +++ head/sys/kern/kern_exit.c Wed Nov 21 22:16:10 2018(r340748) @@ -429,8 +429,7 @@ exit1(struct thread *td, int rval, int signo) sx_xlock(_lock); /* -* Remove proc from allproc queue and pidhash chain. -* Place onto zombproc. Unlink from parent's child list. +* Move proc from allproc queue to zombproc. */ sx_xlock(_lock); LIST_REMOVE(p, p_list); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340747 - head/sys/kern
Author: mjg Date: Wed Nov 21 22:01:06 2018 New Revision: 340747 URL: https://svnweb.freebsd.org/changeset/base/340747 Log: uipc_shm: use unr64 for inode numbers Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/uipc_shm.c Modified: head/sys/kern/uipc_shm.c == --- head/sys/kern/uipc_shm.cWed Nov 21 21:48:02 2018(r340746) +++ head/sys/kern/uipc_shm.cWed Nov 21 22:01:06 2018(r340747) @@ -113,7 +113,7 @@ static LIST_HEAD(, shm_mapping) *shm_dictionary; static struct sx shm_dict_lock; static struct mtx shm_timestamp_lock; static u_long shm_hash; -static struct unrhdr *shm_ino_unr; +static struct unrhdr64 shm_ino_unr; static dev_t shm_dev_ino; #defineSHM_HASH(fnv) (_dictionary[(fnv) & shm_hash]) @@ -531,7 +531,6 @@ struct shmfd * shm_alloc(struct ucred *ucred, mode_t mode) { struct shmfd *shmfd; - int ino; shmfd = malloc(sizeof(*shmfd), M_SHMFD, M_WAITOK | M_ZERO); shmfd->shm_size = 0; @@ -549,11 +548,7 @@ shm_alloc(struct ucred *ucred, mode_t mode) vfs_timestamp(>shm_birthtime); shmfd->shm_atime = shmfd->shm_mtime = shmfd->shm_ctime = shmfd->shm_birthtime; - ino = alloc_unr(shm_ino_unr); - if (ino == -1) - shmfd->shm_ino = 0; - else - shmfd->shm_ino = ino; + shmfd->shm_ino = alloc_unr64(_ino_unr); refcount_init(>shm_refs, 1); mtx_init(>shm_mtx, "shmrl", NULL, MTX_DEF); rangelock_init(>shm_rl); @@ -584,8 +579,6 @@ shm_drop(struct shmfd *shmfd) rangelock_destroy(>shm_rl); mtx_destroy(>shm_mtx); vm_object_deallocate(shmfd->shm_object); - if (shmfd->shm_ino != 0) - free_unr(shm_ino_unr, shmfd->shm_ino); free(shmfd, M_SHMFD); } } @@ -624,8 +617,7 @@ shm_init(void *arg) mtx_init(_timestamp_lock, "shm timestamps", NULL, MTX_DEF); sx_init(_dict_lock, "shm dictionary"); shm_dictionary = hashinit(1024, M_SHMFD, _hash); - shm_ino_unr = new_unrhdr(1, INT32_MAX, NULL); - KASSERT(shm_ino_unr != NULL, ("shm fake inodes not initialized")); + new_unrhdr64(_ino_unr, 1); shm_dev_ino = devfs_alloc_cdp_inode(); KASSERT(shm_dev_ino > 0, ("shm dev inode not initialized")); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340745 - head/contrib/elftoolchain/readelf
Author: sobomax Date: Wed Nov 21 21:46:06 2018 New Revision: 340745 URL: https://svnweb.freebsd.org/changeset/base/340745 Log: Fix CU: output of the --debug-dump=decodedline, the problem there is that both file name and current directory is recorded, however file name sometimes already contains absolute path. In which case prefixing it with directory name results in an invalid pathname. Only append directory name if the file name does not start with '/'. This seems to DTRT. Approved by: emaste MFC after:2 weeks Differential Revision:https://reviews.freebsd.org/D18290 Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c == --- head/contrib/elftoolchain/readelf/readelf.c Wed Nov 21 20:15:56 2018 (r340744) +++ head/contrib/elftoolchain/readelf/readelf.c Wed Nov 21 21:46:06 2018 (r340745) @@ -4720,7 +4720,7 @@ dump_dwarf_line_decoded(struct readelf *re) DW_DLV_OK) dir = NULL; printf("CU: "); - if (dir && file) + if (dir && file && file[0] != '/') printf("%s/", dir); if (file) printf("%s", file); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340746 - head/contrib/elftoolchain/strings
Author: oshogbo Date: Wed Nov 21 21:48:02 2018 New Revision: 340746 URL: https://svnweb.freebsd.org/changeset/base/340746 Log: strings: fix style nits Reviewed by: cem, emaste, Joseph Koshy Differential Revision:https://reviews.freebsd.org/D18036 Modified: head/contrib/elftoolchain/strings/strings.c Modified: head/contrib/elftoolchain/strings/strings.c == --- head/contrib/elftoolchain/strings/strings.c Wed Nov 21 21:46:06 2018 (r340745) +++ head/contrib/elftoolchain/strings/strings.c Wed Nov 21 21:48:02 2018 (r340746) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#include #include +#include #include #include @@ -64,7 +64,7 @@ enum encoding_style { }; #define PRINTABLE(c) \ - ((c) >= 0 && (c) <= 255 && \ + ((c) >= 0 && (c) <= 255 && \ ((c) == '\t' || isprint((c)) || \ (encoding == ENCODING_8BIT && (c) > 127))) @@ -109,8 +109,8 @@ main(int argc, char **argv) elf_errmsg(-1)); while ((ch = getopt_long(argc, argv, "1234567890ae:fhn:ot:Vv", - strings_longopts, NULL)) != -1) - switch((char)ch) { + strings_longopts, NULL)) != -1) { + switch ((char)ch) { case 'a': entire_file = 1; break; @@ -183,14 +183,15 @@ main(int argc, char **argv) usage(); /* NOTREACHED */ } + } argc -= optind; argv += optind; - if (!min_len) + if (min_len == 0) min_len = 4; - if (!*argv) + if (*argv == NULL) rc = find_strings("{standard input}", 0, 0); - else while (*argv) { + else while (*argv != NULL) { if (handle_file(*argv) != 0) rc = 1; argv++; @@ -226,10 +227,10 @@ handle_binary(const char *name, int fd) { struct stat buf; - memset(, 0, sizeof(struct stat)); - (void) lseek(fd, (off_t)0, SEEK_SET); + memset(, 0, sizeof(buf)); + (void)lseek(fd, 0, SEEK_SET); if (!fstat(fd, )) - return (find_strings(name, (off_t)0, buf.st_size)); + return (find_strings(name, 0, buf.st_size)); return (1); } @@ -253,21 +254,21 @@ handle_elf(const char *name, int fd) if (entire_file) return (handle_binary(name, fd)); - (void) lseek(fd, (off_t)0, SEEK_SET); + (void)lseek(fd, 0, SEEK_SET); elf = elf_begin(fd, ELF_C_READ, NULL); if (elf_kind(elf) != ELF_K_ELF) { - (void) elf_end(elf); + (void)elf_end(elf); return (handle_binary(name, fd)); } if (gelf_getehdr(elf, ) == NULL) { - (void) elf_end(elf); + (void)elf_end(elf); warnx("%s: ELF file could not be processed", name); return (1); } if (elfhdr.e_shnum == 0 && elfhdr.e_type == ET_CORE) { - (void) elf_end(elf); + (void)elf_end(elf); return (handle_binary(name, fd)); } else { scn = NULL; @@ -281,7 +282,7 @@ handle_elf(const char *name, int fd) } } } - (void) elf_end(elf); + (void)elf_end(elf); return (rc); } @@ -304,7 +305,7 @@ getcharacter(void) buf[i] = c; } - switch(encoding) { + switch (encoding) { case ENCODING_7BIT: case ENCODING_8BIT: rt = buf[0]; @@ -317,12 +318,12 @@ getcharacter(void) break; case ENCODING_32BIT_BIG: rt = ((long) buf[0] << 24) | ((long) buf[1] << 16) | - ((long) buf[2] << 8) | buf[3]; - break; + ((long) buf[2] << 8) | buf[3]; + break; case ENCODING_32BIT_LITTLE: rt = buf[0] | ((long) buf[1] << 8) | ((long) buf[2] << 16) | - ((long) buf[3] << 24); - break; + ((long) buf[3] << 24); + break; } return (rt); } @@ -341,63 +342,60 @@ find_strings(const char *name, off_t offset, off_t siz int i; if ((obuf = (char*)calloc(1, min_len + 1)) == NULL) { - (void) fprintf(stderr, "Unable to allocate memory: %s\n", -strerror(errno)); + fprintf(stderr, "Unable to allocate memory: %s\n", + strerror(errno)); return (1); } - (void) fseeko(stdin, offset, SEEK_SET); + (void)fseeko(stdin, offset, SEEK_SET); cur_off = offset; start_off = 0; - while(1) { +
Re: svn commit: r340722 - head/lib/libbe
On Wed, Nov 21, 2018 at 08:54:10AM -0800, Rodney W. Grimes wrote: > > On Wed, Nov 21, 2018 at 10:19 AM Rodney W. Grimes > > wrote: > > > > > > > Author: 0mp (ports committer) > > > > Date: Wed Nov 21 11:22:44 2018 > > > > New Revision: 340722 > > > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > > > > > Log: > > > > libbe(3): Put each error value in separate line. > > > > > > > > As requested by a TODO in the source code. > > > > > > > > Reviewed by:bcr > > > > Approved by:krion (mentor, implicit), mat (mentor, implicit) > > > > Differential Revision: https://reviews.freebsd.org/D18063 > > > > > > Who with a src bit approved the commit to src? > > > > > > > I do want to clarify- bcr approved it in the review (explicitly with > > "... hereby approved!") -- are you mainly pointing out that he failed > > to annotate this properly in the commit, or is doc bit approval for a > > commit to a manpage in src insufficient? > > That is defanitly a bit of a grey area, from reading and re-reading > the commit bit page it is clear that a doc committer can commit > to src documentation, it is not clear if they can approve a commit > by someone else to the src tree, it does say > ""Approved by" from a non-mentored committer >with the appropriate bit" > > It probably would be fine to have said Approved by: bcr. > > I still question what a out of scope commit that is > approved by: (mentor, implicit). I am not even sure > what that means in this context. Have his mentors > said he can commit anything anyplace without them > seeing it? If so then release the mentor/mentee bit > would be more appropriate? > > > > > As an aside, happy to approve any changes to these manpages as the > > current bectl/libbe maintainer for anyone that wants to improve them. > > =) > > That defanitly would of been a cleaner path. C'mon guys. Mateusz is doing a great job with documentation - THANK YOU! I would be more outraged that we still didn't appreciate him. Thanks, -- Mariusz Zaborski oshogbo//vx | http://oshogbo.vexillium.org FreeBSD committer | https://freebsd.org Software developer | http://wheelsystems.com If it's not broken, let's fix it till it is!!1 signature.asc Description: PGP signature
svn commit: r340744 - in head/sys: fs/nfsclient fs/pseudofs kern sys
Author: mjg Date: Wed Nov 21 20:15:56 2018 New Revision: 340744 URL: https://svnweb.freebsd.org/changeset/base/340744 Log: proc: convert pfind & friends to use pidhash locks and other cleanup pfind_locked is retired as it relied on allproc which unnecessarily restricts locking of the hash. Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/pseudofs/pseudofs_vnops.c head/sys/kern/kern_proc.c head/sys/sys/proc.h Modified: head/sys/fs/nfsclient/nfs_clport.c == --- head/sys/fs/nfsclient/nfs_clport.c Wed Nov 21 19:49:21 2018 (r340743) +++ head/sys/fs/nfsclient/nfs_clport.c Wed Nov 21 20:15:56 2018 (r340744) @@ -1157,7 +1157,7 @@ nfscl_procdoesntexist(u_int8_t *own) tl.cval[2] = *own++; tl.cval[3] = *own++; pid = tl.lval; - p = pfind_locked(pid); + p = pfind(pid); if (p == NULL) return (1); if (p->p_stats == NULL) { Modified: head/sys/fs/pseudofs/pseudofs_vnops.c == --- head/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 21 19:49:21 2018 (r340743) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 21 20:15:56 2018 (r340744) @@ -107,7 +107,7 @@ pfs_visible_proc(struct thread *td, struct pfs_node *p static int pfs_visible(struct thread *td, struct pfs_node *pn, pid_t pid, -bool allproc_locked, struct proc **p) +struct proc **p) { struct proc *proc; @@ -118,7 +118,7 @@ pfs_visible(struct thread *td, struct pfs_node *pn, pi *p = NULL; if (pid == NO_PID) PFS_RETURN (1); - proc = allproc_locked ? pfind_locked(pid) : pfind(pid); + proc = pfind(pid); if (proc == NULL) PFS_RETURN (0); if (pfs_visible_proc(td, pn, proc)) { @@ -206,7 +206,7 @@ pfs_getattr(struct vop_getattr_args *va) PFS_TRACE(("%s", pn->pn_name)); pfs_assert_not_owned(pn); - if (!pfs_visible(curthread, pn, pvd->pvd_pid, false, )) + if (!pfs_visible(curthread, pn, pvd->pvd_pid, )) PFS_RETURN (ENOENT); vap->va_type = vn->v_type; @@ -297,7 +297,7 @@ pfs_ioctl(struct vop_ioctl_args *va) * This is necessary because process' privileges may * have changed since the open() call. */ - if (!pfs_visible(curthread, pn, pvd->pvd_pid, false, )) { + if (!pfs_visible(curthread, pn, pvd->pvd_pid, )) { VOP_UNLOCK(vn, 0); PFS_RETURN (EIO); } @@ -330,7 +330,7 @@ pfs_getextattr(struct vop_getextattr_args *va) * This is necessary because either process' privileges may * have changed since the open() call. */ - if (!pfs_visible(curthread, pn, pvd->pvd_pid, false, )) + if (!pfs_visible(curthread, pn, pvd->pvd_pid, )) PFS_RETURN (EIO); if (pn->pn_getextattr == NULL) @@ -466,7 +466,7 @@ pfs_lookup(struct vop_cachedlookup_args *va) PFS_RETURN (ENOENT); /* check that parent directory is visible... */ - if (!pfs_visible(curthread, pd, pvd->pvd_pid, false, NULL)) + if (!pfs_visible(curthread, pd, pvd->pvd_pid, NULL)) PFS_RETURN (ENOENT); /* self */ @@ -550,7 +550,7 @@ pfs_lookup(struct vop_cachedlookup_args *va) got_pnode: pfs_assert_not_owned(pd); pfs_assert_not_owned(pn); - visible = pfs_visible(curthread, pn, pid, false, NULL); + visible = pfs_visible(curthread, pn, pid, NULL); if (!visible) { error = ENOENT; goto failed; @@ -639,7 +639,7 @@ pfs_read(struct vop_read_args *va) * This is necessary because either process' privileges may * have changed since the open() call. */ - if (!pfs_visible(curthread, pn, pvd->pvd_pid, false, )) + if (!pfs_visible(curthread, pn, pvd->pvd_pid, )) PFS_RETURN (EIO); if (proc != NULL) { _PHOLD(proc); @@ -795,7 +795,7 @@ pfs_readdir(struct vop_readdir_args *va) pfs_lock(pd); /* check if the directory is visible to the caller */ -if (!pfs_visible(curthread, pd, pid, true, )) { +if (!pfs_visible(curthread, pd, pid, )) { sx_sunlock(_lock); pfs_unlock(pd); PFS_RETURN (ENOENT); @@ -1001,7 +1001,7 @@ pfs_write(struct vop_write_args *va) * This is necessary because either process' privileges may * have changed since the open() call. */ - if (!pfs_visible(curthread, pn, pvd->pvd_pid, false, )) + if (!pfs_visible(curthread, pn, pvd->pvd_pid, )) PFS_RETURN (EIO); if (proc != NULL) { _PHOLD(proc); Modified: head/sys/kern/kern_proc.c
svn commit: r340743 - releng/12.0/sys/dev/mmc
Author: marius Date: Wed Nov 21 19:49:21 2018 New Revision: 340743 URL: https://svnweb.freebsd.org/changeset/base/340743 Log: MFC: r340495, MF12: r340739 - Restore setting the clock for devices which support the default/legacy transfer mode only (lost with r321385). [1] - Similarly, don't try to set the power class on MMC devices that comply to version 4.0 of the system specification but are operated in default/ legacy transfer or 1-bit bus mode as no power class is specified for these cases. Trying to set a power class nevertheless resulted in an - albeit harmless - error message. PR: 231713 [1] Approved by: re (gjb) Modified: releng/12.0/sys/dev/mmc/mmc.c Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sys/dev/mmc/mmc.c == --- releng/12.0/sys/dev/mmc/mmc.c Wed Nov 21 18:56:15 2018 (r340742) +++ releng/12.0/sys/dev/mmc/mmc.c Wed Nov 21 19:49:21 2018 (r340743) @@ -830,9 +830,14 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i const uint8_t *ext_csd; uint32_t clock; uint8_t value; + enum mmc_bus_timing timing; + enum mmc_bus_width bus_width; dev = sc->dev; - if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4) + timing = mmcbr_get_timing(dev); + bus_width = ivar->bus_width; + if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4 || + timing == bus_timing_normal || bus_width == bus_width_1) return (MMC_ERR_NONE); value = 0; @@ -843,8 +848,8 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_195]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) >= bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing >= bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_195_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_195]; @@ -863,13 +868,13 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_360]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) == bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing == bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_360]; } else if (clock <= MMC_TYPE_HS200_HS400ES_MAX) { - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = ext_csd[EXT_CSD_PWR_CL_200_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_200_360]; @@ -881,7 +886,7 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i return (MMC_ERR_INVALID); } - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = (value & EXT_CSD_POWER_CLASS_8BIT_MASK) >> EXT_CSD_POWER_CLASS_8BIT_SHIFT; else @@ -2164,7 +2169,7 @@ mmc_calculate_clock(struct mmc_softc *sc) for (i = 0; i < sc->child_count; i++) { ivar = device_get_ivars(sc->child_list[i]); if ((ivar->timings & ~(1 << bus_timing_normal)) == 0) - continue; + goto clock; rca = ivar->rca; if (mmc_select_card(sc, rca) != MMC_ERR_NONE) { @@ -2230,6 +2235,7 @@ mmc_calculate_clock(struct mmc_softc *sc) } } +clock: /* Set clock (must be done before initial tuning). */ mmcbr_set_clock(dev, max_dtr); mmcbr_update_ios(dev); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r340737 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
On 21.11.2018 14:01, Rodney W. Grimes wrote: >> Author: mav >> Date: Wed Nov 21 18:18:57 2018 >> New Revision: 340737 >> URL: https://svnweb.freebsd.org/changeset/base/340737 >> >> Log: >> Revert r340096: 9952 Block size change during zfs receive drops spill block >> >> It was reported, and I easily reproduced it, that this change triggers >> panic >> when receiving replication stream with enabled embedded blocks, when short >> file compressing into one embedded block changes its block size. I am not >> sure that the problem is in this particuler patch, not just triggered by >> it, >> but since investigation and fix will take some time, I've decided to revert >> this for now. >> >> PR:198457, 233277 > > Is there any impact to stable/12, and more specifically, releng/12? No. This code was committed to head after the stable/12 branched, and I was just going to merge it when the new problem was reported. -- Alexander Motin ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r340737 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
> Author: mav > Date: Wed Nov 21 18:18:57 2018 > New Revision: 340737 > URL: https://svnweb.freebsd.org/changeset/base/340737 > > Log: > Revert r340096: 9952 Block size change during zfs receive drops spill block > > It was reported, and I easily reproduced it, that this change triggers panic > when receiving replication stream with enabled embedded blocks, when short > file compressing into one embedded block changes its block size. I am not > sure that the problem is in this particuler patch, not just triggered by it, > but since investigation and fix will take some time, I've decided to revert > this for now. > > PR: 198457, 233277 Is there any impact to stable/12, and more specifically, releng/12? Thanks, Rod > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c > == > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.cWed Nov > 21 17:47:40 2018(r340736) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.cWed Nov > 21 18:18:57 2018(r340737) > @@ -2143,7 +2143,6 @@ receive_object(struct receive_writer_arg *rwa, struct > { > dmu_object_info_t doi; > dmu_tx_t *tx; > - dmu_buf_t *db; > uint64_t object; > int err; > > @@ -2191,14 +2190,12 @@ receive_object(struct receive_writer_arg *rwa, struct > > tx = dmu_tx_create(rwa->os); > dmu_tx_hold_bonus(tx, object); > - dmu_tx_hold_write(tx, object, 0, 0); > err = dmu_tx_assign(tx, TXG_WAIT); > if (err != 0) { > dmu_tx_abort(tx); > return (err); > } > > - db = NULL; > if (object == DMU_NEW_OBJECT) { > /* currently free, want to be allocated */ > err = dmu_object_claim_dnsize(rwa->os, drro->drr_object, > @@ -2206,33 +2203,15 @@ receive_object(struct receive_writer_arg *rwa, struct > drro->drr_bonustype, drro->drr_bonuslen, > drro->drr_dn_slots << DNODE_SHIFT, tx); > } else if (drro->drr_type != doi.doi_type || > - (drro->drr_blksz != doi.doi_data_block_size && > - doi.doi_max_offset > doi.doi_data_block_size)) { > + drro->drr_blksz != doi.doi_data_block_size || > + drro->drr_bonustype != doi.doi_bonus_type || > + drro->drr_bonuslen != doi.doi_bonus_size) { > /* currently allocated, but with different properties */ > err = dmu_object_reclaim(rwa->os, drro->drr_object, > drro->drr_type, drro->drr_blksz, > drro->drr_bonustype, drro->drr_bonuslen, tx); > - } else { > - /* > - * Currently allocated, but with slightly different properties, > - * that may change live, like block size or bonus buffer. > - * Change those specifically to not loose the spill block, etc. > - */ > - if (drro->drr_bonustype != doi.doi_bonus_type || > - drro->drr_bonuslen != doi.doi_bonus_size) > - VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, > - )); > - if (drro->drr_bonustype != doi.doi_bonus_type) > - VERIFY0(dmu_set_bonustype(db, drro->drr_bonustype, tx)); > - if (drro->drr_bonuslen != doi.doi_bonus_size) > - VERIFY0(dmu_set_bonus(db, drro->drr_bonuslen, tx)); > - if (drro->drr_blksz != doi.doi_data_block_size) > - err = dmu_object_set_blocksize(rwa->os, > drro->drr_object, > - drro->drr_blksz, 0, tx); > } > if (err != 0) { > - if (db != NULL) > - dmu_buf_rele(db, FTAG); > dmu_tx_commit(tx); > return (SET_ERROR(EINVAL)); > } > @@ -2243,9 +,9 @@ receive_object(struct receive_writer_arg *rwa, struct > drro->drr_compress, tx); > > if (data != NULL) { > - if (db == NULL) > - VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, > - )); > + dmu_buf_t *db; > + > + VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, )); > dmu_buf_will_dirty(db, tx); > > ASSERT3U(db->db_size, >=, drro->drr_bonuslen); > @@ -2256,9 +2235,8 @@ receive_object(struct receive_writer_arg *rwa, struct > dmu_ot_byteswap[byteswap].ob_func(db->db_data, > drro->drr_bonuslen); > } > - } > - if (db != NULL) > dmu_buf_rele(db, FTAG); > + } > dmu_tx_commit(tx); > > return (0); > > -- Rod Grimes rgri...@freebsd.org
svn commit: r340742 - in head/sys: kern sys
Author: mjg Date: Wed Nov 21 18:56:15 2018 New Revision: 340742 URL: https://svnweb.freebsd.org/changeset/base/340742 Log: proc: implement pid hash locks and an iterator forks, exits and waits are frequently stalled during poudriere -j 128 runs due to killpg and process list exports performed for each package. Both uses take the allproc lock. The latter case can be modified to iterate over the hash with finer grained locking instead. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D17817 Modified: head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/kern_proc.c head/sys/sys/proc.h Modified: head/sys/kern/kern_exit.c == --- head/sys/kern/kern_exit.c Wed Nov 21 18:54:38 2018(r340741) +++ head/sys/kern/kern_exit.c Wed Nov 21 18:56:15 2018(r340742) @@ -435,7 +435,6 @@ exit1(struct thread *td, int rval, int signo) sx_xlock(_lock); LIST_REMOVE(p, p_list); LIST_INSERT_HEAD(, p, p_list); - LIST_REMOVE(p, p_hash); sx_xunlock(_lock); /* @@ -876,6 +875,9 @@ proc_reap(struct thread *td, struct proc *p, int *stat sx_xlock(_lock); LIST_REMOVE(p, p_list); /* off zombproc */ sx_xunlock(_lock); + sx_xlock(PIDHASHLOCK(p->p_pid)); + LIST_REMOVE(p, p_hash); + sx_xunlock(PIDHASHLOCK(p->p_pid)); LIST_REMOVE(p, p_sibling); reaper_abandon_children(p, true); LIST_REMOVE(p, p_reapsibling); Modified: head/sys/kern/kern_fork.c == --- head/sys/kern/kern_fork.c Wed Nov 21 18:54:38 2018(r340741) +++ head/sys/kern/kern_fork.c Wed Nov 21 18:56:15 2018(r340742) @@ -406,7 +406,9 @@ do_fork(struct thread *td, struct fork_req *fr, struct AUDIT_ARG_PID(p2->p_pid); LIST_INSERT_HEAD(, p2, p_list); allproc_gen++; + sx_xlock(PIDHASHLOCK(p2->p_pid)); LIST_INSERT_HEAD(PIDHASH(p2->p_pid), p2, p_hash); + sx_xunlock(PIDHASHLOCK(p2->p_pid)); PROC_LOCK(p2); PROC_LOCK(p1); Modified: head/sys/kern/kern_proc.c == --- head/sys/kern/kern_proc.c Wed Nov 21 18:54:38 2018(r340741) +++ head/sys/kern/kern_proc.c Wed Nov 21 18:56:15 2018(r340742) @@ -118,7 +118,9 @@ static struct proc *zpfind_locked(pid_t pid); * Other process lists */ struct pidhashhead *pidhashtbl; +struct sx *pidhashtbl_lock; u_long pidhash; +u_long pidhashlock; struct pgrphashhead *pgrphashtbl; u_long pgrphash; struct proclist allproc; @@ -173,6 +175,7 @@ CTASSERT(sizeof(struct kinfo_proc32) == KINFO_PROC32_S void procinit(void) { + u_long i; sx_init(_lock, "allproc"); sx_init(_lock, "proctree"); @@ -180,6 +183,13 @@ procinit(void) LIST_INIT(); LIST_INIT(); pidhashtbl = hashinit(maxproc / 4, M_PROC, ); + pidhashlock = (pidhash + 1) / 64; + if (pidhashlock > 0) + pidhashlock--; + pidhashtbl_lock = malloc(sizeof(*pidhashtbl_lock) * (pidhashlock + 1), + M_PROC, M_WAITOK | M_ZERO); + for (i = 0; i < pidhashlock + 1; i++) + sx_init(_lock[i], "pidhash"); pgrphashtbl = hashinit(maxproc / 4, M_PROC, ); proc_zone = uma_zcreate("PROC", sched_sizeof_proc(), proc_ctor, proc_dtor, proc_init, proc_fini, @@ -306,7 +316,7 @@ pfind_locked(pid_t pid) LIST_FOREACH(p, PIDHASH(pid), p_hash) { if (p->p_pid == pid) { PROC_LOCK(p); - if (p->p_state == PRS_NEW) { + if (p->p_state == PRS_NEW || p->p_state == PRS_ZOMBIE) { PROC_UNLOCK(p); p = NULL; } @@ -1421,13 +1431,134 @@ sysctl_out_proc(struct proc *p, struct sysctl_req *req return (0); } +int +proc_iterate(int (*cb)(struct proc *, void *), void *cbarg) +{ + struct proc *p; + int error, i, j; + + for (i = 0; i < pidhashlock + 1; i++) { + sx_slock(_lock[i]); + for (j = i; j <= pidhash; j += pidhashlock + 1) { + LIST_FOREACH(p, [j], p_hash) { + if (p->p_state == PRS_NEW) + continue; + error = cb(p, cbarg); + PROC_LOCK_ASSERT(p, MA_NOTOWNED); + if (error != 0) { + sx_sunlock(_lock[i]); + return (error); + } + } + } + sx_sunlock(_lock[i]); + } + return (0); +} + +struct
svn commit: r340741 - stable/10/sys/dev/mmc
Author: marius Date: Wed Nov 21 18:54:38 2018 New Revision: 340741 URL: https://svnweb.freebsd.org/changeset/base/340741 Log: MFC: r340495 - Restore setting the clock for devices which support the default/legacy transfer mode only (lost with r321385). [1] - Similarly, don't try to set the power class on MMC devices that comply to version 4.0 of the system specification but are operated in default/ legacy transfer or 1-bit bus mode as no power class is specified for these cases. Trying to set a power class nevertheless resulted in an - albeit harmless - error message. PR: 231713 [1] Modified: stable/10/sys/dev/mmc/mmc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mmc/mmc.c == --- stable/10/sys/dev/mmc/mmc.c Wed Nov 21 18:53:30 2018(r340740) +++ stable/10/sys/dev/mmc/mmc.c Wed Nov 21 18:54:38 2018(r340741) @@ -829,9 +829,14 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i const uint8_t *ext_csd; uint32_t clock; uint8_t value; + enum mmc_bus_timing timing; + enum mmc_bus_width bus_width; dev = sc->dev; - if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4) + timing = mmcbr_get_timing(dev); + bus_width = ivar->bus_width; + if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4 || + timing == bus_timing_normal || bus_width == bus_width_1) return (MMC_ERR_NONE); value = 0; @@ -842,8 +847,8 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_195]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) >= bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing >= bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_195_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_195]; @@ -862,13 +867,13 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_360]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) == bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing == bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_360]; } else if (clock <= MMC_TYPE_HS200_HS400ES_MAX) { - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = ext_csd[EXT_CSD_PWR_CL_200_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_200_360]; @@ -880,7 +885,7 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i return (MMC_ERR_INVALID); } - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = (value & EXT_CSD_POWER_CLASS_8BIT_MASK) >> EXT_CSD_POWER_CLASS_8BIT_SHIFT; else @@ -2166,7 +2171,7 @@ mmc_calculate_clock(struct mmc_softc *sc) for (i = 0; i < sc->child_count; i++) { ivar = device_get_ivars(sc->child_list[i]); if ((ivar->timings & ~(1 << bus_timing_normal)) == 0) - continue; + goto clock; rca = ivar->rca; if (mmc_select_card(sc, rca) != MMC_ERR_NONE) { @@ -2232,6 +2237,7 @@ mmc_calculate_clock(struct mmc_softc *sc) } } +clock: /* Set clock (must be done before initial tuning). */ mmcbr_set_clock(dev, max_dtr); mmcbr_update_ios(dev); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340740 - stable/11/sys/dev/mmc
Author: marius Date: Wed Nov 21 18:53:30 2018 New Revision: 340740 URL: https://svnweb.freebsd.org/changeset/base/340740 Log: MFC: r340495 - Restore setting the clock for devices which support the default/legacy transfer mode only (lost with r321385). [1] - Similarly, don't try to set the power class on MMC devices that comply to version 4.0 of the system specification but are operated in default/ legacy transfer or 1-bit bus mode as no power class is specified for these cases. Trying to set a power class nevertheless resulted in an - albeit harmless - error message. PR: 231713 [1] Modified: stable/11/sys/dev/mmc/mmc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mmc/mmc.c == --- stable/11/sys/dev/mmc/mmc.c Wed Nov 21 18:53:13 2018(r340739) +++ stable/11/sys/dev/mmc/mmc.c Wed Nov 21 18:53:30 2018(r340740) @@ -828,9 +828,14 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i const uint8_t *ext_csd; uint32_t clock; uint8_t value; + enum mmc_bus_timing timing; + enum mmc_bus_width bus_width; dev = sc->dev; - if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4) + timing = mmcbr_get_timing(dev); + bus_width = ivar->bus_width; + if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4 || + timing == bus_timing_normal || bus_width == bus_width_1) return (MMC_ERR_NONE); value = 0; @@ -841,8 +846,8 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_195]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) >= bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing >= bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_195_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_195]; @@ -861,13 +866,13 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_360]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) == bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing == bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_360]; } else if (clock <= MMC_TYPE_HS200_HS400ES_MAX) { - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = ext_csd[EXT_CSD_PWR_CL_200_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_200_360]; @@ -879,7 +884,7 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i return (MMC_ERR_INVALID); } - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = (value & EXT_CSD_POWER_CLASS_8BIT_MASK) >> EXT_CSD_POWER_CLASS_8BIT_SHIFT; else @@ -2165,7 +2170,7 @@ mmc_calculate_clock(struct mmc_softc *sc) for (i = 0; i < sc->child_count; i++) { ivar = device_get_ivars(sc->child_list[i]); if ((ivar->timings & ~(1 << bus_timing_normal)) == 0) - continue; + goto clock; rca = ivar->rca; if (mmc_select_card(sc, rca) != MMC_ERR_NONE) { @@ -2231,6 +2236,7 @@ mmc_calculate_clock(struct mmc_softc *sc) } } +clock: /* Set clock (must be done before initial tuning). */ mmcbr_set_clock(dev, max_dtr); mmcbr_update_ios(dev); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340739 - stable/12/sys/dev/mmc
Author: marius Date: Wed Nov 21 18:53:13 2018 New Revision: 340739 URL: https://svnweb.freebsd.org/changeset/base/340739 Log: MFC: r340495 - Restore setting the clock for devices which support the default/legacy transfer mode only (lost with r321385). [1] - Similarly, don't try to set the power class on MMC devices that comply to version 4.0 of the system specification but are operated in default/ legacy transfer or 1-bit bus mode as no power class is specified for these cases. Trying to set a power class nevertheless resulted in an - albeit harmless - error message. PR: 231713 [1] Modified: stable/12/sys/dev/mmc/mmc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mmc/mmc.c == --- stable/12/sys/dev/mmc/mmc.c Wed Nov 21 18:19:15 2018(r340738) +++ stable/12/sys/dev/mmc/mmc.c Wed Nov 21 18:53:13 2018(r340739) @@ -830,9 +830,14 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i const uint8_t *ext_csd; uint32_t clock; uint8_t value; + enum mmc_bus_timing timing; + enum mmc_bus_width bus_width; dev = sc->dev; - if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4) + timing = mmcbr_get_timing(dev); + bus_width = ivar->bus_width; + if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4 || + timing == bus_timing_normal || bus_width == bus_width_1) return (MMC_ERR_NONE); value = 0; @@ -843,8 +848,8 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_195]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) >= bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing >= bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_195_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_195]; @@ -863,13 +868,13 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_360]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) == bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing == bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_360]; } else if (clock <= MMC_TYPE_HS200_HS400ES_MAX) { - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = ext_csd[EXT_CSD_PWR_CL_200_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_200_360]; @@ -881,7 +886,7 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i return (MMC_ERR_INVALID); } - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = (value & EXT_CSD_POWER_CLASS_8BIT_MASK) >> EXT_CSD_POWER_CLASS_8BIT_SHIFT; else @@ -2164,7 +2169,7 @@ mmc_calculate_clock(struct mmc_softc *sc) for (i = 0; i < sc->child_count; i++) { ivar = device_get_ivars(sc->child_list[i]); if ((ivar->timings & ~(1 << bus_timing_normal)) == 0) - continue; + goto clock; rca = ivar->rca; if (mmc_select_card(sc, rca) != MMC_ERR_NONE) { @@ -2230,6 +2235,7 @@ mmc_calculate_clock(struct mmc_softc *sc) } } +clock: /* Set clock (must be done before initial tuning). */ mmcbr_set_clock(dev, max_dtr); mmcbr_update_ios(dev); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340737 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: mav Date: Wed Nov 21 18:18:57 2018 New Revision: 340737 URL: https://svnweb.freebsd.org/changeset/base/340737 Log: Revert r340096: 9952 Block size change during zfs receive drops spill block It was reported, and I easily reproduced it, that this change triggers panic when receiving replication stream with enabled embedded blocks, when short file compressing into one embedded block changes its block size. I am not sure that the problem is in this particuler patch, not just triggered by it, but since investigation and fix will take some time, I've decided to revert this for now. PR: 198457, 233277 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed Nov 21 17:47:40 2018(r340736) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed Nov 21 18:18:57 2018(r340737) @@ -2143,7 +2143,6 @@ receive_object(struct receive_writer_arg *rwa, struct { dmu_object_info_t doi; dmu_tx_t *tx; - dmu_buf_t *db; uint64_t object; int err; @@ -2191,14 +2190,12 @@ receive_object(struct receive_writer_arg *rwa, struct tx = dmu_tx_create(rwa->os); dmu_tx_hold_bonus(tx, object); - dmu_tx_hold_write(tx, object, 0, 0); err = dmu_tx_assign(tx, TXG_WAIT); if (err != 0) { dmu_tx_abort(tx); return (err); } - db = NULL; if (object == DMU_NEW_OBJECT) { /* currently free, want to be allocated */ err = dmu_object_claim_dnsize(rwa->os, drro->drr_object, @@ -2206,33 +2203,15 @@ receive_object(struct receive_writer_arg *rwa, struct drro->drr_bonustype, drro->drr_bonuslen, drro->drr_dn_slots << DNODE_SHIFT, tx); } else if (drro->drr_type != doi.doi_type || - (drro->drr_blksz != doi.doi_data_block_size && -doi.doi_max_offset > doi.doi_data_block_size)) { + drro->drr_blksz != doi.doi_data_block_size || + drro->drr_bonustype != doi.doi_bonus_type || + drro->drr_bonuslen != doi.doi_bonus_size) { /* currently allocated, but with different properties */ err = dmu_object_reclaim(rwa->os, drro->drr_object, drro->drr_type, drro->drr_blksz, drro->drr_bonustype, drro->drr_bonuslen, tx); - } else { - /* -* Currently allocated, but with slightly different properties, -* that may change live, like block size or bonus buffer. -* Change those specifically to not loose the spill block, etc. -*/ - if (drro->drr_bonustype != doi.doi_bonus_type || - drro->drr_bonuslen != doi.doi_bonus_size) - VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, - )); - if (drro->drr_bonustype != doi.doi_bonus_type) - VERIFY0(dmu_set_bonustype(db, drro->drr_bonustype, tx)); - if (drro->drr_bonuslen != doi.doi_bonus_size) - VERIFY0(dmu_set_bonus(db, drro->drr_bonuslen, tx)); - if (drro->drr_blksz != doi.doi_data_block_size) - err = dmu_object_set_blocksize(rwa->os, drro->drr_object, - drro->drr_blksz, 0, tx); } if (err != 0) { - if (db != NULL) - dmu_buf_rele(db, FTAG); dmu_tx_commit(tx); return (SET_ERROR(EINVAL)); } @@ -2243,9 +,9 @@ receive_object(struct receive_writer_arg *rwa, struct drro->drr_compress, tx); if (data != NULL) { - if (db == NULL) - VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, - )); + dmu_buf_t *db; + + VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, )); dmu_buf_will_dirty(db, tx); ASSERT3U(db->db_size, >=, drro->drr_bonuslen); @@ -2256,9 +2235,8 @@ receive_object(struct receive_writer_arg *rwa, struct dmu_ot_byteswap[byteswap].ob_func(db->db_data, drro->drr_bonuslen); } - } - if (db != NULL) dmu_buf_rele(db, FTAG); + } dmu_tx_commit(tx); return (0); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340738 - head/sys/netinet/tcp_stacks
Author: tuexen Date: Wed Nov 21 18:19:15 2018 New Revision: 340738 URL: https://svnweb.freebsd.org/changeset/base/340738 Log: Improve two KASSERTs in the TCP RACK stack. There are two locations where an always true comparison was made in a KASSERT. Replace this by an appropriate check and use a consistent panic message. Also use this code when checking a similar condition. PR: 229664 Reviewed by: rrs@ MFC after:1 week Sponsored by: Netflix, Inc. Differential Revision:https://reviews.freebsd.org/D18021 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c == --- head/sys/netinet/tcp_stacks/rack.c Wed Nov 21 18:18:57 2018 (r340737) +++ head/sys/netinet/tcp_stacks/rack.c Wed Nov 21 18:19:15 2018 (r340738) @@ -7053,12 +7053,10 @@ again: tlen = rsm->r_end - rsm->r_start; if (tlen > tp->t_maxseg) tlen = tp->t_maxseg; -#ifdef INVARIANTS - if (SEQ_GT(tp->snd_una, rsm->r_start)) { - panic("tp:%p rack:%p snd_una:%u rsm:%p r_start:%u", - tp, rack, tp->snd_una, rsm, rsm->r_start); - } -#endif + KASSERT(SEQ_LEQ(tp->snd_una, rsm->r_start), + ("%s:%d: r.start:%u < SND.UNA:%u; tp:%p, rack:%p, rsm:%p", + __func__, __LINE__, + rsm->r_start, tp->snd_una, tp, rack, rsm)); sb_offset = rsm->r_start - tp->snd_una; cwin = min(tp->snd_wnd, tlen); len = cwin; @@ -7069,12 +7067,14 @@ again: len = rsm->r_end - rsm->r_start; sack_rxmit = 1; sendalot = 0; + KASSERT(SEQ_LEQ(tp->snd_una, rsm->r_start), + ("%s:%d: r.start:%u < SND.UNA:%u; tp:%p, rack:%p, rsm:%p", + __func__, __LINE__, + rsm->r_start, tp->snd_una, tp, rack, rsm)); sb_offset = rsm->r_start - tp->snd_una; if (len >= tp->t_maxseg) { len = tp->t_maxseg; } - KASSERT(sb_offset >= 0, ("%s: sack block to the left of una : %d", - __func__, sb_offset)); } else if ((rack->rc_in_persist == 0) && ((rsm = tcp_rack_output(tp, rack, cts)) != NULL)) { long tlen; @@ -7099,6 +7099,10 @@ again: } #endif tlen = rsm->r_end - rsm->r_start; + KASSERT(SEQ_LEQ(tp->snd_una, rsm->r_start), + ("%s:%d: r.start:%u < SND.UNA:%u; tp:%p, rack:%p, rsm:%p", + __func__, __LINE__, + rsm->r_start, tp->snd_una, tp, rack, rsm)); sb_offset = rsm->r_start - tp->snd_una; if (tlen > rack->r_ctl.rc_prr_sndcnt) { len = rack->r_ctl.rc_prr_sndcnt; @@ -7120,8 +7124,6 @@ again: goto just_return_nolock; } } - KASSERT(sb_offset >= 0, ("%s: sack block to the left of una : %d", - __func__, sb_offset)); if (len > 0) { sub_from_prr = 1; sack_rxmit = 1; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm
On Wed, Nov 21, 2018 at 08:07:16AM +0200, Konstantin Belousov wrote: > On Tue, Nov 20, 2018 at 04:58:32PM -0800, Ben Widawsky wrote: > > On 18-11-20 19:51:48, Mark Johnston wrote: > > > On Tue, Nov 20, 2018 at 04:42:39PM -0800, Ben Widawsky wrote: > > > > On 18-11-20 19:35:15, Mark Johnston wrote: > > > > > On Tue, Nov 20, 2018 at 10:49:19PM +, Ben Widawsky wrote: > > > > > > Author: bwidawsk > > > > > > Date: Tue Nov 20 22:49:19 2018 > > > > > > New Revision: 340709 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/340709 > > > > > > > > > > > > Log: > > > > > > linuxkpi: Add some basic swap functions > > > > > > > > > > > > These are used by kms-drm to determine various heuristics relate > > > > > > memory conditions. > > > > > > > > > > > > The number of free swap pages is just a variable, and it can be > > > > > > much cheaper by either adding a new getter, or simply extern'ing > > > > > > swap_total. However, this patch opts to use the more expensive, > > > > > > existing interface - since this isn't an operation in a high per > > > > > > path. > > > > > > > > > > > > This allows us to remove some more gpl linuxkpi and do the follo > > > > > > kms-drm: > > > > > > git rm linuxkpi/gplv2/include/linux/swap.h > > > > > > > > > > > > Reviewed by:mmacy, Johannes Lundberg > > > > > > Approved by:emaste (mentor) > > > > > > Differential Revision: https://reviews.freebsd.org/D18052 > > > > > > > > > > > > Added: > > > > > > head/sys/compat/linuxkpi/common/include/linux/swap.h (contents, > > > > > > props changed) > > > > > > Modified: > > > > > > head/sys/vm/vm_pageout.h > > > > > > head/sys/vm/vm_swapout.c > > > > > > > > > > > > [...] > > > > > > Modified: head/sys/vm/vm_swapout.c > > > > > > == > > > > > > --- head/sys/vm/vm_swapout.cTue Nov 20 22:24:18 2018 > > > > > > (r340708) > > > > > > +++ head/sys/vm/vm_swapout.cTue Nov 20 22:49:19 2018 > > > > > > (r340709) > > > > > > @@ -961,3 +961,10 @@ swapout(struct proc *p) > > > > > > p->p_swtick = ticks; > > > > > > return (0); > > > > > > } > > > > > > + > > > > > > +/* Used to determine if the current process is itself the reaper. > > > > > > */ > > > > > > +bool > > > > > > +vm_curproc_is_vmproc(void) > > > > > > +{ > > > > > > + return curproc == vmproc; > > > > > > +} > > > > > > > > > > From a look at how this is used, it should probably be pageproc rather > > > > > than vmproc. There are various code paths that just check > > > > > curproc == pageproc inline. > > > > > > > > > > > > > Could I trouble you for a quick explanation of the difference between > > > > the two? > > > > > > pageproc contains the page daemon and laundry threads, which are > > > responsible for managing the LRU page queues and writing back dirty > > > pages. vmproc's main task is to swap out kernel stacks when the system > > > is under memory pressure, and swap them back in when necessary. It's a > > > somewhat legacy component of the system and isn't required. You can > > > build a kernel without it by specifying "options NO_SWAPPING" (which is > > > a somewhat misleading name), in which vm_swapout_dummy.c is compiled > > > instead of vm_swapout.c. > > > > > > > Thanks for the explanation. I indeed want the page daemon. I will put up a > > patch > > to do that the correct way. Thanks. > > What is the intent ? If the goal is to avoid wait for memory in > deadlock- prone contexts, then you perhaps want to return true for both > pagedaemon and vm daemon, and might be even the buf daemon threads as > well. In this case it's used to enable more aggressive shrinking of GEM objects. The function in question is invoked via a lowmem eventhandler, so the page daemon may indeed be the caller. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340736 - releng/12.0/sbin/dumpon
Author: markj Date: Wed Nov 21 17:47:40 2018 New Revision: 340736 URL: https://svnweb.freebsd.org/changeset/base/340736 Log: MFstable/12 r340728: Change dumpon(8)'s handling of -g. Approved by: re (gjb) Modified: releng/12.0/sbin/dumpon/dumpon.8 releng/12.0/sbin/dumpon/dumpon.c Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sbin/dumpon/dumpon.8 == --- releng/12.0/sbin/dumpon/dumpon.8Wed Nov 21 17:33:19 2018 (r340735) +++ releng/12.0/sbin/dumpon/dumpon.8Wed Nov 21 17:47:40 2018 (r340736) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 13, 2018 +.Dd November 17, 2018 .Dt DUMPON 8 .Os .Sh NAME @@ -46,7 +46,7 @@ .Op Fl k Ar pubkey .Op Fl Z .Op Fl z -.Op Fl g Ar gateway | Li default +.Op Fl g Ar gateway .Fl s Ar server .Fl c Ar client .Ar iface @@ -140,21 +140,22 @@ The local IP address of the .Xr netdump 4 client. .It Fl g Ar gateway -Optional. -If not specified, it is assumed that the -.Ar server -is on the same link as the -.Ar client . -.Pp -If specified, -.Ar gateway -is the address of the first-hop router between the +The first-hop router between .Ar client -and the +and .Ar server . -The special value -.Dv Dq default -indicates that the currently configured system default route should be used. +If the +.Fl g +option is not specified and the system has a default route, the default +router is used as the +.Xr netdump 4 +gateway. +If the +.Fl g +option is not specified and the system does not have a default route, +.Ar server +is assumed to be on the same link as +.Ar client . .It Fl s Ar server The IP address of the .Xr netdumpd 8 Modified: releng/12.0/sbin/dumpon/dumpon.c == --- releng/12.0/sbin/dumpon/dumpon.cWed Nov 21 17:33:19 2018 (r340735) +++ releng/12.0/sbin/dumpon/dumpon.cWed Nov 21 17:47:40 2018 (r340736) @@ -88,7 +88,7 @@ usage(void) fprintf(stderr, "usage: dumpon [-v] [-k ] [-Zz] \n" " dumpon [-v] [-k ] [-Zz]\n" -" [-g |default] -s -c \n" +" [-g ] -s -c \n" " dumpon [-v] off\n" " dumpon [-v] -l\n"); exit(EX_USAGE); @@ -109,8 +109,6 @@ find_gateway(const char *ifname) size_t sz; int error, i, ifindex, mib[7]; - ret = NULL; - /* First look up the interface index. */ if (getifaddrs() != 0) err(EX_OSERR, "getifaddrs"); @@ -148,6 +146,7 @@ find_gateway(const char *ifname) free(buf); } + ret = NULL; for (next = buf; next < buf + sz; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)(void *)next; if (rtm->rtm_version != RTM_VERSION) @@ -452,12 +451,16 @@ main(int argc, char *argv[]) if (inet_aton(client, _client) == 0) errx(EX_USAGE, "invalid client address '%s'", client); - if (gateway == NULL) - gateway = server; - else if (strcmp(gateway, "default") == 0 && - (gateway = find_gateway(argv[0])) == NULL) - errx(EX_NOHOST, - "failed to look up next-hop router for %s", server); + if (gateway == NULL) { + gateway = find_gateway(argv[0]); + if (gateway == NULL) { + if (verbose) + printf( + "failed to look up gateway for %s\n", + server); + gateway = server; + } + } if (inet_aton(gateway, _gateway) == 0) errx(EX_USAGE, "invalid gateway address '%s'", gateway); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340735 - releng/12.0/sys/net
Author: shurd Date: Wed Nov 21 17:33:19 2018 New Revision: 340735 URL: https://svnweb.freebsd.org/changeset/base/340735 Log: MFS r340729: Prevent POLA violation with TSO/CSUM offload Ensure that any time CSUM_IP_TSO or CSUM_IP6_TSO is set that the corresponding CSUM_IP6?_TCP / CSUM_IP flags are also set. Approved by: re (gjb) Sponsored by: Limelight Networks Modified: releng/12.0/sys/net/iflib.c Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sys/net/iflib.c == --- releng/12.0/sys/net/iflib.c Wed Nov 21 17:32:09 2018(r340734) +++ releng/12.0/sys/net/iflib.c Wed Nov 21 17:33:19 2018(r340735) @@ -2974,9 +2974,6 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, pi->ipi_ipproto = ip->ip_p; pi->ipi_flags |= IPI_TX_IPV4; - if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && (pi->ipi_csum_flags & CSUM_IP)) - ip->ip_sum = 0; - /* TCP checksum offload may require TCP header length */ if (IS_TX_OFFLOAD4(pi)) { if (__predict_true(pi->ipi_ipproto == IPPROTO_TCP)) { @@ -2993,6 +2990,10 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, if (IS_TSO4(pi)) { if (__predict_false(ip->ip_p != IPPROTO_TCP)) return (ENXIO); + /* +* TSO always requires hardware checksum offload. +*/ + pi->ipi_csum_flags |= (CSUM_IP_TCP | CSUM_IP); th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz; @@ -3002,6 +3003,9 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, } } } + if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && (pi->ipi_csum_flags & CSUM_IP)) + ip->ip_sum = 0; + break; } #endif @@ -3039,9 +3043,7 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, if (__predict_false(ip6->ip6_nxt != IPPROTO_TCP)) return (ENXIO); /* -* The corresponding flag is set by the stack in the IPv4 -* TSO case, but not in IPv6 (at least in FreeBSD 10.2). -* So, set it here because the rest of the flow requires it. +* TSO always requires hardware checksum offload. */ pi->ipi_csum_flags |= CSUM_IP6_TCP; th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340734 - head/sys/kern
Author: markj Date: Wed Nov 21 17:32:09 2018 New Revision: 340734 URL: https://svnweb.freebsd.org/changeset/base/340734 Log: Avoid unsynchronized updates to kn_status. kn_status is protected by the kqueue's lock, but we were updating it without the kqueue lock held. For EVFILT_TIMER knotes, there is no knlist lock, so the knote activation could occur during the kn_status update and result in KN_QUEUED being lost, in which case we'd enqueue an already-enqueued knote, corrupting the queue. Fix the problem by setting or clearing KN_DISABLED before dropping the kqueue lock to call into the filter. KN_DISABLED is used only by the core kevent code, so there is no side effect from setting it earlier. Reported and tested by: Sylvain GALLIANO Reviewed by: kib MFC after:3 days Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D18060 Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c == --- head/sys/kern/kern_event.c Wed Nov 21 17:28:10 2018(r340733) +++ head/sys/kern/kern_event.c Wed Nov 21 17:32:09 2018(r340734) @@ -1533,6 +1533,8 @@ findkn: kn->kn_kevent.flags &= ~(EV_ADD | EV_DELETE | EV_ENABLE | EV_DISABLE | EV_FORCEONESHOT); kn->kn_status = KN_DETACHED; + if ((kev->flags & EV_DISABLE) != 0) + kn->kn_status |= KN_DISABLED; kn_enter_flux(kn); error = knote_attach(kn, kq); @@ -1568,6 +1570,11 @@ findkn: KNOTE_ACTIVATE(kn, 1); } + if ((kev->flags & EV_ENABLE) != 0) + kn->kn_status &= ~KN_DISABLED; + else if ((kev->flags & EV_DISABLE) != 0) + kn->kn_status |= KN_DISABLED; + /* * The user may change some filter values after the initial EV_ADD, * but doing so will not reset any filter which has already been @@ -1585,19 +1592,17 @@ findkn: kn->kn_sdata = kev->data; } +done_ev_add: /* * We can get here with kn->kn_knlist == NULL. This can happen when * the initial attach event decides that the event is "completed" -* already. i.e. filt_procattach is called on a zombie process. It -* will call filt_proc which will remove it from the list, and NULL +* already, e.g., filt_procattach() is called on a zombie process. It +* will call filt_proc() which will remove it from the list, and NULL * kn_knlist. +* +* KN_DISABLED will be stable while the knote is in flux, so the +* unlocked read will not race with an update. */ -done_ev_add: - if ((kev->flags & EV_ENABLE) != 0) - kn->kn_status &= ~KN_DISABLED; - else if ((kev->flags & EV_DISABLE) != 0) - kn->kn_status |= KN_DISABLED; - if ((kn->kn_status & KN_DISABLED) == 0) event = kn->kn_fop->f_event(kn, 0); else ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340733 - in head/sys: kern sys
Author: markj Date: Wed Nov 21 17:28:10 2018 New Revision: 340733 URL: https://svnweb.freebsd.org/changeset/base/340733 Log: Remove KN_HASKQLOCK. It is a write-only flag whose last use was removed in r302235. No functional change intended. Reviewed by: kib MFC after:1 week Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D18059 Modified: head/sys/kern/kern_event.c head/sys/sys/event.h Modified: head/sys/kern/kern_event.c == --- head/sys/kern/kern_event.c Wed Nov 21 17:22:31 2018(r340732) +++ head/sys/kern/kern_event.c Wed Nov 21 17:28:10 2018(r340733) @@ -549,10 +549,8 @@ knote_fork(struct knlist *list, int pid) * The same as knote(), activate the event. */ if ((kn->kn_sfflags & NOTE_TRACK) == 0) { - kn->kn_status |= KN_HASKQLOCK; if (kn->kn_fop->f_event(kn, NOTE_FORK)) KNOTE_ACTIVATE(kn, 1); - kn->kn_status &= ~KN_HASKQLOCK; KQ_UNLOCK(kq); continue; } @@ -2272,10 +2270,8 @@ knote(struct knlist *list, long hint, int lockflags) KNOTE_ACTIVATE(kn, 1); KQ_UNLOCK_FLUX(kq); } else { - kn->kn_status |= KN_HASKQLOCK; if (kn->kn_fop->f_event(kn, hint)) KNOTE_ACTIVATE(kn, 1); - kn->kn_status &= ~KN_HASKQLOCK; KQ_UNLOCK(kq); } } Modified: head/sys/sys/event.h == --- head/sys/sys/event.hWed Nov 21 17:22:31 2018(r340732) +++ head/sys/sys/event.hWed Nov 21 17:28:10 2018(r340733) @@ -294,7 +294,6 @@ struct knote { #define KN_DETACHED0x08/* knote is detached */ #define KN_MARKER 0x20/* ignore this knote */ #define KN_KQUEUE 0x40/* this knote belongs to a kq */ -#define KN_HASKQLOCK 0x80/* for _inevent */ #defineKN_SCAN 0x100 /* flux set in kqueue_scan() */ int kn_influx; int kn_sfflags; /* saved filter flags */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340732 - releng/12.0/sbin/dumpon
Author: markj Date: Wed Nov 21 17:22:31 2018 New Revision: 340732 URL: https://svnweb.freebsd.org/changeset/base/340732 Log: MFstable/12 r340727: dumpon.8: Significantly revamp page Approved by: re (gjb) Modified: releng/12.0/sbin/dumpon/dumpon.8 Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sbin/dumpon/dumpon.8 == --- releng/12.0/sbin/dumpon/dumpon.8Wed Nov 21 17:19:08 2018 (r340731) +++ releng/12.0/sbin/dumpon/dumpon.8Wed Nov 21 17:22:31 2018 (r340732) @@ -59,27 +59,120 @@ .Sh DESCRIPTION The .Nm -utility is used to specify a device where the kernel can save a crash -dump in the case of a panic. +utility is used to configure where the kernel can save a crash dump in the case +of a panic. .Pp -Calls to +System administrators should typically configure .Nm -normally occur from the system multi-user initialization file -.Pa /etc/rc , -controlled by the -.Dq dumpdev +in a persistent fashion using the +.Xr rc.conf 5 +variables +.Va dumpdev and -.Dq dumpon_flags -variables in the boot time configuration file -.Pa /etc/rc.conf . +.Va dumpon_flags . +For more information on this usage, see +.Xr rc.conf 5 . +.Ss General options +.Bl -tag -width _k_pubkey +.It Fl k Ar pubkey +Configure encrypted kernel dumps. .Pp +A random, one-time symmetric key is automatically generated for bulk kernel +dump encryption every time +.Nm +is used. +The provided +.Ar pubkey +is used to encrypt a copy of the symmetric key. +The encrypted dump contents consist of a standard dump header, the +pubkey-encrypted symmetric key contents, and the symmetric key encrypted core +dump contents. +.Pp +As a result, only someone with the corresponding private key can decrypt the symmetric key. +The symmetric key is necessary to decrypt the kernel core. +The goal of the mechanism is to provide confidentiality. +.Pp +The +.Va pubkey +file should be a PEM-formatted RSA key of at least 1024 bits. +.It Fl l +List the currently configured dump device, or /dev/null if no device is +configured. +.It Fl v +Enable verbose mode. +.It Fl Z +Enable compression (Zstandard). +.It Fl z +Enable compression (gzip). +Only one compression method may be enabled at a time, so +.Fl z +is incompatible with +.Fl Z . +.Pp +Zstandard provides superior compression ratio and performance. +.El +.Ss Netdump +.Nm +may also configure the kernel to dump to a remote +.Xr netdumpd 8 +server. +(The +.Xr netdumpd 8 +server is available in ports.) +.Xr netdump 4 +eliminates the need to reserve space for crash dumps. +It is especially useful in diskless environments. +When +.Nm +is used to configure netdump, the +.Ar device +(or +.Ar iface ) +parameter should specify a network interface (e.g., +.Va igb1 ) . +The specified NIC must be up (online) to configure netdump. +.Pp +.Xr netdump 4 +specific options include: +.Bl -tag -width _g_gateway +.It Fl c Ar client +The local IP address of the +.Xr netdump 4 +client. +.It Fl g Ar gateway +Optional. +If not specified, it is assumed that the +.Ar server +is on the same link as the +.Ar client . +.Pp +If specified, +.Ar gateway +is the address of the first-hop router between the +.Ar client +and the +.Ar server . +The special value +.Dv Dq default +indicates that the currently configured system default route should be used. +.It Fl s Ar server +The IP address of the +.Xr netdumpd 8 +server. +.El +.Pp +All of these options can be specified in the +.Xr rc.conf 5 +variable +.Va dumpon_flags . +.Ss Minidumps The default type of kernel crash dump is the mini crash dump. Mini crash dumps hold only memory pages in use by the kernel. Alternatively, full memory dumps can be enabled by setting the .Va debug.minidump .Xr sysctl 8 variable to 0. -.Pp +.Ss Full dumps For systems using full memory dumps, the size of the specified dump device must be at least the size of physical memory. Even though an additional 64 kB header is added to the dump, the BIOS for a @@ -93,155 +186,18 @@ total amount of physical memory as reported by the .Va hw.physmem .Xr sysctl 8 variable. -.Pp -.Nm -is used to configure a local storage device as the dump device. -With additional parameters, the kernel can instead be configured to -transmit a dump to a remote server using -.Xr netdump 4 . -This eliminates the need to reserve space for saving crash dumps and -is especially useful in diskless environments. -The -.Xr netdump 4 -server address is specified with -.Fl s Ar server , -and the local address is specified with -.Fl c Ar client . -The -.Fl g Ar gateway -parameter may be used to specify a first-hop router to the server, -or to specify that the currently configured default gateway is to -be used. -Note that the -.Xr netdump 4 -configuration is not automatically updated if any network configuration -(e.g., the default route) changes after the -.Nm -invocation. -The name of the interface to be used must be
Re: svn commit: r340731 - head/sys/cddl/compat/opensolaris/kern
On Wed, Nov 21, 2018 at 05:19:08PM +, Mark Johnston wrote: > Author: markj > Date: Wed Nov 21 17:19:08 2018 > New Revision: 340731 > URL: https://svnweb.freebsd.org/changeset/base/340731 > > Log: > Use taskqueue_quiesce(9) to implement taskq_wait(). > > PR: 227784 > Reviewed by:cem > MFC after: 1 week > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D17975 Sorry, I forgot: Tested by: wulf ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340731 - head/sys/cddl/compat/opensolaris/kern
Author: markj Date: Wed Nov 21 17:19:08 2018 New Revision: 340731 URL: https://svnweb.freebsd.org/changeset/base/340731 Log: Use taskqueue_quiesce(9) to implement taskq_wait(). PR: 227784 Reviewed by: cem MFC after:1 week Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D17975 Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c == --- head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Wed Nov 21 17:18:27 2018(r340730) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Wed Nov 21 17:19:08 2018(r340731) @@ -171,11 +171,11 @@ taskq_dispatch_ent(taskq_t *tq, task_func_t func, void void taskq_wait(taskq_t *tq) { - taskqueue_drain_all(tq->tq_queue); + taskqueue_quiesce(tq->tq_queue); } void taskq_wait_id(taskq_t *tq, taskqid_t id) { -taskq_wait(tq); + taskqueue_drain_all(tq->tq_queue); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340730 - in head: share/man/man9 sys/kern sys/sys
Author: markj Date: Wed Nov 21 17:18:27 2018 New Revision: 340730 URL: https://svnweb.freebsd.org/changeset/base/340730 Log: Add a taskqueue_quiesce(9) KPI. This is similar to taskqueue_drain_all(9) but will wait for the queue to become idle before returning instead of only waiting for already-enqueued tasks to finish. This will be used in the opensolaris compat layer. PR: 227784 Reviewed by: cem MFC after:1 week Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D17975 Modified: head/share/man/man9/Makefile head/share/man/man9/taskqueue.9 head/sys/kern/subr_taskqueue.c head/sys/sys/taskqueue.h Modified: head/share/man/man9/Makefile == --- head/share/man/man9/MakefileWed Nov 21 17:14:57 2018 (r340729) +++ head/share/man/man9/MakefileWed Nov 21 17:18:27 2018 (r340730) @@ -2056,6 +2056,7 @@ MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_free.9 \ taskqueue.9 taskqueue_member.9 \ + taskqueue.9 taskqueue_quiesce.9 \ taskqueue.9 taskqueue_run.9 \ taskqueue.9 taskqueue_set_callback.9 \ taskqueue.9 taskqueue_start_threads.9 \ Modified: head/share/man/man9/taskqueue.9 == --- head/share/man/man9/taskqueue.9 Wed Nov 21 17:14:57 2018 (r340729) +++ head/share/man/man9/taskqueue.9 Wed Nov 21 17:18:27 2018 (r340730) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 2017 +.Dd November 21, 2018 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -94,6 +94,8 @@ struct timeout_task; .Ft void .Fn taskqueue_drain_all "struct taskqueue *queue" .Ft void +.Fn taskqueue_quiesce "struct taskqueue *queue" +.Ft void .Fn taskqueue_block "struct taskqueue *queue" .Ft void .Fn taskqueue_unblock "struct taskqueue *queue" @@ -298,6 +300,12 @@ do not extend the wait time of and may complete after .Fn taskqueue_drain_all returns. +The +.Fn taskqueue_quiesce +function is used to wait for the queue to become empty and for all +running tasks to finish. +To avoid blocking indefinitely, the caller must ensure by some mechanism +that tasks will eventually stop being posted to the queue. .Pp The .Fn taskqueue_block Modified: head/sys/kern/subr_taskqueue.c == --- head/sys/kern/subr_taskqueue.c Wed Nov 21 17:14:57 2018 (r340729) +++ head/sys/kern/subr_taskqueue.c Wed Nov 21 17:18:27 2018 (r340730) @@ -346,13 +346,13 @@ taskqueue_task_nop_fn(void *context, int pending) * have begun execution. Tasks queued during execution of * this function are ignored. */ -static void +static int taskqueue_drain_tq_queue(struct taskqueue *queue) { struct task t_barrier; if (STAILQ_EMPTY(>tq_queue)) - return; + return (0); /* * Enqueue our barrier after all current tasks, but with @@ -372,6 +372,7 @@ taskqueue_drain_tq_queue(struct taskqueue *queue) */ while (t_barrier.ta_pending != 0) TQ_SLEEP(queue, _barrier, >tq_mutex, PWAIT, "-", 0); + return (1); } /* @@ -379,13 +380,13 @@ taskqueue_drain_tq_queue(struct taskqueue *queue) * complete. Tasks that begin execution during the execution * of this function are ignored. */ -static void +static int taskqueue_drain_tq_active(struct taskqueue *queue) { struct taskqueue_busy tb_marker, *tb_first; if (TAILQ_EMPTY(>tq_active)) - return; + return (0); /* Block taskq_terminate().*/ queue->tq_callouts++; @@ -412,6 +413,7 @@ taskqueue_drain_tq_active(struct taskqueue *queue) queue->tq_callouts--; if ((queue->tq_flags & TQ_FLAGS_ACTIVE) == 0) wakeup_one(queue->tq_threads); + return (1); } void @@ -582,8 +584,8 @@ taskqueue_drain_all(struct taskqueue *queue) WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); TQ_LOCK(queue); - taskqueue_drain_tq_queue(queue); - taskqueue_drain_tq_active(queue); + (void)taskqueue_drain_tq_queue(queue); + (void)taskqueue_drain_tq_active(queue); TQ_UNLOCK(queue); } @@ -609,6 +611,20 @@ taskqueue_drain_timeout(struct taskqueue *queue, */ TQ_LOCK(queue); timeout_task->f &= ~DT_DRAIN_IN_PROGRESS; + TQ_UNLOCK(queue); +} + +void +taskqueue_quiesce(struct taskqueue *queue) +{ + int ret; + + TQ_LOCK(queue); + do { + ret = taskqueue_drain_tq_queue(queue); + if (ret == 0) + ret = taskqueue_drain_tq_active(queue); + } while (ret != 0); TQ_UNLOCK(queue); } Modified: head/sys/sys/taskqueue.h
svn commit: r340729 - stable/12/sys/net
Author: shurd Date: Wed Nov 21 17:14:57 2018 New Revision: 340729 URL: https://svnweb.freebsd.org/changeset/base/340729 Log: MFC r340435: Prevent POLA violation with TSO/CSUM offload Ensure that any time CSUM_IP_TSO or CSUM_IP6_TSO is set that the corresponding CSUM_IP6?_TCP / CSUM_IP flags are also set. Rather than requireing drivers to bake-in an understanding that TSO implies checksum offloads, make it explicit. This change requires us to move the IFLIB_NEED_ZERO_CSUM implementation to ensure it's zeroed for TSO. Reported by: Jacob Keller Sponsored by: Limelight Networks Differential Revision:https://reviews.freebsd.org/D17801 Modified: stable/12/sys/net/iflib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/iflib.c == --- stable/12/sys/net/iflib.c Wed Nov 21 17:07:07 2018(r340728) +++ stable/12/sys/net/iflib.c Wed Nov 21 17:14:57 2018(r340729) @@ -2974,9 +2974,6 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, pi->ipi_ipproto = ip->ip_p; pi->ipi_flags |= IPI_TX_IPV4; - if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && (pi->ipi_csum_flags & CSUM_IP)) - ip->ip_sum = 0; - /* TCP checksum offload may require TCP header length */ if (IS_TX_OFFLOAD4(pi)) { if (__predict_true(pi->ipi_ipproto == IPPROTO_TCP)) { @@ -2993,6 +2990,10 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, if (IS_TSO4(pi)) { if (__predict_false(ip->ip_p != IPPROTO_TCP)) return (ENXIO); + /* +* TSO always requires hardware checksum offload. +*/ + pi->ipi_csum_flags |= (CSUM_IP_TCP | CSUM_IP); th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz; @@ -3002,6 +3003,9 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, } } } + if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && (pi->ipi_csum_flags & CSUM_IP)) + ip->ip_sum = 0; + break; } #endif @@ -3039,9 +3043,7 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, if (__predict_false(ip6->ip6_nxt != IPPROTO_TCP)) return (ENXIO); /* -* The corresponding flag is set by the stack in the IPv4 -* TSO case, but not in IPv6 (at least in FreeBSD 10.2). -* So, set it here because the rest of the flow requires it. +* TSO always requires hardware checksum offload. */ pi->ipi_csum_flags |= CSUM_IP6_TCP; th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340728 - stable/12/sbin/dumpon
Author: markj Date: Wed Nov 21 17:07:07 2018 New Revision: 340728 URL: https://svnweb.freebsd.org/changeset/base/340728 Log: MFC r340547, r340686: Change dumpon(8)'s handling of -g. Modified: stable/12/sbin/dumpon/dumpon.8 stable/12/sbin/dumpon/dumpon.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/dumpon/dumpon.8 == --- stable/12/sbin/dumpon/dumpon.8 Wed Nov 21 17:04:42 2018 (r340727) +++ stable/12/sbin/dumpon/dumpon.8 Wed Nov 21 17:07:07 2018 (r340728) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 13, 2018 +.Dd November 17, 2018 .Dt DUMPON 8 .Os .Sh NAME @@ -46,7 +46,7 @@ .Op Fl k Ar pubkey .Op Fl Z .Op Fl z -.Op Fl g Ar gateway | Li default +.Op Fl g Ar gateway .Fl s Ar server .Fl c Ar client .Ar iface @@ -140,21 +140,22 @@ The local IP address of the .Xr netdump 4 client. .It Fl g Ar gateway -Optional. -If not specified, it is assumed that the -.Ar server -is on the same link as the -.Ar client . -.Pp -If specified, -.Ar gateway -is the address of the first-hop router between the +The first-hop router between .Ar client -and the +and .Ar server . -The special value -.Dv Dq default -indicates that the currently configured system default route should be used. +If the +.Fl g +option is not specified and the system has a default route, the default +router is used as the +.Xr netdump 4 +gateway. +If the +.Fl g +option is not specified and the system does not have a default route, +.Ar server +is assumed to be on the same link as +.Ar client . .It Fl s Ar server The IP address of the .Xr netdumpd 8 Modified: stable/12/sbin/dumpon/dumpon.c == --- stable/12/sbin/dumpon/dumpon.c Wed Nov 21 17:04:42 2018 (r340727) +++ stable/12/sbin/dumpon/dumpon.c Wed Nov 21 17:07:07 2018 (r340728) @@ -88,7 +88,7 @@ usage(void) fprintf(stderr, "usage: dumpon [-v] [-k ] [-Zz] \n" " dumpon [-v] [-k ] [-Zz]\n" -" [-g |default] -s -c \n" +" [-g ] -s -c \n" " dumpon [-v] off\n" " dumpon [-v] -l\n"); exit(EX_USAGE); @@ -109,8 +109,6 @@ find_gateway(const char *ifname) size_t sz; int error, i, ifindex, mib[7]; - ret = NULL; - /* First look up the interface index. */ if (getifaddrs() != 0) err(EX_OSERR, "getifaddrs"); @@ -148,6 +146,7 @@ find_gateway(const char *ifname) free(buf); } + ret = NULL; for (next = buf; next < buf + sz; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)(void *)next; if (rtm->rtm_version != RTM_VERSION) @@ -452,12 +451,16 @@ main(int argc, char *argv[]) if (inet_aton(client, _client) == 0) errx(EX_USAGE, "invalid client address '%s'", client); - if (gateway == NULL) - gateway = server; - else if (strcmp(gateway, "default") == 0 && - (gateway = find_gateway(argv[0])) == NULL) - errx(EX_NOHOST, - "failed to look up next-hop router for %s", server); + if (gateway == NULL) { + gateway = find_gateway(argv[0]); + if (gateway == NULL) { + if (verbose) + printf( + "failed to look up gateway for %s\n", + server); + gateway = server; + } + } if (inet_aton(gateway, _gateway) == 0) errx(EX_USAGE, "invalid gateway address '%s'", gateway); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340727 - stable/12/sbin/dumpon
Author: markj Date: Wed Nov 21 17:04:42 2018 New Revision: 340727 URL: https://svnweb.freebsd.org/changeset/base/340727 Log: MFC r339785 (by cem): dumpon.8: Significantly revamp page Modified: stable/12/sbin/dumpon/dumpon.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/dumpon/dumpon.8 == --- stable/12/sbin/dumpon/dumpon.8 Wed Nov 21 16:47:11 2018 (r340726) +++ stable/12/sbin/dumpon/dumpon.8 Wed Nov 21 17:04:42 2018 (r340727) @@ -59,27 +59,120 @@ .Sh DESCRIPTION The .Nm -utility is used to specify a device where the kernel can save a crash -dump in the case of a panic. +utility is used to configure where the kernel can save a crash dump in the case +of a panic. .Pp -Calls to +System administrators should typically configure .Nm -normally occur from the system multi-user initialization file -.Pa /etc/rc , -controlled by the -.Dq dumpdev +in a persistent fashion using the +.Xr rc.conf 5 +variables +.Va dumpdev and -.Dq dumpon_flags -variables in the boot time configuration file -.Pa /etc/rc.conf . +.Va dumpon_flags . +For more information on this usage, see +.Xr rc.conf 5 . +.Ss General options +.Bl -tag -width _k_pubkey +.It Fl k Ar pubkey +Configure encrypted kernel dumps. .Pp +A random, one-time symmetric key is automatically generated for bulk kernel +dump encryption every time +.Nm +is used. +The provided +.Ar pubkey +is used to encrypt a copy of the symmetric key. +The encrypted dump contents consist of a standard dump header, the +pubkey-encrypted symmetric key contents, and the symmetric key encrypted core +dump contents. +.Pp +As a result, only someone with the corresponding private key can decrypt the symmetric key. +The symmetric key is necessary to decrypt the kernel core. +The goal of the mechanism is to provide confidentiality. +.Pp +The +.Va pubkey +file should be a PEM-formatted RSA key of at least 1024 bits. +.It Fl l +List the currently configured dump device, or /dev/null if no device is +configured. +.It Fl v +Enable verbose mode. +.It Fl Z +Enable compression (Zstandard). +.It Fl z +Enable compression (gzip). +Only one compression method may be enabled at a time, so +.Fl z +is incompatible with +.Fl Z . +.Pp +Zstandard provides superior compression ratio and performance. +.El +.Ss Netdump +.Nm +may also configure the kernel to dump to a remote +.Xr netdumpd 8 +server. +(The +.Xr netdumpd 8 +server is available in ports.) +.Xr netdump 4 +eliminates the need to reserve space for crash dumps. +It is especially useful in diskless environments. +When +.Nm +is used to configure netdump, the +.Ar device +(or +.Ar iface ) +parameter should specify a network interface (e.g., +.Va igb1 ) . +The specified NIC must be up (online) to configure netdump. +.Pp +.Xr netdump 4 +specific options include: +.Bl -tag -width _g_gateway +.It Fl c Ar client +The local IP address of the +.Xr netdump 4 +client. +.It Fl g Ar gateway +Optional. +If not specified, it is assumed that the +.Ar server +is on the same link as the +.Ar client . +.Pp +If specified, +.Ar gateway +is the address of the first-hop router between the +.Ar client +and the +.Ar server . +The special value +.Dv Dq default +indicates that the currently configured system default route should be used. +.It Fl s Ar server +The IP address of the +.Xr netdumpd 8 +server. +.El +.Pp +All of these options can be specified in the +.Xr rc.conf 5 +variable +.Va dumpon_flags . +.Ss Minidumps The default type of kernel crash dump is the mini crash dump. Mini crash dumps hold only memory pages in use by the kernel. Alternatively, full memory dumps can be enabled by setting the .Va debug.minidump .Xr sysctl 8 variable to 0. -.Pp +.Ss Full dumps For systems using full memory dumps, the size of the specified dump device must be at least the size of physical memory. Even though an additional 64 kB header is added to the dump, the BIOS for a @@ -93,155 +186,18 @@ total amount of physical memory as reported by the .Va hw.physmem .Xr sysctl 8 variable. -.Pp -.Nm -is used to configure a local storage device as the dump device. -With additional parameters, the kernel can instead be configured to -transmit a dump to a remote server using -.Xr netdump 4 . -This eliminates the need to reserve space for saving crash dumps and -is especially useful in diskless environments. -The -.Xr netdump 4 -server address is specified with -.Fl s Ar server , -and the local address is specified with -.Fl c Ar client . -The -.Fl g Ar gateway -parameter may be used to specify a first-hop router to the server, -or to specify that the currently configured default gateway is to -be used. -Note that the -.Xr netdump 4 -configuration is not automatically updated if any network configuration -(e.g., the default route) changes after the -.Nm -invocation. -The name of the interface to be used must be specified as -.Ar iface . -The
Re: svn commit: r340722 - head/lib/libbe
On Wed, Nov 21, 2018 at 10:54 AM Rodney W. Grimes wrote: > > > On Wed, Nov 21, 2018 at 10:19 AM Rodney W. Grimes > > wrote: > > > > > > > Author: 0mp (ports committer) > > > > Date: Wed Nov 21 11:22:44 2018 > > > > New Revision: 340722 > > > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > > > > > Log: > > > > libbe(3): Put each error value in separate line. > > > > > > > > As requested by a TODO in the source code. > > > > > > > > Reviewed by:bcr > > > > Approved by:krion (mentor, implicit), mat (mentor, implicit) > > > > Differential Revision: https://reviews.freebsd.org/D18063 > > > > > > Who with a src bit approved the commit to src? > > > > > > > I do want to clarify- bcr approved it in the review (explicitly with > > "... hereby approved!") -- are you mainly pointing out that he failed > > to annotate this properly in the commit, or is doc bit approval for a > > commit to a manpage in src insufficient? > > That is defanitly a bit of a grey area, from reading and re-reading > the commit bit page it is clear that a doc committer can commit > to src documentation, it is not clear if they can approve a commit > by someone else to the src tree, it does say > ""Approved by" from a non-mentored committer > with the appropriate bit" > > It probably would be fine to have said Approved by: bcr. > Agreed- I think this is fine given that it's within the scope of bcr's doc bit. > I still question what a out of scope commit that is > approved by: (mentor, implicit). I am not even sure > what that means in this context. Have his mentors > said he can commit anything anyplace without them > seeing it? If so then release the mentor/mentee bit > would be more appropriate? > I suspect it's that they're not interested in any doc changes he has, because they're not doc people. Well, mat@ is, but mat isn't mentoring him for docs, he's mentoring him for ports. Such approvals would just be rubber stamps anyways, because they as mentors might not necessarily be up-to-date on doc protocols. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r340722 - head/lib/libbe
> On Wed, Nov 21, 2018 at 10:19 AM Rodney W. Grimes > wrote: > > > > > Author: 0mp (ports committer) > > > Date: Wed Nov 21 11:22:44 2018 > > > New Revision: 340722 > > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > > > Log: > > > libbe(3): Put each error value in separate line. > > > > > > As requested by a TODO in the source code. > > > > > > Reviewed by:bcr > > > Approved by:krion (mentor, implicit), mat (mentor, implicit) > > > Differential Revision: https://reviews.freebsd.org/D18063 > > > > Who with a src bit approved the commit to src? > > > > I do want to clarify- bcr approved it in the review (explicitly with > "... hereby approved!") -- are you mainly pointing out that he failed > to annotate this properly in the commit, or is doc bit approval for a > commit to a manpage in src insufficient? That is defanitly a bit of a grey area, from reading and re-reading the commit bit page it is clear that a doc committer can commit to src documentation, it is not clear if they can approve a commit by someone else to the src tree, it does say ""Approved by" from a non-mentored committer with the appropriate bit" It probably would be fine to have said Approved by: bcr. I still question what a out of scope commit that is approved by: (mentor, implicit). I am not even sure what that means in this context. Have his mentors said he can commit anything anyplace without them seeing it? If so then release the mentor/mentee bit would be more appropriate? > > As an aside, happy to approve any changes to these manpages as the > current bectl/libbe maintainer for anyone that wants to improve them. > =) That defanitly would of been a cleaner path. > > Thanks, > > Kyle Evans > -- Rod Grimes rgri...@freebsd.org ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340726 - in head/sys/cddl: contrib/opensolaris/uts/common/sys dev/fbt/powerpc
Author: jhibbits Date: Wed Nov 21 16:47:11 2018 New Revision: 340726 URL: https://svnweb.freebsd.org/changeset/base/340726 Log: DTrace/powerpc: Fix FBT return probes The FBT fuction boundary prober was setting one return probe marker value, but the dtrace handler was expecting another. This causes a hang when tracing return probes. Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h == --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Wed Nov 21 14:50:45 2018(r340725) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Wed Nov 21 16:47:11 2018(r340726) @@ -2435,12 +2435,11 @@ extern void dtrace_helpers_destroy(proc_t *); #elif defined(__powerpc__) -#define DTRACE_INVOP_RET 1 -#define DTRACE_INVOP_BCTR 2 -#define DTRACE_INVOP_BLR 3 -#define DTRACE_INVOP_JUMP 4 -#define DTRACE_INVOP_MFLR_R0 5 -#define DTRACE_INVOP_NOP 6 +#define DTRACE_INVOP_BCTR 1 +#define DTRACE_INVOP_BLR 2 +#define DTRACE_INVOP_JUMP 3 +#define DTRACE_INVOP_MFLR_R0 4 +#define DTRACE_INVOP_NOP 5 #elif defined(__arm__) Modified: head/sys/cddl/dev/fbt/powerpc/fbt_isa.c == --- head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Wed Nov 21 14:50:45 2018 (r340725) +++ head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Wed Nov 21 16:47:11 2018 (r340726) @@ -221,7 +221,7 @@ again: if (*instr == FBT_BCTR) fbt->fbtp_rval = DTRACE_INVOP_BCTR; else if (*instr == FBT_BLR) - fbt->fbtp_rval = DTRACE_INVOP_RET; + fbt->fbtp_rval = DTRACE_INVOP_BLR; else fbt->fbtp_rval = DTRACE_INVOP_JUMP; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r340722 - head/lib/libbe
On 2018-11-21 08:18:55 (-0800), Rodney W. Grimes wrote: > > Author: 0mp (ports committer) > > Date: Wed Nov 21 11:22:44 2018 > > New Revision: 340722 > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > Log: > > libbe(3): Put each error value in separate line. > > > > As requested by a TODO in the source code. > > > > Reviewed by: bcr > > Approved by: krion (mentor, implicit), mat (mentor, implicit) > > Differential Revision:https://reviews.freebsd.org/D18063 > > Who with a src bit approved the commit to src? > My understanding is that doc bits allow people to commit to src documentation, including man pages. (https://www.freebsd.org/doc/en/articles/committers-guide/committer.types.html) Best regards, Kristof ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r340722 - head/lib/libbe
On Wed, Nov 21, 2018 at 10:19 AM Rodney W. Grimes wrote: > > > Author: 0mp (ports committer) > > Date: Wed Nov 21 11:22:44 2018 > > New Revision: 340722 > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > Log: > > libbe(3): Put each error value in separate line. > > > > As requested by a TODO in the source code. > > > > Reviewed by:bcr > > Approved by:krion (mentor, implicit), mat (mentor, implicit) > > Differential Revision: https://reviews.freebsd.org/D18063 > > Who with a src bit approved the commit to src? > I do want to clarify- bcr approved it in the review (explicitly with "... hereby approved!") -- are you mainly pointing out that he failed to annotate this properly in the commit, or is doc bit approval for a commit to a manpage in src insufficient? As an aside, happy to approve any changes to these manpages as the current bectl/libbe maintainer for anyone that wants to improve them. =) Thanks, Kyle Evans ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r340722 - head/lib/libbe
On Thu, Nov 22, 2018, 12:19 AM Rodney W. Grimes < free...@pdx.rh.cn85.dnsmgr.net wrote: > > Author: 0mp (ports committer) > > Date: Wed Nov 21 11:22:44 2018 > > New Revision: 340722 > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > Log: > > libbe(3): Put each error value in separate line. > > > > As requested by a TODO in the source code. > > > > Reviewed by:bcr > > Approved by:krion (mentor, implicit), mat (mentor, implicit) > > Differential Revision: https://reviews.freebsd.org/D18063 > > Who with a src bit approved the commit to src? > I was asking myself the same question!! > > Modified: > > head/lib/libbe/libbe.3 > > > > Modified: head/lib/libbe/libbe.3 > > > == > > --- head/lib/libbe/libbe.3Wed Nov 21 06:36:15 2018(r340721) > > +++ head/lib/libbe/libbe.3Wed Nov 21 11:22:44 2018(r340722) > > @@ -28,7 +28,7 @@ > > .\" > > .\" $FreeBSD$ > > .\" > > -.Dd November 17, 2018 > > +.Dd November 21, 2018 > > .Dt LIBBE 3 > > .Os > > .Sh NAME > > @@ -440,30 +440,49 @@ The > > .Fn be_prop_list_free > > function will free the property list. > > .Sh DIAGNOSTICS > > -Upon error, one of the following values will be returned. > > -.\" TODO: make each entry on its own line. > > -.Bd -ragged -offset indent > > -BE_ERR_SUCCESS, > > -BE_ERR_INVALIDNAME, > > -BE_ERR_EXISTS, > > -BE_ERR_NOENT, > > -BE_ERR_PERMS, > > -BE_ERR_DESTROYACT, > > -BE_ERR_DESTROYMNT, > > -BE_ERR_BADPATH, > > -BE_ERR_PATHBUSY, > > -BE_ERR_PATHLEN, > > -BE_ERR_BADMOUNT, > > -BE_ERR_NOORIGIN, > > -BE_ERR_MOUNTED, > > -BE_ERR_NOMOUNT, > > -BE_ERR_ZFSOPEN, > > -BE_ERR_ZFSCLONE, > > -BE_ERR_IO, > > -BE_ERR_NOPOOL, > > -BE_ERR_NOMEM, > > +Upon error, one of the following values will be returned: > > +.Bl -dash -offset indent -compact > > +.It > > +BE_ERR_SUCCESS > > +.It > > +BE_ERR_INVALIDNAME > > +.It > > +BE_ERR_EXISTS > > +.It > > +BE_ERR_NOENT > > +.It > > +BE_ERR_PERMS > > +.It > > +BE_ERR_DESTROYACT > > +.It > > +BE_ERR_DESTROYMNT > > +.It > > +BE_ERR_BADPATH > > +.It > > +BE_ERR_PATHBUSY > > +.It > > +BE_ERR_PATHLEN > > +.It > > +BE_ERR_BADMOUNT > > +.It > > +BE_ERR_NOORIGIN > > +.It > > +BE_ERR_MOUNTED > > +.It > > +BE_ERR_NOMOUNT > > +.It > > +BE_ERR_ZFSOPEN > > +.It > > +BE_ERR_ZFSCLONE > > +.It > > +BE_ERR_IO > > +.It > > +BE_ERR_NOPOOL > > +.It > > +BE_ERR_NOMEM > > +.It > > BE_ERR_UNKNOWN > > -.Ed > > +.El > > .Sh SEE ALSO > > .Xr be 1 > > .Sh HISTORY > > > > > > -- > Rod Grimes > rgri...@freebsd.org > > ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r340722 - head/lib/libbe
> Author: 0mp (ports committer) > Date: Wed Nov 21 11:22:44 2018 > New Revision: 340722 > URL: https://svnweb.freebsd.org/changeset/base/340722 > > Log: > libbe(3): Put each error value in separate line. > > As requested by a TODO in the source code. > > Reviewed by:bcr > Approved by:krion (mentor, implicit), mat (mentor, implicit) > Differential Revision: https://reviews.freebsd.org/D18063 Who with a src bit approved the commit to src? > Modified: > head/lib/libbe/libbe.3 > > Modified: head/lib/libbe/libbe.3 > == > --- head/lib/libbe/libbe.3Wed Nov 21 06:36:15 2018(r340721) > +++ head/lib/libbe/libbe.3Wed Nov 21 11:22:44 2018(r340722) > @@ -28,7 +28,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd November 17, 2018 > +.Dd November 21, 2018 > .Dt LIBBE 3 > .Os > .Sh NAME > @@ -440,30 +440,49 @@ The > .Fn be_prop_list_free > function will free the property list. > .Sh DIAGNOSTICS > -Upon error, one of the following values will be returned. > -.\" TODO: make each entry on its own line. > -.Bd -ragged -offset indent > -BE_ERR_SUCCESS, > -BE_ERR_INVALIDNAME, > -BE_ERR_EXISTS, > -BE_ERR_NOENT, > -BE_ERR_PERMS, > -BE_ERR_DESTROYACT, > -BE_ERR_DESTROYMNT, > -BE_ERR_BADPATH, > -BE_ERR_PATHBUSY, > -BE_ERR_PATHLEN, > -BE_ERR_BADMOUNT, > -BE_ERR_NOORIGIN, > -BE_ERR_MOUNTED, > -BE_ERR_NOMOUNT, > -BE_ERR_ZFSOPEN, > -BE_ERR_ZFSCLONE, > -BE_ERR_IO, > -BE_ERR_NOPOOL, > -BE_ERR_NOMEM, > +Upon error, one of the following values will be returned: > +.Bl -dash -offset indent -compact > +.It > +BE_ERR_SUCCESS > +.It > +BE_ERR_INVALIDNAME > +.It > +BE_ERR_EXISTS > +.It > +BE_ERR_NOENT > +.It > +BE_ERR_PERMS > +.It > +BE_ERR_DESTROYACT > +.It > +BE_ERR_DESTROYMNT > +.It > +BE_ERR_BADPATH > +.It > +BE_ERR_PATHBUSY > +.It > +BE_ERR_PATHLEN > +.It > +BE_ERR_BADMOUNT > +.It > +BE_ERR_NOORIGIN > +.It > +BE_ERR_MOUNTED > +.It > +BE_ERR_NOMOUNT > +.It > +BE_ERR_ZFSOPEN > +.It > +BE_ERR_ZFSCLONE > +.It > +BE_ERR_IO > +.It > +BE_ERR_NOPOOL > +.It > +BE_ERR_NOMEM > +.It > BE_ERR_UNKNOWN > -.Ed > +.El > .Sh SEE ALSO > .Xr be 1 > .Sh HISTORY > > -- Rod Grimes rgri...@freebsd.org ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r339898 - head/lib/libc/amd64/sys
On Tue, 20 Nov 2018 at 21:21, Shawn Webb wrote: > > Hey Kostik, > > It appears this commit broke building/linking libc with LTO. I'm > running into this assertion from clang/lld 7.0.0 (from the > projects/clang700-import feature branch): Yes, if you can reproduce with upstream clang/llvm/lld head then an llvm bug is the best way to track this. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340725 - head/tools/build/options
Author: emaste Date: Wed Nov 21 14:50:45 2018 New Revision: 340725 URL: https://svnweb.freebsd.org/changeset/base/340725 Log: Add some non-default src.conf(5) knob descriptions Some WITH_/WITHOUT_ defaults will likey change in the future (e.g. as we migrate to copyfree base system components). Add non-default descriptions for the benefit of WIP branches. Added: head/tools/build/options/WITHOUT_BSD_GREP (contents, props changed) head/tools/build/options/WITH_GCOV (contents, props changed) head/tools/build/options/WITH_GNU_DIFF (contents, props changed) head/tools/build/options/WITH_GNU_GREP (contents, props changed) head/tools/build/options/WITH_SENDMAIL (contents, props changed) head/tools/build/options/WITH_TCP_WRAPPERS (contents, props changed) Added: head/tools/build/options/WITHOUT_BSD_GREP == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_BSD_GREP Wed Nov 21 14:50:45 2018 (r340725) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Install GNU grep as '[ef]grep' instead of BSD grep. Added: head/tools/build/options/WITH_GCOV == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_GCOV Wed Nov 21 14:50:45 2018 (r340725) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Build and install the GNU +.Xr gcov 1 +tool. Added: head/tools/build/options/WITH_GNU_DIFF == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_GNU_DIFF Wed Nov 21 14:50:45 2018 (r340725) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Build and install GNU +.Xr diff 1 +and +.Xr diff3 1 . Added: head/tools/build/options/WITH_GNU_GREP == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_GNU_GREP Wed Nov 21 14:50:45 2018 (r340725) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Build and install GNU +.Xr grep 1 . Added: head/tools/build/options/WITH_SENDMAIL == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_SENDMAIL Wed Nov 21 14:50:45 2018 (r340725) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Build and install +.Xr sendmail 8 +and related programs. Added: head/tools/build/options/WITH_TCP_WRAPPERS == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_TCP_WRAPPERS Wed Nov 21 14:50:45 2018 (r340725) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Build and install +.Xr tcpd 8 , +and related utilities. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340724 - head/sys/net
Author: oleg Date: Wed Nov 21 13:34:21 2018 New Revision: 340724 URL: https://svnweb.freebsd.org/changeset/base/340724 Log: Unbreak kernel build with VLAN_ARRAY defined. MFC after:1 week Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c == --- head/sys/net/if_vlan.c Wed Nov 21 12:46:28 2018(r340723) +++ head/sys/net/if_vlan.c Wed Nov 21 13:34:21 2018(r340724) @@ -314,15 +314,15 @@ VNET_DEFINE_STATIC(struct if_clone *, vlan_cloner); #defineV_vlan_cloner VNET(vlan_cloner) #endif -#ifndef VLAN_ARRAY -#define HASH(n, m) n) >> 8) ^ ((n) >> 4) ^ (n)) & (m)) - static void vlan_mc_free(struct epoch_context *ctx) { struct vlan_mc_entry *mc = __containerof(ctx, struct vlan_mc_entry, mc_epoch_ctx); free(mc, M_VLAN); } + +#ifndef VLAN_ARRAY +#define HASH(n, m) n) >> 8) ^ ((n) >> 4) ^ (n)) & (m)) static void vlan_inithash(struct ifvlantrunk *trunk) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340723 - in head: lib/libbe sbin/bectl
Author: 0mp (ports committer) Date: Wed Nov 21 12:46:28 2018 New Revision: 340723 URL: https://svnweb.freebsd.org/changeset/base/340723 Log: Cross-reference libbe(3) and bectl(8). Those two manual pages are already referencing each other in the HISTORY sections, which people might skip. Mention those manual pages explicitly in the SEE ALSO sections. Also, remove a reference to be(1) from libbe(3). Reviewed by: bcr Approved by: krion (mentor, implicit), mat (mentor, implicit) Differential Revision:https://reviews.freebsd.org/D18136 Modified: head/lib/libbe/libbe.3 head/sbin/bectl/bectl.8 Modified: head/lib/libbe/libbe.3 == --- head/lib/libbe/libbe.3 Wed Nov 21 11:22:44 2018(r340722) +++ head/lib/libbe/libbe.3 Wed Nov 21 12:46:28 2018(r340723) @@ -484,7 +484,7 @@ BE_ERR_NOMEM BE_ERR_UNKNOWN .El .Sh SEE ALSO -.Xr be 1 +.Xr bectl 8 .Sh HISTORY .Nm and its corresponding command, Modified: head/sbin/bectl/bectl.8 == --- head/sbin/bectl/bectl.8 Wed Nov 21 11:22:44 2018(r340722) +++ head/sbin/bectl/bectl.8 Wed Nov 21 12:46:28 2018(r340723) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 24, 2018 +.Dd November 21, 2018 .Dt BECTL 8 .Os .Sh NAME @@ -263,6 +263,7 @@ will force the unmount if busy. To fill in with jail upgrade example when behavior is firm. .El .Sh SEE ALSO +.Xr libbe 3 , .Xr jail 8 , .Xr zfs 8 , .Xr zpool 8 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r340722 - head/lib/libbe
Author: 0mp (ports committer) Date: Wed Nov 21 11:22:44 2018 New Revision: 340722 URL: https://svnweb.freebsd.org/changeset/base/340722 Log: libbe(3): Put each error value in separate line. As requested by a TODO in the source code. Reviewed by: bcr Approved by: krion (mentor, implicit), mat (mentor, implicit) Differential Revision:https://reviews.freebsd.org/D18063 Modified: head/lib/libbe/libbe.3 Modified: head/lib/libbe/libbe.3 == --- head/lib/libbe/libbe.3 Wed Nov 21 06:36:15 2018(r340721) +++ head/lib/libbe/libbe.3 Wed Nov 21 11:22:44 2018(r340722) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 17, 2018 +.Dd November 21, 2018 .Dt LIBBE 3 .Os .Sh NAME @@ -440,30 +440,49 @@ The .Fn be_prop_list_free function will free the property list. .Sh DIAGNOSTICS -Upon error, one of the following values will be returned. -.\" TODO: make each entry on its own line. -.Bd -ragged -offset indent -BE_ERR_SUCCESS, -BE_ERR_INVALIDNAME, -BE_ERR_EXISTS, -BE_ERR_NOENT, -BE_ERR_PERMS, -BE_ERR_DESTROYACT, -BE_ERR_DESTROYMNT, -BE_ERR_BADPATH, -BE_ERR_PATHBUSY, -BE_ERR_PATHLEN, -BE_ERR_BADMOUNT, -BE_ERR_NOORIGIN, -BE_ERR_MOUNTED, -BE_ERR_NOMOUNT, -BE_ERR_ZFSOPEN, -BE_ERR_ZFSCLONE, -BE_ERR_IO, -BE_ERR_NOPOOL, -BE_ERR_NOMEM, +Upon error, one of the following values will be returned: +.Bl -dash -offset indent -compact +.It +BE_ERR_SUCCESS +.It +BE_ERR_INVALIDNAME +.It +BE_ERR_EXISTS +.It +BE_ERR_NOENT +.It +BE_ERR_PERMS +.It +BE_ERR_DESTROYACT +.It +BE_ERR_DESTROYMNT +.It +BE_ERR_BADPATH +.It +BE_ERR_PATHBUSY +.It +BE_ERR_PATHLEN +.It +BE_ERR_BADMOUNT +.It +BE_ERR_NOORIGIN +.It +BE_ERR_MOUNTED +.It +BE_ERR_NOMOUNT +.It +BE_ERR_ZFSOPEN +.It +BE_ERR_ZFSCLONE +.It +BE_ERR_IO +.It +BE_ERR_NOPOOL +.It +BE_ERR_NOMEM +.It BE_ERR_UNKNOWN -.Ed +.El .Sh SEE ALSO .Xr be 1 .Sh HISTORY ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"