aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Also make kern.maxfilesperproc a boot time tunable.Adrian Chadd2015-09-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Auto-tuning threshold discussions aside, it turns out that if you want to lower this on say, rather memory-packed machines, you either set maxusers or kern.maxfiles, or you set it in sysctl. The former is a non-exact way to tune this; the latter doesn't actually affect anything in the startup scripts. This first occured because I wondered why the hell screen would take upwards of 10 seconds to spawn a new screen. I then found python doing the same thing during fork/exec of child processes - it calls close() on each FD up to the current openfiles limit. On a 1TB machine this is like, 26 million FDs per process. Ugh. So: * This allows it to be set early in /boot/loader.conf; * It can be used to work around the ridiculous situation of screen, python, etc doing a close() on potentially millions of FDs even though you only have four open. Tested: * 4GB, 32GB, 64GB, 128GB, 384GB, 1TB systems with autotune, ensuring screen and python forking doesn't result in some pretty hilariously bad behaviour. TODO: * Note that the default login.conf sets openfiles-cur to unlimited, effectively obeying kern.maxfilesperproc. Perhaps we should fix this. * .. and even if we do, we need to also ensure that daemons get a soft limit of something reasonable and capped - they can request more FDs themselves. MFC after: 1 week Sponsored by: Norse Corp, Inc. Notes: svn path=/head/; revision=287606
* Use _exit() instead of exit() in child processes created during tests.John Baldwin2015-09-091-10/+10
| | | | | | | Suggested by: kib Notes: svn path=/head/; revision=287602
* Add a test to verify that a traced process sees its original parent viaJohn Baldwin2015-09-091-0/+87
| | | | | | | | | | getppid() after a debugger process that is not the parent has attached. Reviewed by: kib (earlier version) Differential Revision: https://reviews.freebsd.org/D3615 Notes: svn path=/head/; revision=287601
* Properly size the children[] arrays in the follow fork tests.John Baldwin2015-09-091-6/+6
| | | | Notes: svn path=/head/; revision=287600
* For open("name", O_DIRECTORY | O_CREAT), do not try to create theKonstantin Belousov2015-09-091-1/+4
| | | | | | | | | | | | | | | | | | | | | | named node, open(2) cannot create directories. But do allow the flag combination to succeed if the directory already exists. Declare the open("name", O_DIRECTORY | O_CREAT | O_EXCL) always invalid for the same reason, since open(2) cannot create directory. Note that there is an argument that O_DIRECTORY | O_CREAT should be invalid always, regardless of the target directory existence or O_EXCL. The current fix is conservative and allows the call to succeed in the situation where it succeeded before the patch. Reported by: Tom Ridge <freebsd@tom-ridge.com> Reviewed by: rwatson PR: 202892 Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=287599
* fix compare argument for address type.Takanori Watanabe2015-09-091-1/+1
| | | | | | | Submitted by: issei10193 (via Twitter) Notes: svn path=/head/; revision=287597
* Rework copyinstr to:Andrew Turner2015-09-091-4/+6
| | | | | | | | | | | * Fail when the length passed in is 0 * Remove an unneeded increment of the count on success * Return ENAMETOOLONG when the input pointer is too long Sponsored by: ABT Systems Ltd Notes: svn path=/head/; revision=287596
* - Fix SIGSEGV when sa == NULL. NULL check in getnameinfo_inet()Hiroki Sato2015-09-091-12/+8
| | | | | | | | | | | did not work as expected. - Simplify afdl table lookup. MFC after: 3 days Notes: svn path=/head/; revision=287595
* Add new USB ID.Hans Petter Selasky2015-09-092-0/+2
| | | | | | | | MFC after: 1 month PR: 202968 Notes: svn path=/head/; revision=287592
* Remove a check which caused spurious SIGSEGV on usermode access to theKonstantin Belousov2015-09-091-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mapped address without valid pte installed, when parallel wiring of the entry happen. The entry must be copy on write. If entry is COW but was already copied, and parallel wiring set MAP_ENTRY_IN_TRANSITION, vm_fault() would sleep waiting for the MAP_ENTRY_IN_TRANSITION flag to clear. After that, the fault handler is restarted and vm_map_lookup() or vm_map_lookup_locked() trip over the check. Note that this is race, if the address is accessed after the wiring is done, the entry does not fault at all. There is no reason in the current kernel to disallow write access to the COW wired entry if the entry permissions allow it. Initially this was done in r24666, since that kernel did not supported proper copy-on-write for wired text, which was fixed in r199869. The r251901 revision re-introduced the r24666 fix for the current VM. Note that write access must clear MAP_ENTRY_NEEDS_COPY entry flag by performing COW. In reverse, when MAP_ENTRY_NEEDS_COPY is set in vmspace_fork(), the MAP_ENTRY_USER_WIRED flag is cleared. Put the assert stating the invariant, instead of returning the error. Reported and debugging help by: peter Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=287591
* w(1) is not setgid binary since r53279, so remove the setgid() call.Xin LI2015-09-092-13/+1
| | | | | | | | | Reviewed By: wollman MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D3541 Notes: svn path=/head/; revision=287590
* Add PVR identifier for E6500, from the reference.Justin Hibbits2015-09-091-0/+1
| | | | Notes: svn path=/head/; revision=287586
* Correct setting R92C_TDECTRL_BLK_DESC_NUM_M bit.Kevin Lo2015-09-091-1/+1
| | | | Notes: svn path=/head/; revision=287584
* Revert r287578. This patch requires more review.Jung-uk Kim2015-09-082-4/+2
| | | | | | | Requested by: adrian Notes: svn path=/head/; revision=287583
* Correctly case FreeBSD in my entry in the tips fileAllan Jude2015-09-081-1/+1
| | | | | | | | | Submitted by: feld Approved by: wblock (mentor) Differential Revision: https://reviews.freebsd.org/D3601 Notes: svn path=/head/; revision=287582
* Add an additional check to service(8) -e incase rcvar is blankAllan Jude2015-09-081-2/+6
| | | | | | | | | Approved by: bapt (mentor) X-MFC-With: 287576 Differential Revision: https://reviews.freebsd.org/D3604 Notes: svn path=/head/; revision=287581
* Remove extra debug that crept inBaptiste Daroussin2015-09-081-3/+3
| | | | Notes: svn path=/head/; revision=287580
* Implement pubkey support for the bootstrapBaptiste Daroussin2015-09-084-35/+182
| | | | | | | | | | | | | | | | | Note that to not interfer with finger print it expects a signature on pkg itself which is named pkg.txz.pubkeysign To genrate it: echo -n "$(sha256 -q pkg.txz)" | openssl dgst -sha256 -sign /thekey \ -binary -out ./pkg.txz.pubkeysig Note the "echo -n" which prevent signing the '\n' one would get otherwise PR: 202622 MFC after: 1 week Notes: svn path=/head/; revision=287579
* Enable 802.11n support.Jung-uk Kim2015-09-082-2/+4
| | | | | | | PR: 164102 Notes: svn path=/head/; revision=287578
* Sort and remove duplicate compiler flags.Jung-uk Kim2015-09-082-15/+12
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=287577
* service(8) -e does not respect /etc/rc.conf.d/* entriesAllan Jude2015-09-081-0/+2
| | | | | | | | | | | | | PR: 173454 Submitted by: giantlock@gmail.com (original patch) Approved by: bapt (mentor) MFC after: 1 week Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3600 Notes: svn path=/head/; revision=287576
* Remove duplicate entry for Sierra Wireless Aircard 875Renato Botelho2015-09-082-2/+1
| | | | | | | | | Approved by: loos MFC after: 3 days Sponsored by: Rubicon Communications (Netgate) Notes: svn path=/head/; revision=287575
* - Fix Sierra MC7354 ID from a bad copy/paste, correct ID is 68C0Renato Botelho2015-09-081-1/+1
| | | | | | | | | | Approved by: loos Obtained from: pfSense MFC after: 3 days Sponsored by: Rubicon Communications (Netgate) Notes: svn path=/head/; revision=287574
* drm/ttm: Drain taskqueue if taskqueue_cancel_timeout() returned an errorJean-Sébastien Pédron2015-09-081-2/+1
| | | | | | | | Before, this was done if `pending` was true. This is not what the manpage suggests and not what was done elsewhere in the same file. Notes: svn path=/head/; revision=287573
* Fix indentation, no functional changesBaptiste Daroussin2015-09-081-6/+6
| | | | Notes: svn path=/head/; revision=287572
* Enable mincore_test on arm64, we now have a working pmap_mincore.Andrew Turner2015-09-081-3/+0
| | | | | | | | | PR: 202307 Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=287571
* Add support for pmap_mincore on arm64 by walking the page tables to findAndrew Turner2015-09-081-1/+67
| | | | | | | | | | | the details for the requested address. PR: 202307 Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=287570
* The swap pager is compatible with direct dispatch. It does its ownWarner Losh2015-09-081-11/+42
| | | | | | | | | | | | | | | | | | | | locking and doesn't sleep. Flag the consumer we create as such. In addition, decrement the in flight index when we have an out of memory error after having incremented it previously. This would have prevented swapoff from working if the swap pager ever hit a resource shortage trying to swap out something (the swap in path always waits for a bio, so won't have this issue). Simplify the close logic by abandoning the use of private and initializing the index to 1 and dropping that reference when we previously set private. Also, set sw_id only while sw_dev_mtx is held. This should only affect swapping to a vnode, as opposed to a geom whose close always sets it to NULL with sw_dev_mtx held. Differential Review: https://reviews.freebsd.org/D3547 Notes: svn path=/head/; revision=287567
* Allow us to set the console device tree node. This is needed as not allAndrew Turner2015-09-081-10/+18
| | | | | | | | | | | | | | | | | | | | | | vendor supplied device trees contain the needed properties for us to select the correct uart to use as the kernel console. An example of this would be to add the following to loader.conf. hw.fdt.console="/smb/uart@f7113000" The intention of this is slightly different than the existing hw.uart.console option. The new option will mean the boot serial configuration will be derived from the device node, while the existing option expects the user to configure all this themselves. Further work is planned to allow the uart configuration to be set based on the stdout-path property devicetree bindings. Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D3559 Notes: svn path=/head/; revision=287565
* isci: check return value of pci_alloc_msix()Jim Harris2015-09-081-2/+2
| | | | | | | | | | | | | | Certain VM guest types (VMware, Xen) do not support MSI, so pci_alloc_msix() always fails. isci(4) was not properly detecting the allocation failure, and would try to proceed with MSIx resource initialization rather than reverting to INTx. Reported and tested by: Bradley W. Dutton (brad-fbsd-stable@duttonbros.com) MFC after: 3 days Sponsored by: Intel Notes: svn path=/head/; revision=287564
* isci: explicitly enable/disable PCI busmasterJim Harris2015-09-081-0/+2
| | | | | | | | | | | | | BIOS always enables PCI busmaster on the isci device, which effectively worked around this omission. But when passing the isci device through to a guest VM, the hypervisor will disable busmaster and isci will not work without calling pci_enable_busmaster(). MFC after: 3 days Sponsored by: Intel Notes: svn path=/head/; revision=287563
* Make it possible to use acl_create_entry_np(3) to use first entry to anEdward Tomasz Napierala2015-09-081-1/+1
| | | | | | | | | | | empty ACL, and to append an entry to an ACL. Submitted by: sef@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=287562
* Revert r286984 (adding opt_random.h to sys/modules/zfs/Makefile)Enji Cooper2015-09-081-1/+1
| | | | | | | | | opt_random.h is no longer needed/referenced in the kernel build X-MFC with: r287558 Notes: svn path=/head/; revision=287559
* Remove opt_random.h header pollution from sys/random.h by movingEnji Cooper2015-09-082-4/+2
| | | | | | | | | | | | | | | | RANDOM_LOADABLE and RANDOM_YARROW's definitions from opt_random.h to opt_global.h This unbreaks `make depend` in sys/modules with multiple drivers (tmpfs, etc) after r286839 X-MFC with: r286839 Reviewed by: imp Submitted by: lwhsu Differential Revision: D3486 Notes: svn path=/head/; revision=287558
* Style. Use ANSI definition, wrap long lines, no initialization inKonstantin Belousov2015-09-081-8/+15
| | | | | | | | | | declaration for locals. Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=287557
* In the pthread_once(), if the initializer has already run, then theKonstantin Belousov2015-09-081-3/+5
| | | | | | | | | | | | | | | | | | | | calling thread is supposed to see accesses issued by the initializer. This means that the read of the once_control->state variable should have an acquire semantic. Use atomic_thread_fence_acq() when the value read is ONCE_DONE, instead of straightforward atomic_load_acq(), to only put a barrier when needed (*). On the other hand, the updates of the once_control->state with the intermediate progress state do not need to synchronize with other state accesses, remove _acq suffix. Reviewed by: alc (previous version) Suggested by: alc (*) Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=287556
* Enable TSF timer in monitor mode.Kevin Lo2015-09-081-1/+15
| | | | | | | | | Tested on RT5370, sta mode. Submitted by: Andriy Voskoboinyk <s3erios at gmail com> Differential Revision: https://reviews.freebsd.org/D3591 Notes: svn path=/head/; revision=287555
* Add TSF field into TX/RX radiotap headersKevin Lo2015-09-082-2/+16
| | | | | | | | | Tested on RT5370, sta mode. Submitted by: Andriy Voskoboinyk <s3erios at gmail com> Differential Revision: https://reviews.freebsd.org/D3590 Notes: svn path=/head/; revision=287554
* Fix comparison in run_key_set_cb().Kevin Lo2015-09-081-4/+5
| | | | | | | | | | Tested on RT5370, sta mode. Submitted by: Andriy Voskoboinyk <s3erios at gmail com> Differential Revision: https://reviews.freebsd.org/D3589 Notes: svn path=/head/; revision=287553
* - Remove empty key_update_* functions.Kevin Lo2015-09-082-28/+8
| | | | | | | | | | | | | - Hide "struct ieee80211_node *" -> "struct run_node *" casting behind RUN_NODE() macro. - Simplify IEEE80211_HAS_ADDR4 macro definition - Fix a comment (desn't -> doesn't) Submitted by: Andriy Voskoboinyk <s3erios at gmail com> Differential Revision: https://reviews.freebsd.org/D3588 Notes: svn path=/head/; revision=287552
* To simplify upcoming changes to the inactive queue scan, change the codeAlan Cox2015-09-081-18/+8
| | | | | | | | | | | so that there is only one place where pages are freed and only one place where pages are moved to the tail of the queue. Reviewed by: kib Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=287550
* Update DTrace nfs scripts to track the proper provider names.George V. Neville-Neil2015-09-082-4/+4
| | | | | | | Submitted by: Alex Burlyga Notes: svn path=/head/; revision=287544
* Don't call enable_all_rings if the adapter has been freed.Adrian Chadd2015-09-071-2/+5
| | | | | | | | | | | This is a subtle use-after-free race that results in some very undesirable hang behaviour. Reviewed by: pkelsey Obtained from: Kip Macy, NextBSD (https://github.com/NextBSD/NextBSD/commit/91a9bd1dbb33dafb41684d054e59d73976de9654) Notes: svn path=/head/; revision=287543
* Fix off-by-one bugs.Luiz Otavio O Souza2015-09-071-7/+13
| | | | | | | | | | While here, only set the GPIO pin state for output pins. Pointy hat to: loos Sponsored by: Rubicon Communications (Netgate) Notes: svn path=/head/; revision=287542
* In libz's inflateMark(), avoid left-shifting a negative integer, whichDimitry Andric2015-09-071-1/+1
| | | | | | | | | | | is undefined. Reviewed by: delphij Differential Revision: https://reviews.freebsd.org/D3344 MFC after: 3 days Notes: svn path=/head/; revision=287541
* fd: make rights a mandatory argument to fgetvp_rightsMateusz Guzik2015-09-071-5/+3
| | | | | | | The only caller already always passes rights. Notes: svn path=/head/; revision=287540
* fd: make the common case in filecaps_copy work locklessMateusz Guzik2015-09-073-16/+27
| | | | | | | | | The filedesc lock is only needed if ioctls caps are present, which is a rare situation. This is a step towards reducing the scope of the filedesc lock. Notes: svn path=/head/; revision=287539
* As expected, things aren't as simple as hoped. Consequently, we haveMarcel Moolenaar2015-09-071-22/+76
| | | | | | | | | | | | | | | | | | | | | | | | | no option but to use the smbios information to fill in the blanks. It's a good thing UGA is a protocol of the past and GOP has all the info we need. Anyway, the logic has been tweaked a little to get the easier bits of information up front. This includes the resolution and the frame buffer address. Then we look at the smbios information and define expected values as well as the missing bits (frame buffer offset and stride). If the values obtained match the expect values, we fill in the blanks and return. Otherwise we use the existing detection logic to figure it out. Rename the environment variables from uga_framebuffer abd uga_stride to hw.efifb.address and hw.efifb.stride. The latter names are more in line with other variable names. We currently have hardcoded settings for: 1. Mid-2007 iMac (iMac7,1) 2. Late-2007 MacBook (MacBook3,1) Notes: svn path=/head/; revision=287538
* Follow-up to r287442: Move sysctl to compiled-once fileConrad Meyer2015-09-073-6/+8
| | | | | | | | | | | | Avoid duplicate sysctl nodes. Found by: tijl Approved by: markj (mentor) Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3586 Notes: svn path=/head/; revision=287537
* Use load-acquire semantics while waiting for td_lock to be released. TheAndrew Turner2015-09-071-6/+7
| | | | | | | | | | | | | | store should have release semantics and will have due to the dsb above it so add a comment to explain this. [1] While here update the code to not reload the current thread, it's already in a register, we just need to not trash it. Suggested by: kib [1] Sponsored by: ABT Systems Ltd Notes: svn path=/head/; revision=287536