svn commit: r356937 - head/sys/conf
Author: kevans Date: Tue Jan 21 05:01:11 2020 New Revision: 356937 URL: https://svnweb.freebsd.org/changeset/base/356937 Log: sysent.mk: split interpreter out of target command The main objective here is to make it easy to identify what needs to change in order to use a different sysent generator than the current Lua-based one, which may be used to MFC some of the changes that have happened so we can avoid parallel accidents in stable branches, for instance. As a secondary objective, it's now feasible to override the generator on a per-Makefile basis if needed, so that one could refactor their Makefile to use this while pinning generation to the legacy makesyscalls.sh. I don't anticipate any consistent need for such a thing, but it's low-effort to achieve. Modified: head/sys/conf/sysent.mk Modified: head/sys/conf/sysent.mk == --- head/sys/conf/sysent.mk Tue Jan 21 00:12:57 2020(r356936) +++ head/sys/conf/sysent.mk Tue Jan 21 05:01:11 2020(r356937) @@ -21,8 +21,11 @@ SYSENT_CONF?=syscalls.conf # and set GENERATED. SRCS+= ${SYSENT_FILE} SRCS+= ${SYSENT_CONF} -MAKESYSCALLS= ${SYSDIR}/tools/makesyscalls.lua +MAKESYSCALLS_INTERP?= ${LUA} +MAKESYSCALLS_SCRIPT?= ${SYSDIR}/tools/makesyscalls.lua +MAKESYSCALLS= ${MAKESYSCALLS_INTERP} ${MAKESYSCALLS_SCRIPT} + all: @echo "make sysent only" @@ -31,5 +34,5 @@ all: .ORDER: ${GENERATED} sysent: ${GENERATED} -${GENERATED}: ${MAKESYSCALLS} ${SRCS} - ${LUA} ${MAKESYSCALLS} ${SYSENT_FILE} ${SYSENT_CONF} +${GENERATED}: ${MAKESYSCALLS_SCRIPT} ${SRCS} + ${MAKESYSCALLS} ${SYSENT_FILE} ${SYSENT_CONF} ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356936 - head/sys/vm
Author: jeff Date: Tue Jan 21 00:12:57 2020 New Revision: 356936 URL: https://svnweb.freebsd.org/changeset/base/356936 Log: Move readahead and dropbehind fault functionality into a helper routine for clarity. Reviewed by: dougm, kib, markj Differential Revision:https://reviews.freebsd.org/D23282 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c == --- head/sys/vm/vm_fault.c Mon Jan 20 23:44:10 2020(r356935) +++ head/sys/vm/vm_fault.c Tue Jan 21 00:12:57 2020(r356936) @@ -120,6 +120,7 @@ __FBSDID("$FreeBSD$"); #defineVM_FAULT_DONTNEED_MIN 1048576 struct faultstate { + vm_offset_t vaddr; vm_page_t m; vm_page_t m_cow; vm_object_t object; @@ -680,6 +681,59 @@ vm_fault_lock_vnode(struct faultstate *fs, bool objloc } /* + * Calculate the desired readahead. Handle drop-behind. + * + * Returns the number of readahead blocks to pass to the pager. + */ +static int +vm_fault_readahead(struct faultstate *fs) +{ + int era, nera; + u_char behavior; + + KASSERT(fs->lookup_still_valid, ("map unlocked")); + era = fs->entry->read_ahead; + behavior = vm_map_entry_behavior(fs->entry); + if (behavior == MAP_ENTRY_BEHAV_RANDOM) { + nera = 0; + } else if (behavior == MAP_ENTRY_BEHAV_SEQUENTIAL) { + nera = VM_FAULT_READ_AHEAD_MAX; + if (fs->vaddr == fs->entry->next_read) + vm_fault_dontneed(fs, fs->vaddr, nera); + } else if (fs->vaddr == fs->entry->next_read) { + /* +* This is a sequential fault. Arithmetically +* increase the requested number of pages in +* the read-ahead window. The requested +* number of pages is "# of sequential faults +* x (read ahead min + 1) + read ahead min" +*/ + nera = VM_FAULT_READ_AHEAD_MIN; + if (era > 0) { + nera += era + 1; + if (nera > VM_FAULT_READ_AHEAD_MAX) + nera = VM_FAULT_READ_AHEAD_MAX; + } + if (era == VM_FAULT_READ_AHEAD_MAX) + vm_fault_dontneed(fs, fs->vaddr, nera); + } else { + /* +* This is a non-sequential fault. +*/ + nera = 0; + } + if (era != nera) { + /* +* A read lock on the map suffices to update +* the read ahead count safely. +*/ + fs->entry->read_ahead = nera; + } + + return (nera); +} + +/* * Wait/Retry if the page is busy. We have to do this if the page is * either exclusive or shared busy because the vm_pager may be using * read busy for pageouts (and even pageins if it is the vnode pager), @@ -725,7 +779,7 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fa vm_offset_t e_end, e_start; vm_pindex_t retry_pindex; vm_prot_t prot, retry_prot; - int ahead, alloc_req, behind, cluster_offset, era, faultcount; + int ahead, alloc_req, behind, cluster_offset, faultcount; int nera, oom, result, rv; u_char behavior; boolean_t wired;/* Passed by reference. */ @@ -737,6 +791,7 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fa return (KERN_PROTECTION_FAILURE); fs.vp = NULL; + fs.vaddr = vaddr; faultcount = 0; nera = -1; hardfault = false; @@ -989,45 +1044,7 @@ readrest: * apply to subsequent objects in the shadow chain. */ if (nera == -1 && !P_KILLED(curproc)) { - KASSERT(fs.lookup_still_valid, ("map unlocked")); - era = fs.entry->read_ahead; - behavior = vm_map_entry_behavior(fs.entry); - if (behavior == MAP_ENTRY_BEHAV_RANDOM) { - nera = 0; - } else if (behavior == MAP_ENTRY_BEHAV_SEQUENTIAL) { - nera = VM_FAULT_READ_AHEAD_MAX; - if (vaddr == fs.entry->next_read) - vm_fault_dontneed(&fs, vaddr, nera); - } else if (vaddr == fs.entry->next_read) { - /* -* This is a sequential fault. Arithmetically -* increase the requested number of pages in -* the read-ahead window. The requested -* number of pages is "# of sequential faults -* x (read ahead min + 1) + read ahead min" -*/ -
svn commit: r356935 - head/lib/libc/stdlib
Author: cem Date: Mon Jan 20 23:44:10 2020 New Revision: 356935 URL: https://svnweb.freebsd.org/changeset/base/356935 Log: random.3: Some minor improvements to wording/clarity Modified: head/lib/libc/stdlib/random.3 Modified: head/lib/libc/stdlib/random.3 == --- head/lib/libc/stdlib/random.3 Mon Jan 20 23:43:47 2020 (r356934) +++ head/lib/libc/stdlib/random.3 Mon Jan 20 23:44:10 2020 (r356935) @@ -28,7 +28,7 @@ .\" @(#)random.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 22, 2019 +.Dd January 20, 2020 .Dt RANDOM 3 .Os .Sh NAME @@ -60,7 +60,7 @@ Applications which require unpredictable random number instead. .Ef .Pp -The +Unless initialized with less than 32 bytes of state, the .Fn random function uses a non-linear additive feedback random number generator employing a @@ -72,53 +72,51 @@ The period of this random number generator is very lar .if t 16\(mu(2\u\s731\s10\d\(mi1). .if n 16*((2**31)\(mi1). .Pp +If initialized with less than 32 bytes of state, +.Fn random +uses the same poor-quality Park-Miller LCG as +.Xr rand 3 . +.Pp The .Fn random and .Fn srandom -functions have (almost) the same calling sequence and initialization properties as the +functions are analagous to .Xr rand 3 and -.Xr srand 3 -functions. +.Xr srand 3 . The difference is that .Xr rand 3 -produces a much less random sequence \(em in fact, the low dozen bits -generated by rand go through a cyclic pattern. -All the bits generated by -.Fn random -are usable. -For example, -.Sq Li random()&01 -will produce a random binary -value. +is a worse pseudo-random number generator. .Pp Like .Xr rand 3 , .Fn random -will by default produce a sequence of numbers that can be duplicated -by calling -.Fn srandom -with -.Ql 1 -as the seed. +is implicitly initialized as if +.Fn srandom "1" +had been invoked explicitly. .Pp The .Fn srandomdev -routine initializes a state array using -pseudo-random numbers obtained from the kernel. -Note that this particular seeding -procedure can generate states which are impossible to reproduce by -calling -.Fn srandom -with any value, since the succeeding terms in the -state buffer are no longer derived from the LC algorithm applied to -a fixed seed. +routine initializes the state array using random numbers obtained from the +kernel. +This can generate states which are impossible to reproduce by calling +.Fn srandom , +because the succeeding terms in the state buffer are no longer derived from the +Park-Miller LCG algorithm applied to a fixed seed. .Pp The .Fn initstate -routine allows a state array, passed in as an argument, to be initialized -for future use. +routine initializes the provided state array of +.Vt uint32_t +values and uses it in future +.Fn random +invocations. +(Despite the +.Vt char * +type of +.Fa state , +the underlying object must be a naturally aligned array of 32-bit values.) The size of the state array (in bytes) is used by .Fn initstate to decide how sophisticated a random number generator it should use \(em the @@ -127,26 +125,21 @@ more state, the better the random numbers will be. 8, 32, 64, 128, and 256 bytes; other amounts will be rounded down to the nearest known amount. Using less than 8 bytes will cause an error.) -The seed for the initialization (which specifies a starting point for -the random number sequence, and provides for restarting at the same -point) is also an argument. The +.Fa seed +is used as in +.Fn srandom . +The .Fn initstate function returns a pointer to the previous state information array. .Pp -Once a state has been initialized, the -.Fn setstate -routine provides for rapid switching between states. The .Fn setstate -function -returns a pointer to the previous state array; its -argument state array is used for further random number generation -until the next call to -.Fn initstate -or -.Fn setstate . +routine switches +.Fn random +to using the provided state. +It returns a pointer to the previous state. .Pp Once a state array has been initialized, it may be restarted at a different point either by calling ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356934 - head/lib/libc/stdlib
Author: cem Date: Mon Jan 20 23:43:47 2020 New Revision: 356934 URL: https://svnweb.freebsd.org/changeset/base/356934 Log: libc: Delete unused rand.c ifdef TEST code Modified: head/lib/libc/stdlib/rand.c Modified: head/lib/libc/stdlib/rand.c == --- head/lib/libc/stdlib/rand.c Mon Jan 20 22:49:52 2020(r356933) +++ head/lib/libc/stdlib/rand.c Mon Jan 20 23:43:47 2020(r356934) @@ -45,10 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" -#ifdef TEST -#include -#endif /* TEST */ - static int do_rand(unsigned long *ctx) { @@ -116,33 +112,3 @@ __sranddev_fbsd12(void) } } __sym_compat(sranddev, __sranddev_fbsd12, FBSD_1.0); - - -#ifdef TEST - -main() -{ -int i; -unsigned myseed; - -printf("seeding rand with 0x19610910: \n"); -srand(0x19610910); - -printf("generating three pseudo-random numbers:\n"); -for (i = 0; i < 3; i++) -{ - printf("next random number = %d\n", rand()); -} - -printf("generating the same sequence with rand_r:\n"); -myseed = 0x19610910; -for (i = 0; i < 3; i++) -{ - printf("next random number = %d\n", rand_r(&myseed)); -} - -return 0; -} - -#endif /* TEST */ - ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356933 - head/sys/vm
Author: jeff Date: Mon Jan 20 22:49:52 2020 New Revision: 356933 URL: https://svnweb.freebsd.org/changeset/base/356933 Log: Reduce object locking in vm_fault. Once we have an exclusively busied page we no longer need an object lock. This reduces the longest hold times and eliminates some trylock code blocks. Reviewed by: kib, markj Differential Revision:https://reviews.freebsd.org/D23034 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c == --- head/sys/vm/vm_fault.c Mon Jan 20 22:15:33 2020(r356932) +++ head/sys/vm/vm_fault.c Mon Jan 20 22:49:52 2020(r356933) @@ -342,10 +342,10 @@ vm_fault_soft_fast(struct faultstate *fs, vm_offset_t *m_hold = m; vm_page_wire(m); } - vm_fault_dirty(fs->entry, m, prot, fault_type, fault_flags); if (psind == 0 && !wired) vm_fault_prefault(fs, vaddr, PFBAK, PFFOR, true); VM_OBJECT_RUNLOCK(fs->first_object); + vm_fault_dirty(fs->entry, m, prot, fault_type, fault_flags); vm_map_lookup_done(fs->map, fs->entry); curthread->td_ru.ru_minflt++; @@ -632,7 +632,7 @@ vm_fault_trap(vm_map_t map, vm_offset_t vaddr, vm_prot } static int -vm_fault_lock_vnode(struct faultstate *fs) +vm_fault_lock_vnode(struct faultstate *fs, bool objlocked) { struct vnode *vp; int error, locked; @@ -668,7 +668,10 @@ vm_fault_lock_vnode(struct faultstate *fs) } vhold(vp); - unlock_and_deallocate(fs); + if (objlocked) + unlock_and_deallocate(fs); + else + fault_deallocate(fs); error = vget(vp, locked | LK_RETRY | LK_CANRECURSE, curthread); vdrop(vp); fs->vp = vp; @@ -863,9 +866,11 @@ RetryFault_oom: */ if (!vm_page_all_valid(fs.m)) goto readrest; - break; /* break to PAGE HAS BEEN FOUND */ + VM_OBJECT_WUNLOCK(fs.object); + break; /* break to PAGE HAS BEEN FOUND. */ } KASSERT(fs.m == NULL, ("fs.m should be NULL, not %p", fs.m)); + VM_OBJECT_ASSERT_WLOCKED(fs.object); /* * Page is not resident. If the pager might contain the page @@ -876,7 +881,7 @@ RetryFault_oom: if (fs.object->type != OBJT_DEFAULT || fs.object == fs.first_object) { if ((fs.object->flags & OBJ_SIZEVNLOCK) != 0) { - rv = vm_fault_lock_vnode(&fs); + rv = vm_fault_lock_vnode(&fs, true); MPASS(rv == KERN_SUCCESS || rv == KERN_RESOURCE_SHORTAGE); if (rv == KERN_RESOURCE_SHORTAGE) @@ -956,12 +961,23 @@ RetryFault_oom: readrest: /* +* Default objects have no pager so no exclusive busy exists +* to protect this page in the chain. Skip to the next +* object without dropping the lock to preserve atomicity of +* shadow faults. +*/ + if (fs.object->type == OBJT_DEFAULT) + goto next; + + /* * At this point, we have either allocated a new page or found * an existing page that is only partially valid. * * We hold a reference on the current object and the page is -* exclusive busied. +* exclusive busied. The exclusive busy prevents simultaneous +* faults and collapses while the object lock is dropped. */ + VM_OBJECT_WUNLOCK(fs.object); /* * If the pager for the current object might have the page, @@ -972,8 +988,7 @@ readrest: * have the page, the number of additional pages to read will * apply to subsequent objects in the shadow chain. */ - if (fs.object->type != OBJT_DEFAULT && nera == -1 && - !P_KILLED(curproc)) { + if (nera == -1 && !P_KILLED(curproc)) { KASSERT(fs.lookup_still_valid, ("map unlocked")); era = fs.entry->read_ahead; behavior = vm_map_entry_behavior(fs.entry); @@ -1039,7 +1054,7 @@ readrest: */ unlock_map(&fs); - rv = vm_fault_lock_vnode(&fs); + rv = vm_fault_lock_vnode(&fs, false); MPASS(rv == KERN_SUCCESS || rv == KERN_RESOURCE_SHORTAGE); if (rv == KERN_RESOURCE_SHORTAGE) @@ -1080,15 +10
svn commit: r356930 - in head/contrib/llvm-project: clang compiler-rt libcxx libunwind lld lldb llvm openmp
Author: dim Date: Mon Jan 20 20:26:04 2020 New Revision: 356930 URL: https://svnweb.freebsd.org/changeset/base/356930 Log: Add more Subversion mergeinfo bootstrap information, to hopefully increase the probability of merging in vendor changes. Modified: Directory Properties: head/contrib/llvm-project/clang/ (props changed) head/contrib/llvm-project/compiler-rt/ (props changed) head/contrib/llvm-project/libcxx/ (props changed) head/contrib/llvm-project/libunwind/ (props changed) head/contrib/llvm-project/lld/ (props changed) head/contrib/llvm-project/lldb/ (props changed) head/contrib/llvm-project/llvm/ (props changed) head/contrib/llvm-project/openmp/ (props changed) ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356929 - in head/contrib/llvm-project: clang/lib/Basic/Targets clang/lib/Driver/ToolChains/Arch llvm/include/llvm/ADT llvm/lib/Support llvm/lib/Target/PowerPC
Author: dim Date: Mon Jan 20 20:10:28 2020 New Revision: 356929 URL: https://svnweb.freebsd.org/changeset/base/356929 Log: Merge commit bc4bc5aa0 from llvm git (by Justin Hibbits): Add 8548 CPU definition and attributes 8548 CPU is GCC's name for the e500v2, so accept this in clang. The e500v2 doesn't support lwsync, so define __NO_LWSYNC__ for this as well, as GCC does. Differential Revision: https://reviews.llvm.org/D67787 Merge commit ff0311c4b from llvm git (by Justin Hibbits): [PowerPC]: Add powerpcspe target triple subarch component Summary: This allows the use of '-target powerpcspe-unknown-linux-gnu' or 'powerpcspe-unknown-freebsd' to be used, instead of '-target powerpc-unknown-linux-gnu -mspe'. Reviewed By: dim Differential Revision: https://reviews.llvm.org/D72014 Merge commit ba91dffaf from llvm git (by Fangrui Song): [Driver][PowerPC] Move powerpcspe logic from cc1 to Driver Follow-up of D72014. It is more appropriate to use a target feature instead of a SubTypeArch to express the difference. Reviewed By: #powerpc, jhibbits Differential Revision: https://reviews.llvm.org/D72433 commit 36eedfcb3 from llvm git (by Justin Hibbits): [PowerPC] Fix powerpcspe subtarget enablement in llvm backend Summary: As currently written, -target powerpcspe will enable SPE regardless of disabling the feature later on in the command line. Instead, change this to just set a default CPU to 'e500' instead of a generic CPU. As part of this, add FeatureSPE to the e500 definition. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D72673 These are needed to unbreak the build for powerpcspe. Requested by: jhibbits MFC after:1 week Modified: head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/PPC.cpp head/contrib/llvm-project/llvm/include/llvm/ADT/Triple.h head/contrib/llvm-project/llvm/lib/Support/Triple.cpp head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPC.td head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCSubtarget.cpp Modified: head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp == --- head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp Mon Jan 20 19:56:22 2020(r356928) +++ head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp Mon Jan 20 20:10:28 2020(r356929) @@ -157,6 +157,8 @@ void PPCTargetInfo::getTargetDefines(const LangOptions Builder.defineMacro("_ARCH_A2Q"); Builder.defineMacro("_ARCH_QP"); } + if (ArchDefs & ArchDefineE500) +Builder.defineMacro("__NO_LWSYNC__"); if (getTriple().getVendor() == llvm::Triple::BGQ) { Builder.defineMacro("__bg__"); @@ -312,6 +314,11 @@ bool PPCTargetInfo::initFeatureMap( .Case("pwr8", true) .Default(false); + Features["spe"] = llvm::StringSwitch(CPU) +.Case("8548", true) +.Case("e500", true) +.Default(false); + if (!ppcUserFeaturesCheck(Diags, FeaturesVec)) return false; @@ -449,16 +456,16 @@ ArrayRef PPCTargetInfo::getGC } static constexpr llvm::StringLiteral ValidCPUNames[] = { -{"generic"}, {"440"}, {"450"}, {"601"},{"602"}, -{"603"}, {"603e"},{"603ev"}, {"604"},{"604e"}, -{"620"}, {"630"}, {"g3"}, {"7400"}, {"g4"}, -{"7450"},{"g4+"}, {"750"}, {"970"},{"g5"}, -{"a2"}, {"a2q"}, {"e500mc"}, {"e5500"}, {"power3"}, -{"pwr3"},{"power4"}, {"pwr4"},{"power5"}, {"pwr5"}, -{"power5x"}, {"pwr5x"}, {"power6"}, {"pwr6"}, {"power6x"}, -{"pwr6x"}, {"power7"}, {"pwr7"},{"power8"}, {"pwr8"}, -{"power9"}, {"pwr9"},{"powerpc"}, {"ppc"},{"powerpc64"}, -{"ppc64"}, {"powerpc64le"}, {"ppc64le"}, +{"generic"}, {"440"}, {"450"}, {"601"}, {"602"}, +{"603"}, {"603e"}, {"603ev"}, {"604"}, {"604e"}, +{"620"}, {"630"}, {"g3"}, {"7400"},{"g4"}, +{"7450"}, {"g4+"}, {"750"}, {"8548"},{"970"}, +{"g5"},{"a2"},{"a2q"}, {"e500"},{"e500mc"}, +{"e5500"}, {"power3"},{"pwr3"},{"power4"}, {"pwr4"}, +{"power5"},{"pwr5"}, {"power5x"}, {"pwr5x"}, {"power6"}, +{"pwr6"}, {"power6x"}, {"pwr6x"}, {"power7"}, {"pwr7"}, +{"power8"},{"pwr8"}, {"power9"}, {"pwr9"}, {"powerpc"}, +{"ppc"}, {"powerpc64"}, {"ppc64"}, {"powerpc64le"}, {"ppc64le"}, }; bool PPCTargetInfo::i
svn commit: r356928 - head/tools/build/mk
Author: oshogbo Date: Mon Jan 20 19:56:22 2020 New Revision: 356928 URL: https://svnweb.freebsd.org/changeset/base/356928 Log: When MK_CASPER=no is set remove files which are not needed to run system. PR: 242971 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc == --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jan 20 19:52:23 2020(r356927) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jan 20 19:56:22 2020(r356928) @@ -1141,6 +1141,15 @@ OLD_DIRS+=usr/tests/usr.bin/calendar .endif .if ${MK_CASPER} == no +OLD_LIBS+=lib/libcasper.so.1 +OLD_LIBS+=lib/casper/libcap_dns.so.2 +OLD_LIBS+=lib/casper/libcap_fileargs.so.1 +OLD_LIBS+=lib/casper/libcap_grp.so.1 +OLD_LIBS+=lib/casper/libcap_net.so.1 +OLD_LIBS+=lib/casper/libcap_pwd.so.1 +OLD_LIBS+=lib/casper/libcap_sysctl.so.1 +OLD_LIBS+=lib/casper/libcap_sysctl.so.2 +OLD_LIBS+=lib/casper/libcap_syslog.so.1 .endif .if ${MK_CCD} == no ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356926 - head/tools/build/mk
Author: oshogbo Date: Mon Jan 20 19:51:53 2020 New Revision: 356926 URL: https://svnweb.freebsd.org/changeset/base/356926 Log: Even when the MK_CASPER is set to "no" we still want to install man pages and the headers. If the user decides to install the system without Casper support, then the Casper functions are mocked, but they still exist in the system. PR: 242971 MFC after:2 weeks Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc == --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jan 20 19:47:58 2020(r356925) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jan 20 19:51:53 2020(r356926) @@ -1141,19 +1141,6 @@ OLD_DIRS+=usr/tests/usr.bin/calendar .endif .if ${MK_CASPER} == no -OLD_FILES+=usr/include/libcasper.h -OLD_FILES+=usr/share/man/man3/cap_clone.3.gz -OLD_FILES+=usr/share/man/man3/cap_close.3.gz -OLD_FILES+=usr/share/man/man3/cap_init.3.gz -OLD_FILES+=usr/share/man/man3/cap_limit_get.3.gz -OLD_FILES+=usr/share/man/man3/cap_limit_set.3.gz -OLD_FILES+=usr/share/man/man3/cap_recv_nvlist.3.gz -OLD_FILES+=usr/share/man/man3/cap_send_nvlist.3.gz -OLD_FILES+=usr/share/man/man3/cap_service_open.3.gz -OLD_FILES+=usr/share/man/man3/cap_sock.3.gz -OLD_FILES+=usr/share/man/man3/cap_unwrap.3.gz -OLD_FILES+=usr/share/man/man3/cap_wrap.3.gz -OLD_FILES+=usr/share/man/man3/cap_xfer_nvlist.3.gz .endif .if ${MK_CCD} == no ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356927 - head/sys/kern
Author: mjg Date: Mon Jan 20 19:52:23 2020 New Revision: 356927 URL: https://svnweb.freebsd.org/changeset/base/356927 Log: cache: revert r352613 now that vhold does not take locks Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c == --- head/sys/kern/vfs_cache.c Mon Jan 20 19:51:53 2020(r356926) +++ head/sys/kern/vfs_cache.c Mon Jan 20 19:52:23 2020(r356927) @@ -1701,7 +1701,6 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, uint32_t hash; int flag; int len; - bool held_dvp; u_long lnumcache; CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr); @@ -1738,13 +1737,6 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, ndd = NULL; ncp_ts = NULL; - held_dvp = false; - if (LIST_EMPTY(&dvp->v_cache_src) && flag != NCF_ISDOTDOT) { - vhold(dvp); - counter_u64_add(numcachehv, 1); - held_dvp = true; - } - /* * Calculate the hash key and setup as much of the new * namecache entry as possible before acquiring the lock. @@ -1834,21 +1826,8 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, if (flag != NCF_ISDOTDOT) { if (LIST_EMPTY(&dvp->v_cache_src)) { - if (!held_dvp) { - vhold(dvp); - counter_u64_add(numcachehv, 1); - } - } else { - if (held_dvp) { - /* -* This will not take the interlock as someone -* else already holds the vnode on account of -* the namecache and we hold locks preventing -* this from changing. -*/ - vdrop(dvp); - counter_u64_add(numcachehv, -1); - } + vhold(dvp); + counter_u64_add(numcachehv, 1); } LIST_INSERT_HEAD(&dvp->v_cache_src, ncp, nc_src); } @@ -1883,10 +1862,6 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, out_unlock_free: cache_enter_unlock(&cel); cache_free(ncp); - if (held_dvp) { - vdrop(dvp); - counter_u64_add(numcachehv, -1); - } return; } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356925 - head/tools/build/mk
Author: oshogbo Date: Mon Jan 20 19:47:58 2020 New Revision: 356925 URL: https://svnweb.freebsd.org/changeset/base/356925 Log: Those files are already removed in ObsoleteFiles.\ There is no need to remove them twice. PR: 242971 MFC after:2 weeks Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc == --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jan 20 19:38:29 2020(r356924) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jan 20 19:47:58 2020(r356925) @@ -1141,44 +1141,7 @@ OLD_DIRS+=usr/tests/usr.bin/calendar .endif .if ${MK_CASPER} == no -OLD_FILES+=etc/casper/system.dns -OLD_FILES+=etc/casper/system.grp -OLD_FILES+=etc/casper/system.pwd -OLD_FILES+=etc/casper/system.random -OLD_FILES+=etc/casper/system.sysctl -OLD_DIRS+=etc/casper -OLD_FILES+=etc/rc.d/casperd -OLD_LIBS+=lib/libcapsicum.so.0 -OLD_LIBS+=lib/libcasper.so.0 -OLD_FILES+=libexec/casper/dns -OLD_FILES+=libexec/casper/grp -OLD_FILES+=libexec/casper/pwd -OLD_FILES+=libexec/casper/random -OLD_FILES+=libexec/casper/sysctl -OLD_FILES+=sbin/casper -OLD_FILES+=sbin/casperd -OLD_FILES+=usr/include/libcapsicum.h -OLD_FILES+=usr/include/libcapsicum_dns.h -OLD_FILES+=usr/include/libcapsicum_grp.h -OLD_FILES+=usr/include/libcapsicum_pwd.h -OLD_FILES+=usr/include/libcapsicum_random.h -OLD_FILES+=usr/include/libcapsicum_service.h -OLD_FILES+=usr/include/libcapsicum_sysctl.h OLD_FILES+=usr/include/libcasper.h -OLD_FILES+=usr/lib/libcapsicum.a -OLD_FILES+=usr/lib/libcapsicum.so -OLD_FILES+=usr/lib/libcapsicum_p.a -OLD_FILES+=usr/lib/libcasper.a -OLD_FILES+=usr/lib/libcasper.so -OLD_FILES+=usr/lib/libcasper_p.a -OLD_FILES+=usr/lib32/libcapsicum.a -OLD_FILES+=usr/lib32/libcapsicum.so -OLD_LIBS+=usr/lib32/libcapsicum.so.0 -OLD_FILES+=usr/lib32/libcapsicum_p.a -OLD_FILES+=usr/lib32/libcasper.a -OLD_FILES+=usr/lib32/libcasper.so -OLD_LIBS+=usr/lib32/libcasper.so.0 -OLD_FILES+=usr/lib32/libcasper_p.a OLD_FILES+=usr/share/man/man3/cap_clone.3.gz OLD_FILES+=usr/share/man/man3/cap_close.3.gz OLD_FILES+=usr/share/man/man3/cap_init.3.gz @@ -1191,8 +1154,6 @@ OLD_FILES+=usr/share/man/man3/cap_sock.3.gz OLD_FILES+=usr/share/man/man3/cap_unwrap.3.gz OLD_FILES+=usr/share/man/man3/cap_wrap.3.gz OLD_FILES+=usr/share/man/man3/cap_xfer_nvlist.3.gz -OLD_FILES+=usr/share/man/man3/libcapsicum.3.gz -OLD_FILES+=usr/share/man/man8/casperd.8.gz .endif .if ${MK_CCD} == no ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356924 - head/share/misc
Author: mikael (ports committer) Date: Mon Jan 20 19:38:29 2020 New Revision: 356924 URL: https://svnweb.freebsd.org/changeset/base/356924 Log: Add myself (mikael) as a ports committer Approved by: manu (mentor) Differential Revision:https://reviews.freebsd.org/D23227 Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot == --- head/share/misc/committers-ports.dotMon Jan 20 18:54:19 2020 (r356923) +++ head/share/misc/committers-ports.dotMon Jan 20 19:38:29 2020 (r356924) @@ -193,6 +193,7 @@ meta [label="Koichiro Iwao\nm...@freebsd.org\n2018/03/ mezz [label="Jeremy Messenger\nm...@freebsd.org\n2004/04/30"] mfechner [label="Matthias Fechner\nmfech...@freebsd.org\n2018/03/01"] mharo [label="Michael Haro\nmh...@freebsd.org\n1999/04/13"] +mikael [label="Mikael Urankar\nmik...@freebsd.org\n2020/01/16"] milki [label="Jonathan Chu\nmi...@freebsd.org\n2013/12/15"] misha [label="Mikhail Pchelin\nmi...@freebsd.org\n2016/11/15"] miwi [label="Martin Wilke\nm...@freebsd.org\n2006/06/04"] @@ -539,6 +540,8 @@ lwhsu -> yzlin maho -> stephen maho -> tota + +manu -> mikael marcus -> ahze marcus -> bland ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356922 - head/lib/libc/stdlib
Author: cem Date: Mon Jan 20 18:43:10 2020 New Revision: 356922 URL: https://svnweb.freebsd.org/changeset/base/356922 Log: qsort.3: Bump Dd and note that Annex K is optional Modified: head/lib/libc/stdlib/qsort.3 Modified: head/lib/libc/stdlib/qsort.3 == --- head/lib/libc/stdlib/qsort.3Mon Jan 20 18:21:55 2020 (r356921) +++ head/lib/libc/stdlib/qsort.3Mon Jan 20 18:43:10 2020 (r356922) @@ -32,7 +32,7 @@ .\" @(#)qsort.38.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 14, 2020 +.Dd January 20, 2020 .Dt QSORT 3 .Os .Sh NAME @@ -342,6 +342,13 @@ to replace with .Fn qsort_s to work around this problem. +.Pp +.Fn qsort_s +is part of the +.Em optional +Annex K portion of +.St -isoC-2011 +and may not be portable to other standards-conforming platforms. .Pp Previous versions of .Fn qsort ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356919 - head/sys/x86/x86
Author: kib Date: Mon Jan 20 17:23:03 2020 New Revision: 356919 URL: https://svnweb.freebsd.org/changeset/base/356919 Log: x86: Wait for curthread to be set up as an indicator that the boot stack is no longer used. pc_curthread is set by cpu_switch after it stopped using the old thread (or boot) stack. This makes the smp_after_idle_runnable() function not dependent on the internals of the scheduler operations. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after:1 week Differential revision:https://reviews.freebsd.org/D23276 Modified: head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/x86/mp_x86.c == --- head/sys/x86/x86/mp_x86.c Mon Jan 20 16:59:39 2020(r356918) +++ head/sys/x86/x86/mp_x86.c Mon Jan 20 17:23:03 2020(r356919) @@ -1092,13 +1092,12 @@ init_secondary_tail(void) static void smp_after_idle_runnable(void *arg __unused) { - struct thread *idle_td; + struct pcpu *pc; int cpu; for (cpu = 1; cpu < mp_ncpus; cpu++) { - idle_td = pcpu_find(cpu)->pc_idlethread; - while (atomic_load_int(&idle_td->td_lastcpu) == NOCPU && - atomic_load_int(&idle_td->td_oncpu) == NOCPU) + pc = pcpu_find(cpu); + while (atomic_load_ptr(&pc->pc_curthread) == (uintptr_t)NULL) cpu_spinwait(); kmem_free((vm_offset_t)bootstacks[cpu], kstack_pages * PAGE_SIZE); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356918 - head/share/man/man7
Author: bapt Date: Mon Jan 20 16:59:39 2020 New Revision: 356918 URL: https://svnweb.freebsd.org/changeset/base/356918 Log: The ports tree now accepts /usr/local/share/man as a directory for manpage and will slowly transition from /usr/local/man to it. To reflect this remove the documentation of the manpages being an exception in the layout of /usr/local Reported by: Dan Nelson (via IRC) MFC after:3 days Modified: head/share/man/man7/hier.7 Modified: head/share/man/man7/hier.7 == --- head/share/man/man7/hier.7 Mon Jan 20 15:38:05 2020(r356917) +++ head/share/man/man7/hier.7 Mon Jan 20 16:59:39 2020(r356918) @@ -28,7 +28,7 @@ .\"@(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd September 10, 2019 +.Dd January 20, 2020 .Dt HIER 7 .Os .Sh NAME @@ -420,12 +420,6 @@ for .Pa /usr should be used. Exceptions are the -.Pa man -directory -.Po directly under -.Pa local/ -rather than under -.Pa local/share/ Ns Pc , ports documentation .Po in .Pa share/doc// Ns Pc , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r356915 - head/sys/kern
On Mon, Jan 20, 2020 at 02:42:11PM +, Mateusz Guzik wrote: > Author: mjg > Date: Mon Jan 20 14:42:11 2020 > New Revision: 356915 > URL: https://svnweb.freebsd.org/changeset/base/356915 > > Log: > cache: make numcachehv use counter(9) on all archs > > Requested by: kib Thank you. > > Modified: > head/sys/kern/vfs_cache.c > > Modified: head/sys/kern/vfs_cache.c > == > --- head/sys/kern/vfs_cache.c Mon Jan 20 13:46:09 2020(r356914) > +++ head/sys/kern/vfs_cache.c Mon Jan 20 14:42:11 2020(r356915) > @@ -340,16 +340,6 @@ SYSCTL_INT(_debug_sizeof, OID_AUTO, namecache, CTLFLAG > sizeof(struct namecache), "sizeof(struct namecache)"); > > /* > - * Use counter(9) for numcachehv if the machine is 64-bit. > - * > - * Stick to an atomic for the rest since there is no long-sized equivalent > and > - * 64-bit size is both way more than needed and a pessimization. > - */ > -#ifdef __LP64__ > -#define CACHE_NUMCACHEHV_U64 > -#endif > - > -/* > * The new name cache statistics > */ > static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW, 0, > @@ -361,12 +351,7 @@ static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW, > SYSCTL_COUNTER_U64(_vfs_cache, OID_AUTO, name, CTLFLAG_RD, &name, > descr); > STATNODE_ULONG(numneg, "Number of negative cache entries"); > STATNODE_ULONG(numcache, "Number of cache entries"); > -#ifdef CACHE_NUMCACHEHV_U64 > STATNODE_COUNTER(numcachehv, "Number of namecache entries with vnodes held"); > -#else > -static u_long __exclusive_cache_line numcachehv;/* number of cache entries > with vnodes held */ > -STATNODE_ULONG(numcachehv, "Number of namecache entries with vnodes held"); > -#endif > STATNODE_COUNTER(numcalls, "Number of cache lookups"); > STATNODE_COUNTER(dothits, "Number of '.' hits"); > STATNODE_COUNTER(dotdothits, "Number of '..' hits"); > @@ -407,36 +392,6 @@ static int vn_fullpath1(struct thread *td, struct vnod > > static MALLOC_DEFINE(M_VFSCACHE, "vfscache", "VFS name cache entries"); > > -#ifdef CACHE_NUMCACHEHV_U64 > -static void > -cache_numcachehv_inc(void) > -{ > - > - counter_u64_add(numcachehv, 1); > -} > - > -static void > -cache_numcachehv_dec(void) > -{ > - > - counter_u64_add(numcachehv, -1); > -} > -#else > -static void > -cache_numcachehv_inc(void) > -{ > - > - atomic_add_long(&numcachehv, 1); > -} > - > -static void > -cache_numcachehv_dec(void) > -{ > - > - atomic_subtract_long(&numcachehv, 1); > -} > -#endif > - > static int cache_yield; > SYSCTL_INT(_vfs_cache, OID_AUTO, yield, CTLFLAG_RD, &cache_yield, 0, > "Number of times cache called yield"); > @@ -917,7 +872,7 @@ cache_zap_locked(struct namecache *ncp, bool neg_locke > LIST_REMOVE(ncp, nc_src); > if (LIST_EMPTY(&ncp->nc_dvp->v_cache_src)) { > ncp->nc_flag |= NCF_DVDROP; > - cache_numcachehv_dec(); > + counter_u64_add(numcachehv, -1); > } > } > atomic_subtract_rel_long(&numcache, 1); > @@ -1786,7 +1741,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, > held_dvp = false; > if (LIST_EMPTY(&dvp->v_cache_src) && flag != NCF_ISDOTDOT) { > vhold(dvp); > - cache_numcachehv_inc(); > + counter_u64_add(numcachehv, 1); > held_dvp = true; > } > > @@ -1881,7 +1836,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, > if (LIST_EMPTY(&dvp->v_cache_src)) { > if (!held_dvp) { > vhold(dvp); > - cache_numcachehv_inc(); > + counter_u64_add(numcachehv, 1); > } > } else { > if (held_dvp) { > @@ -1892,7 +1847,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, >* this from changing. >*/ > vdrop(dvp); > - cache_numcachehv_dec(); > + counter_u64_add(numcachehv, -1); > } > } > LIST_INSERT_HEAD(&dvp->v_cache_src, ncp, nc_src); > @@ -1930,7 +1885,7 @@ out_unlock_free: > cache_free(ncp); > if (held_dvp) { > vdrop(dvp); > - cache_numcachehv_dec(); > + counter_u64_add(numcachehv, -1); > } > return; > } > @@ -2001,9 +1956,7 @@ nchinit(void *dummy __unused) > > mtx_init(&ncneg_shrink_lock, "ncnegs", NULL, MTX_DEF); > > -#ifdef CACHE_NUMCACHEHV_U64 > numcachehv = counter_u64_alloc(M_WAITOK); > -#endif > numcalls = counter_u64_alloc(M_WAITOK); > dothits = counter_u64_alloc(M_WAITOK); > dotdothits = counter_u64_alloc(M_WAITOK); ___ svn-src-head@freebsd.org mailing
svn commit: r356916 - head/tools/build/options
Author: emaste Date: Mon Jan 20 15:19:56 2020 New Revision: 356916 URL: https://svnweb.freebsd.org/changeset/base/356916 Log: remove unused WITHOUT_PC_SYSINSTALL description pc-sysinstall was moved from the base system to ports in r351781. Submitted by: driesm.michiels gmail com Differential Revision:https://reviews.freebsd.org/D21647 Deleted: head/tools/build/options/WITHOUT_PC_SYSINSTALL ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356915 - head/sys/kern
Author: mjg Date: Mon Jan 20 14:42:11 2020 New Revision: 356915 URL: https://svnweb.freebsd.org/changeset/base/356915 Log: cache: make numcachehv use counter(9) on all archs Requested by: kib Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c == --- head/sys/kern/vfs_cache.c Mon Jan 20 13:46:09 2020(r356914) +++ head/sys/kern/vfs_cache.c Mon Jan 20 14:42:11 2020(r356915) @@ -340,16 +340,6 @@ SYSCTL_INT(_debug_sizeof, OID_AUTO, namecache, CTLFLAG sizeof(struct namecache), "sizeof(struct namecache)"); /* - * Use counter(9) for numcachehv if the machine is 64-bit. - * - * Stick to an atomic for the rest since there is no long-sized equivalent and - * 64-bit size is both way more than needed and a pessimization. - */ -#ifdef __LP64__ -#define CACHE_NUMCACHEHV_U64 -#endif - -/* * The new name cache statistics */ static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW, 0, @@ -361,12 +351,7 @@ static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW, SYSCTL_COUNTER_U64(_vfs_cache, OID_AUTO, name, CTLFLAG_RD, &name, descr); STATNODE_ULONG(numneg, "Number of negative cache entries"); STATNODE_ULONG(numcache, "Number of cache entries"); -#ifdef CACHE_NUMCACHEHV_U64 STATNODE_COUNTER(numcachehv, "Number of namecache entries with vnodes held"); -#else -static u_long __exclusive_cache_line numcachehv;/* number of cache entries with vnodes held */ -STATNODE_ULONG(numcachehv, "Number of namecache entries with vnodes held"); -#endif STATNODE_COUNTER(numcalls, "Number of cache lookups"); STATNODE_COUNTER(dothits, "Number of '.' hits"); STATNODE_COUNTER(dotdothits, "Number of '..' hits"); @@ -407,36 +392,6 @@ static int vn_fullpath1(struct thread *td, struct vnod static MALLOC_DEFINE(M_VFSCACHE, "vfscache", "VFS name cache entries"); -#ifdef CACHE_NUMCACHEHV_U64 -static void -cache_numcachehv_inc(void) -{ - - counter_u64_add(numcachehv, 1); -} - -static void -cache_numcachehv_dec(void) -{ - - counter_u64_add(numcachehv, -1); -} -#else -static void -cache_numcachehv_inc(void) -{ - - atomic_add_long(&numcachehv, 1); -} - -static void -cache_numcachehv_dec(void) -{ - - atomic_subtract_long(&numcachehv, 1); -} -#endif - static int cache_yield; SYSCTL_INT(_vfs_cache, OID_AUTO, yield, CTLFLAG_RD, &cache_yield, 0, "Number of times cache called yield"); @@ -917,7 +872,7 @@ cache_zap_locked(struct namecache *ncp, bool neg_locke LIST_REMOVE(ncp, nc_src); if (LIST_EMPTY(&ncp->nc_dvp->v_cache_src)) { ncp->nc_flag |= NCF_DVDROP; - cache_numcachehv_dec(); + counter_u64_add(numcachehv, -1); } } atomic_subtract_rel_long(&numcache, 1); @@ -1786,7 +1741,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, held_dvp = false; if (LIST_EMPTY(&dvp->v_cache_src) && flag != NCF_ISDOTDOT) { vhold(dvp); - cache_numcachehv_inc(); + counter_u64_add(numcachehv, 1); held_dvp = true; } @@ -1881,7 +1836,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, if (LIST_EMPTY(&dvp->v_cache_src)) { if (!held_dvp) { vhold(dvp); - cache_numcachehv_inc(); + counter_u64_add(numcachehv, 1); } } else { if (held_dvp) { @@ -1892,7 +1847,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, * this from changing. */ vdrop(dvp); - cache_numcachehv_dec(); + counter_u64_add(numcachehv, -1); } } LIST_INSERT_HEAD(&dvp->v_cache_src, ncp, nc_src); @@ -1930,7 +1885,7 @@ out_unlock_free: cache_free(ncp); if (held_dvp) { vdrop(dvp); - cache_numcachehv_dec(); + counter_u64_add(numcachehv, -1); } return; } @@ -2001,9 +1956,7 @@ nchinit(void *dummy __unused) mtx_init(&ncneg_shrink_lock, "ncnegs", NULL, MTX_DEF); -#ifdef CACHE_NUMCACHEHV_U64 numcachehv = counter_u64_alloc(M_WAITOK); -#endif numcalls = counter_u64_alloc(M_WAITOK); dothits = counter_u64_alloc(M_WAITOK); dotdothits = counter_u64_alloc(M_WAITOK); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356913 - head/sys/dev/e1000
Author: gnn Date: Mon Jan 20 12:53:02 2020 New Revision: 356913 URL: https://svnweb.freebsd.org/changeset/base/356913 Log: Add support for latest Intel I219 device, supported in Lenovo Carbon X1 v7 MFC after:2 weeks Modified: head/sys/dev/e1000/e1000_api.c head/sys/dev/e1000/e1000_hw.h head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/e1000_api.c == --- head/sys/dev/e1000/e1000_api.c Mon Jan 20 12:16:32 2020 (r356912) +++ head/sys/dev/e1000/e1000_api.c Mon Jan 20 12:53:02 2020 (r356913) @@ -319,6 +319,7 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_PCH_ICP_I219_V8: case E1000_DEV_ID_PCH_ICP_I219_LM9: case E1000_DEV_ID_PCH_ICP_I219_V9: + case E1000_DEV_ID_PCH_ICP_I219_V10: mac->type = e1000_pch_cnp; break; case E1000_DEV_ID_82575EB_COPPER: Modified: head/sys/dev/e1000/e1000_hw.h == --- head/sys/dev/e1000/e1000_hw.h Mon Jan 20 12:16:32 2020 (r356912) +++ head/sys/dev/e1000/e1000_hw.h Mon Jan 20 12:53:02 2020 (r356913) @@ -155,6 +155,7 @@ struct e1000_hw; #define E1000_DEV_ID_PCH_ICP_I219_V8 0x15E0 #define E1000_DEV_ID_PCH_ICP_I219_LM9 0x15E1 #define E1000_DEV_ID_PCH_ICP_I219_V9 0x15E2 +#define E1000_DEV_ID_PCH_ICP_I219_V10 0x0D4F #define E1000_DEV_ID_82576 0x10C9 #define E1000_DEV_ID_82576_FIBER 0x10E6 #define E1000_DEV_ID_82576_SERDES 0x10E7 Modified: head/sys/dev/e1000/if_em.c == --- head/sys/dev/e1000/if_em.c Mon Jan 20 12:16:32 2020(r356912) +++ head/sys/dev/e1000/if_em.c Mon Jan 20 12:53:02 2020(r356913) @@ -174,6 +174,7 @@ static pci_vendor_info_t em_vendor_info_array[] = PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V8, "Intel(R) PRO/1000 Network Connection"), PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_LM9, "Intel(R) PRO/1000 Network Connection"), PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V9, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V10, "Intel(R) PRO/1000 Network Connection"), /* required last entry */ PVID_END }; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356912 - head/sys/compat/linux
Author: trasz Date: Mon Jan 20 12:16:32 2020 New Revision: 356912 URL: https://svnweb.freebsd.org/changeset/base/356912 Log: Properly translate MNT_FORCE flag to Linux umount2(2). Previously it worked by accident. MFC after:2 weeks Sponsored by: DARPA Modified: head/sys/compat/linux/linux_file.c head/sys/compat/linux/linux_file.h Modified: head/sys/compat/linux/linux_file.c == --- head/sys/compat/linux/linux_file.c Mon Jan 20 11:54:00 2020 (r356911) +++ head/sys/compat/linux/linux_file.c Mon Jan 20 12:16:32 2020 (r356912) @@ -1078,9 +1078,14 @@ int linux_umount(struct thread *td, struct linux_umount_args *args) { struct unmount_args bsd; + int flags; + flags = 0; + if ((args->flags & LINUX_MNT_FORCE) != 0) + flags |= MNT_FORCE; + bsd.path = args->path; - bsd.flags = args->flags;/* XXX correct? */ + bsd.flags = flags; return (sys_unmount(td, &bsd)); } #endif Modified: head/sys/compat/linux/linux_file.h == --- head/sys/compat/linux/linux_file.h Mon Jan 20 11:54:00 2020 (r356911) +++ head/sys/compat/linux/linux_file.h Mon Jan 20 12:16:32 2020 (r356912) @@ -57,6 +57,11 @@ #defineLINUX_MS_REMOUNT0x0020 /* + * umount2 flags + */ +#defineLINUX_MNT_FORCE 0x0001 + +/* * common open/fcntl flags */ #defineLINUX_O_RDONLY ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356910 - head/lib/libc/tests/stdlib
Author: trasz Date: Mon Jan 20 11:45:18 2020 New Revision: 356910 URL: https://svnweb.freebsd.org/changeset/base/356910 Log: Add qsort_r(3) regression test. MFC after:2 weeks Sponsored by: DARPA Differential Revision:https://reviews.freebsd.org/D23206 Added: head/lib/libc/tests/stdlib/qsort_r_test.c (contents, props changed) Modified: head/lib/libc/tests/stdlib/Makefile Modified: head/lib/libc/tests/stdlib/Makefile == --- head/lib/libc/tests/stdlib/Makefile Mon Jan 20 11:40:07 2020 (r356909) +++ head/lib/libc/tests/stdlib/Makefile Mon Jan 20 11:45:18 2020 (r356910) @@ -6,6 +6,7 @@ ATF_TESTS_C+= dynthr_test ATF_TESTS_C+= heapsort_test ATF_TESTS_C+= mergesort_test ATF_TESTS_C+= qsort_test +ATF_TESTS_C+= qsort_r_test ATF_TESTS_C+= qsort_s_test ATF_TESTS_C+= set_constraint_handler_s_test ATF_TESTS_C+= strfmon_test Added: head/lib/libc/tests/stdlib/qsort_r_test.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/stdlib/qsort_r_test.c Mon Jan 20 11:45:18 2020 (r356910) @@ -0,0 +1,92 @@ +/*- + * Copyright (C) 2020 Edward Tomasz Napierala + * Copyright (C) 2004 Maxim Sobolev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Test for qsort_r(3) routine. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include "test-sort.h" + +#defineTHUNK 42 + +static int +sorthelp_r(void *thunk, const void *a, const void *b) +{ + const int *oa, *ob; + + ATF_REQUIRE_EQ(*(int *)thunk, THUNK); + + oa = a; + ob = b; + /* Don't use "return *oa - *ob" since it's easy to cause overflow! */ + if (*oa > *ob) + return (1); + if (*oa < *ob) + return (-1); + return (0); +} + +ATF_TC_WITHOUT_HEAD(qsort_r_test); +ATF_TC_BODY(qsort_r_test, tc) +{ + int testvector[IVEC_LEN]; + int sresvector[IVEC_LEN]; + int i, j; + int thunk = THUNK; + + for (j = 2; j < IVEC_LEN; j++) { + /* Populate test vectors */ + for (i = 0; i < j; i++) + testvector[i] = sresvector[i] = initvector[i]; + + /* Sort using qsort_r(3) */ + qsort_r(testvector, j, sizeof(testvector[0]), &thunk, + sorthelp_r); + /* Sort using reference slow sorting routine */ + ssort(sresvector, j); + + /* Compare results */ + for (i = 0; i < j; i++) + ATF_CHECK_MSG(testvector[i] == sresvector[i], + "item at index %d didn't match: %d != %d", + i, testvector[i], sresvector[i]); + } +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, qsort_r_test); + + return (atf_no_error()); +} ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r356909 - in head: include lib/libc/stdlib lib/libc/tests/stdlib
Author: trasz Date: Mon Jan 20 11:40:07 2020 New Revision: 356909 URL: https://svnweb.freebsd.org/changeset/base/356909 Log: Add qsort_s(3). Apart from the constraints, it also makes it easier to port software written for Linux variant of qsort_r(3). Reviewed by: kib, arichardson MFC after:2 weeks Relnotes: yes Sponsored by: DARPA Differential Revision:https://reviews.freebsd.org/D23174 Added: head/lib/libc/stdlib/qsort_s.c (contents, props changed) head/lib/libc/tests/stdlib/qsort_s_test.c (contents, props changed) Modified: head/include/stdlib.h head/lib/libc/stdlib/Makefile.inc head/lib/libc/stdlib/Symbol.map head/lib/libc/stdlib/qsort.3 head/lib/libc/stdlib/qsort.c head/lib/libc/tests/stdlib/Makefile Modified: head/include/stdlib.h == --- head/include/stdlib.h Mon Jan 20 11:19:55 2020(r356908) +++ head/include/stdlib.h Mon Jan 20 11:40:07 2020(r356909) @@ -324,6 +324,11 @@ extern char *suboptarg;/* getsubopt(3) external var #if __EXT1_VISIBLE +#ifndef _RSIZE_T_DEFINED +#define _RSIZE_T_DEFINED +typedef size_t rsize_t; +#endif + #ifndef _ERRNO_T_DEFINED #define _ERRNO_T_DEFINED typedef int errno_t; @@ -339,6 +344,9 @@ _Noreturn void abort_handler_s(const char * __restrict errno_t); /* K3.6.1.3 */ void ignore_handler_s(const char * __restrict, void * __restrict, errno_t); +/* K.3.6.3.2 */ +errno_t qsort_s(void *, rsize_t, rsize_t, +int (*)(const void *, const void *, void *), void *); #endif /* __EXT1_VISIBLE */ __END_DECLS Modified: head/lib/libc/stdlib/Makefile.inc == --- head/lib/libc/stdlib/Makefile.inc Mon Jan 20 11:19:55 2020 (r356908) +++ head/lib/libc/stdlib/Makefile.inc Mon Jan 20 11:40:07 2020 (r356909) @@ -11,8 +11,8 @@ MISRCS+=C99_Exit.c a64l.c abort.c abs.c atexit.c atof. getsubopt.c hcreate.c hcreate_r.c hdestroy_r.c heapsort.c heapsort_b.c \ hsearch_r.c imaxabs.c imaxdiv.c \ insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c \ - merge.c mergesort_b.c ptsname.c qsort.c qsort_r.c quick_exit.c \ - radixsort.c rand.c \ + merge.c mergesort_b.c ptsname.c qsort.c qsort_r.c qsort_s.c \ + quick_exit.c radixsort.c rand.c \ random.c reallocarray.c reallocf.c realpath.c remque.c \ set_constraint_handler_s.c strfmon.c strtoimax.c \ strtol.c strtold.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \ @@ -51,7 +51,8 @@ MLINKS+=hcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 h MLINKS+=insque.3 remque.3 MLINKS+=lsearch.3 lfind.3 MLINKS+=ptsname.3 grantpt.3 ptsname.3 unlockpt.3 -MLINKS+=qsort.3 heapsort.3 qsort.3 mergesort.3 qsort.3 qsort_r.3 +MLINKS+=qsort.3 heapsort.3 qsort.3 mergesort.3 qsort.3 qsort_r.3 \ + qsort.3 qsort_s.3 MLINKS+=rand.3 rand_r.3 rand.3 srand.3 MLINKS+=random.3 initstate.3 random.3 setstate.3 random.3 srandom.3 \ random.3 srandomdev.3 Modified: head/lib/libc/stdlib/Symbol.map == --- head/lib/libc/stdlib/Symbol.map Mon Jan 20 11:19:55 2020 (r356908) +++ head/lib/libc/stdlib/Symbol.map Mon Jan 20 11:40:07 2020 (r356909) @@ -123,6 +123,10 @@ FBSD_1.5 { set_constraint_handler_s; }; +FBSD_1.6 { + qsort_s; +}; + FBSDprivate_1.0 { __system; _system; Modified: head/lib/libc/stdlib/qsort.3 == --- head/lib/libc/stdlib/qsort.3Mon Jan 20 11:19:55 2020 (r356908) +++ head/lib/libc/stdlib/qsort.3Mon Jan 20 11:40:07 2020 (r356909) @@ -32,7 +32,7 @@ .\" @(#)qsort.38.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 20, 2013 +.Dd January 14, 2020 .Dt QSORT 3 .Os .Sh NAME @@ -98,6 +98,15 @@ .Fa "size_t size" .Fa "int \*[lp]^compar\*[rp]\*[lp]const void *, const void *\*[rp]" .Fc +.Fd #define __STDC_WANT_LIB_EXT1__ 1 +.Ft errno_t +.Fo qsort_s +.Fa "void *base" +.Fa "rsize_t nmemb" +.Fa "rsize_t size" +.Fa "int \*[lp]*compar\*[rp]\*[lp]const void *, const void *, void *\*[rp]" +.Fa "void *thunk" +.Fc .Sh DESCRIPTION The .Fn qsort @@ -238,6 +247,36 @@ is faster than .Fn heapsort . Memory availability and pre-existing order in the data can make this untrue. +.Pp +The +.Fn qsort_s +function behaves the same as +.Fn qsort_r , except that: +.Bl -dash +.It +The order of arguments is different +.It +The order of arguments to +.Fa compar +is different +.It +if +.Fa nmemb +or +.Fa size +are greater than +.Dv RSIZE_MAX , +or +.Fa nmemb +is not zero and +.Fa compar +is NULL, then the runtime-constraint handler is called, and +.Fn qsort_s +returns an error. +Note that the handler is called before +.Fn qsort_s +returns the error, and the handler function