Displaying 1 50 of 40,002 commits (0.009s)

DragonFlyBSD — sys/platform/pc64/apic ioapic_abi.c

x86_64/ioapic: Make sure that legacy IRQ only appears on one CPU.

The legacy IRQ lookup assumes only one CPU has a given legacy IRQ.

On system w/ large number of IOAPIC, GSI96 could be mapped to IRQ17
on CPU0 (since IRQ96 is used by SYSCALL), while GSI17 is mapped to
IRQ17 on another CPU.  This breaks later IRQ lookup.

Reported-by:         Imre Vadasz
Tested-by:        Imre Vadasz
Delta File
+24 -13 sys/platform/pc64/apic/ioapic_abi.c
+24 -13 1 file

DragonFlyBSD — sys/platform/pc64/apic ioapic_abi.c

x86_64/ioapic: Make sure that legacy IRQ only appears on one CPU.

The legacy IRQ lookup assumes only one CPU has a given legacy IRQ.

On system w/ large number of IOAPIC, GSI96 could be mapped to IRQ17
on CPU0 (since IRQ96 is used by SYSCALL), while GSI17 is mapped to
IRQ17 on another CPU.  This breaks later IRQ lookup.

Reported-by:         Imre Vadasz
Tested-by:        Imre Vadasz
Delta File
+24 -13 sys/platform/pc64/apic/ioapic_abi.c
+24 -13 1 file

DragonFlyBSD — sys/kern usched_dfly.c lwkt_thread.c

kernel - Remove cache ping-pong on common scheduler operations

* Reflect dfly_curprocmask and dfly_rdyprocmask bits in the
  scheduler's pcpu structures.  This allows us to reduce global
  atomic ops that are virtually guaranteed to cause cache ping
  ponging.

* sched_yield and token-based yield operations no longer clear
  the bit in the curprocmask, since they are just yielding
  (XXX needs work, a later blocking op then might not pull a
  new process from another cpu).

DragonFlyBSD — sys/sys indefinite2.h

kernel - More deterministic systat -pv lock name output

* Update the lock name in the globaldata structure for any
  contended lock that bumps the SMP collision count (basically,
  any lock which contends for more than 1uS).

* Improved systat -pv accuracy at very little cost.
Delta File
+8 -1 sys/sys/indefinite2.h
+8 -1 1 file

DragonFlyBSD — sys/kern kern_lockf.c

kernel - Improve lockf performance

* Improve fcntl lockf performance with two small optimizations.
  Together these add a little over 10% in non-contended
  performance.

* Add a 2-entry-per-cpu range lock allocation cache.  This
  covers the most typical lock/unlock situations.

* Conditionalize the setting of VMAYHAVELOCKS to avoid unnecessary
  atomic ops.

* Remove the clearing of VMAYHAVELOCKS.  The cost in close() is
  basically nothing while the cost in the lockf critical path
  is several branches and an atomic op.
Delta File
+53 -2 sys/kern/kern_lockf.c
+53 -2 1 file

DragonFlyBSD — lib/libthread_xu/thread thr_umtx.c thr_umtx.h

libthread_xu - Improve contended mutex code

* Retry a few times in a loop before using the umtx*() system
  calls to sleep.

  This significantly reduces IPI traffic and improves performance
  when a mutex is heavily contended.

DragonFlyBSD — sys/kern vfs_cache.c

kernel - Improve namecache performance

* Improve performance for the edge case where a process is
  deleting a large number of files.  In this situation,
  NCF_DESTROYED ncp entries can build up in the hash table
  and slow things down until the system quiets down, then
  the tables get cleaned up.

  Improve by recycling such entries into new entries when
  possible.

* Refactor the hash calculation again.  The big-prime idea
  actually has some trivially obvious problems, scrap it
  for the moment.
Delta File
+50 -13 sys/kern/vfs_cache.c
+50 -13 1 file

DragonFlyBSD — sys/kern kern_descrip.c

kernel - Improve kern_dup() performance

* Run the operation with a single exclusive spinlock instead of
  acquiring and releasing it twice.  Improves thread-concurent
  dup() performance.
Delta File
+19 -8 sys/kern/kern_descrip.c
+19 -8 1 file

DragonFlyBSD — sys/kern lwkt_token.c, sys/sys spinlock.h

kernel - Carefully refactor contended tokens and spinlocks (2)

* After testing, increasing the exponential cap from 1024 to
  4096 appears to produce better results, so the previous comment
  is wrong.  Adjust the default and the comment.

* Forgot to commit the changes to spinlock.h, fixed.
Delta File
+3 -3 sys/kern/lwkt_token.c
+2 -0 sys/sys/spinlock.h
+5 -3 2 files

DragonFlyBSD — sys/kern kern_slaballoc.c

kernel - Fix statistics accounting bug in kfree()

* kfree() was bumping the statistics counters for the wrong cpu.
  This could lead to kmalloc statistics slowly becoming inaccurate.

* This also fixes some significant cache line bouncing under
  heavy threaded loaded.
Delta File
+2 -2 sys/kern/kern_slaballoc.c
+2 -2 1 file

DragonFlyBSD — sys/kern kern_spinlock.c lwkt_token.c

kernel - Carefully refactor contended tokens and spinlocks

* Carefully put the exponential backoff back in for spinlocks, and
  implement for tokens.  Only applicable to exclusive locks, capped
  via sysctl (mjg).  Tested on dual-socket xeon.

* Exclusive priority for shared locks reduces the shared/exclusive
  starvation that can occur when exclusive locks use exponential
  backoff.

* Exponential backoff significantly improves performance for
  heavily contended exclusive locks by allowing some degree of burst
  operation.

* Implement TSC windowing for shared locks (and a little for
  exclusive locks too).  This prevents heavily contended exclusive
  locks from completely starving shared locks by using windowing
  to disable the exclusive-priority mechanic for shared locks.

  This allows a few contending shared locks to compete on equal
  ground with exclusive locks.

Suggested-by: mjg
Delta File
+66 -56 sys/kern/kern_spinlock.c
+51 -19 sys/kern/lwkt_token.c
+117 -75 2 files

DragonFlyBSD — sys/kern kern_lockf.c

kernel - Remove performance pessimization with INVARIANTS

* Remove lf_global_counter under INVARIANTS, fixes cache pessimization.
  We want performance scaling to continue to work with INVARIANTS since
  that is how we ship the kernel by default.
Delta File
+0 -11 sys/kern/kern_lockf.c
+0 -11 1 file

DragonFlyBSD — sys/config LINT64

LINT64: Fix typo.
Delta File
+1 -1 sys/config/LINT64
+1 -1 1 file

DragonFlyBSD — sys/kern kern_descrip.c

kernel - cleanup kern_descrip.c

* Cleanup long lines, syntax

* fsetfd_locked() does not have to call fclearcache().
Delta File
+9 -4 sys/kern/kern_descrip.c
+9 -4 1 file

DragonFlyBSD — sys/kern vfs_lock.c vfs_mount.c, sys/sys globaldata.h vnode.h

kernel - Localize [in]activevnodes globals, improve allocvnode

* Move to globaldata, keep globals as rollup statistics.

* We already solved normal active->inactive->active issues
  in prior work, this change primarily effects vnode termination,
  such as for unlink operations.

* Enhance allocvnode to reuse a convenient reclaimed vnode
  if we can find one on the pcpu's inactive list and lock it
  non-blocking.  This reduces unnecessary vnode count bloating.

DragonFlyBSD — sys/vfs/tmpfs tmpfs_vnops.c

tmpfs - Move dnode lock to improve unlink performance

* Unlock the directory node a little earlier in tmpfs_vop_nremove().
Delta File
+3 -1 sys/vfs/tmpfs/tmpfs_vnops.c
+3 -1 1 file

DragonFlyBSD — sys/kern kern_descrip.c

kernel - Minor rollup cleanup

* Collect count and apply once at the end of the loop.
Delta File
+3 -2 sys/kern/kern_descrip.c
+3 -2 1 file

DragonFlyBSD — sys/kern kern_event.c

kernel - Remove SMP bottlenecks on uidinfo, descriptors, and lockf (2)

* Fix lost fp bug, a file pointer would sometimes not get dropped,
  leading to disconnection problems (e.g. sftp).
Delta File
+9 -1 sys/kern/kern_event.c
+9 -1 1 file

DragonFlyBSD — lib/libc/gen _pthread_stubs.c

libc - Remove incorrect sched_yield() stub

* sched_yield() is a system call, and libthread_xu does not
  override it.  Remove the empty stub so the system call is
  properly called.

* Now sched_yield() is no longer a NOP.
Delta File
+0 -1 lib/libc/gen/_pthread_stubs.c
+0 -1 1 file

DragonFlyBSD — sys/kern kern_event.c kern_descrip.c, sys/sys resourcevar.h proc.h

kernel - Remove SMP bottlenecks on uidinfo, descriptors, and lockf

* Use an eventcounter and the per-thread fd cache to fix
  bottlenecks in checkfdclosed().  This will work well for
  the vast majority of applications and test benches.

* Batch holdfp*() operations on kqueue collections when implementing
  poll() and select().  This significant improves performance.
  Full scaling not yet achieved, however.

* Increase copyin item batching from 8 to 32 for select() and poll().

* Give the uidinfo structure a pcpu array to hold the posixlocks
  and openfiles count fields, with a rollup contained in the uidinfo
  structure itself.

  This removes numerous global bottlenecks related to open(),
  close(), dup*(), and lockf operations (posixlocks count).

  ui_openfiles will force a rollup on limit reached to be sure
  that the limit was actually reached.  ui_posixlocks stays fairly
  loose.  Each cpu rolls up generally only when the pcpu count exceeds
  +32 or goes below -32.

* Give the proc structure a pcpu array for the same counts, in order

    [4 lines not shown]
Delta File
+152 -46 sys/kern/kern_event.c
+105 -44 sys/kern/kern_descrip.c
+28 -16 sys/kern/kern_lockf.c
+17 -2 sys/sys/resourcevar.h
+12 -5 sys/kern/sys_generic.c
+5 -3 sys/sys/proc.h
+15 -6 7 files not shown
+334 -122 13 files

DragonFlyBSD — sys/kern lwkt_token.c

kernel - Refactor lwkt_token pool hash

* Refactor the lwkt_token pool hash to a better hash algorithm
  using large primes.
Delta File
+10 -5 sys/kern/lwkt_token.c
+10 -5 1 file

DragonFlyBSD — sbin/hammer cmd_show.c

sbin/hammer: Drop _X macro for hammer show

Also reduce supported indent levels from 17 to 10.

17 levels with 62 fanouts for internal nodes seems way more than
needed even considering max capacity of HAMMER1.
Delta File
+9 -18 sbin/hammer/cmd_show.c
+9 -18 1 file

DragonFlyBSD — . UPDATING

Fix up UPGRADING.
Delta File
+5 -1 UPDATING
+5 -1 1 file

DragonFlyBSD — . Makefile_upgrade.inc UPDATING, etc/defaults rc.conf

Remove IPsec and related code from the system.

It was unmaintained ever since we inherited it from FreeBSD 4.8.

In fact, we had two implementations from that time: IPSEC and FAST_IPSEC.
FAST_IPSEC is the implementation to which FreeBSD has moved since, but
it didn't even build in DragonFly.

Fixes for dports have been committed to DeltaPorts.

Requested-by: dillon
Dports-testing-and-fixing: zrj
Delta File
+0 -7,366 sys/netproto/key/key.c
+0 -6,966 sys/netproto/ipsec/key.c
+0 -3,474 sys/netinet6/ipsec.c
+0 -1,986 lib/libipsec/pfkey.c
+0 -1,854 sys/netproto/ipsec/ipsec.c
+0 -1,537 sys/netinet6/ah_core.c
+163 -27,808 173 files not shown
+163 -50,991 179 files

DragonFlyBSD — sys/sys mbuf.h

<sys/mbuf.h>: Fix packet tag comments.
Delta File
+2 -1 sys/sys/mbuf.h
+2 -1 1 file

DragonFlyBSD — sys/bus/cam/scsi scsi_da.c scsi_cd.c

kernel - Fix duplicate da0 or da* and locked up boot

* Fix duplicate da* reporting at boot which usually results in
  the boot locking up.

* The diskinfo was being installed while before CAM's softc->state
  normalized, potentially allowing I/O to occur during the probe
  sequence and causing the probe state to be repeated.

  Delay calling disk_setdiskinfo() until after softc->state is
  normalized.

DragonFlyBSD — sys/bus/cam/scsi scsi_da.c scsi_cd.c

kernel - Fix duplicate da0 or da* and locked up boot

* Fix duplicate da* reporting at boot which usually results in
  the boot locking up.

* The diskinfo was being installed while before CAM's softc->state
  normalized, potentially allowing I/O to occur during the probe
  sequence and causing the probe state to be repeated.

  Delay calling disk_setdiskinfo() until after softc->state is
  normalized.

DragonFlyBSD — sys/dev/disk/iscsi/initiator iscsi.c, sys/dev/disk/xdisk xdisk.c

kernel - per-thread fd cache, p_fd lock bypass

* Implement a per-thread (fd,fp) cache.  Cache hits can keep fp's
  in a held state (avoiding the need to fhold()/fdrop() the ref count),
  and bypasses the p_fd spinlock.  This allows the file pointer structure
  to generally be shared across cpu caches.

* Can cache up to four descriptors in each thread, LRU.  This is the common
  case.  Highly threaded programs tend to focus work on a distinct
  file descriptors in each thread.

* One file descriptor can be cached in up to four threads.  This is
  a significant limitation, though relatively uncommon.  On a cache miss
  the code drops into the normal shared p_fd spinlock lookup.
Delta File
+473 -78 sys/kern/kern_descrip.c
+33 -39 sys/kern/uipc_syscalls.c
+23 -31 sys/kern/vfs_syscalls.c
+10 -14 sys/kern/sys_generic.c
+12 -6 sys/sys/filedesc.h
+17 -1 sys/sys/thread.h
+33 -29 15 files not shown
+601 -198 21 files

DragonFlyBSD — sys/vfs/autofs autofs.c

sys/vfs/autofs: Use ksnprintf() (sync with NetBSD)

FreeBSD and DragonFly had strcpy()+strcat().
NetBSD changed it to snprintf().
Delta File
+7 -10 sys/vfs/autofs/autofs.c
+7 -10 1 file

DragonFlyBSD — sys/vfs/autofs autofs_vnops.c

sys/vfs/autofs: Fix a comment

This isn't really a FALLTHROUGH. Not sure why I even originally
added this since this had never existed in FreeBSD too.
Delta File
+0 -1 sys/vfs/autofs/autofs_vnops.c
+0 -1 1 file

DragonFlyBSD — sys/vm vm_object.c vm_object.h

kernel - Increase vm_object hash table

* Increase table from 64 to 256 entries.

* Improve the hash algorithm considerably for better coverage.
Delta File
+20 -4 sys/vm/vm_object.c
+1 -2 sys/vm/vm_object.h
+21 -6 2 files

DragonFlyBSD — sys/kern kern_descrip.c kern_plimit.c, sys/sys resourcevar.h thread.h

kernel - Implement td_limit reflection of p_limit

* Reflect proc->p_limit onto thread->td_limit to allow lockless
  rlimits testing.

* Significantly improves performance for rlimits-testing-centric
  operations such as for dup() and dup2().

* Also fixes performance issues across processes when the plimit
  structure is shared across many processes.  In this situation,
  unnecessary locking conflicts developed due to the high level
  of sharing across what would normally be considered distinct
  processes.

Suggested-by: mjg

DragonFlyBSD — etc/rc.d vknetd ip6fw

rc.d - Be quiet when check if modules are loaded
Delta File
+1 -1 etc/rc.d/vknetd
+1 -1 etc/rc.d/ip6fw
+1 -1 etc/rc.d/ipfw
+1 -1 etc/rc.d/mountcritremote
+1 -1 etc/rc.d/nfsclient
+1 -1 etc/rc.d/nfsserver
+3 -3 3 files not shown
+9 -9 9 files

DragonFlyBSD — sys/net/ipfw3_nat ip_fw3_nat.c

ipfw3nat: remove the state from the proper tree
Delta File
+1 -1 sys/net/ipfw3_nat/ip_fw3_nat.c
+1 -1 1 file

DragonFlyBSD — sys/kern kern_spinlock.c

kernel - Handle spinlock indefinite wait edge case

* The spinlock exclusive priority mechanism can cause an indefinite
  wait situation for shared locks to arise when a large number of cpu
  cores are cycling the same spinlock both shared and exclusive.

  This situation just won't happen for any real workload, but it
  can come up in benchmarks.

* Introduce a quick hack to ensure that this situation does not lead
  to a panic.  The exclusive priority mechanism is ignored once a
  shared spinlock has spun for greater than one second.
Delta File
+22 -6 sys/kern/kern_spinlock.c
+22 -6 1 file

DragonFlyBSD — sys/config LINT64

kernel/LINT64: Fix comment.
Delta File
+1 -1 sys/config/LINT64
+1 -1 1 file

DragonFlyBSD — . Makefile_upgrade.inc, include sgtty.h Makefile

Remove some old tty related code, such as <sgtty.h>, old ioctls etc.

It is replaced by POSIX termios on modern systems. Also, remove related
code in libcompat.

<sys/ioctl_compat.h> is now just a few lines. This header will eventually
be removed completely.

Two ports, devel/xxgdb and editors/aee, were still using <sgtty.h> and
have since been fixed. But let's bump __DragonFly_version anyway.

Dports-checking-and-fixing: zrj
Delta File
+1 -123 sys/sys/ioctl_compat.h
+0 -95 lib/libcompat/4.1/stty.3
+0 -62 sys/sys/ttychars.h
+0 -60 sys/sys/ttydev.h
+0 -49 lib/libcompat/4.1/gtty.c
+0 -49 lib/libcompat/4.1/stty.c
+11 -57 6 files not shown
+12 -495 12 files

DragonFlyBSD — sys/net bpf.c bpf.h

bpf - Add BIOC{S,G}FEEDBACK ioctls

- When set it allows reinjecting packets that were written to the bpf device
  as input to the interface when the output is successful.
- Add an alias to BIOCFEEDBACK which is the name of the
  of the 'set' ioctl in FreeBSD.

Partially-taken-from: NetBSD
Reviewed-by: sephe

Closes: #3126
Delta File
+40 -0 sys/net/bpf.c
+3 -0 sys/net/bpf.h
+1 -0 sys/net/bpfdesc.h
+44 -0 3 files

DragonFlyBSD — sys/net dlt.h

<net/dlt.h> - Remove a comment which is no longer applicable
Delta File
+0 -2 sys/net/dlt.h
+0 -2 1 file

DragonFlyBSD — sys/net dlt.h

<net/dlt.h> - Remove a comment which is no longer applicable
Delta File
+0 -2 sys/net/dlt.h
+0 -2 1 file

DragonFlyBSD — sys/net dlt.h

<net/dlt.h> - Add some more DLTs

- The DLT_USER* dlts are reserved for private use, they won't be
  used ever by libpcap/tcpdump themselves.
- net/wireshark-qt5 (and probably others) use it
Delta File
+42 -0 sys/net/dlt.h
+42 -0 1 file

DragonFlyBSD — sys/net dlt.h

<net/dlt.h> - Add some more DLTs

- The DLT_USER* dlts are reserved for private use, they won't be
  used ever by libpcap/tcpdump themselves.
- net/wireshark-qt5 (and probably others) use it
Delta File
+42 -0 sys/net/dlt.h
+42 -0 1 file

DragonFlyBSD — sys/vfs/hammer2 hammer2_vfsops.c hammer2_vnops.c

hammer2 - Add vfs.hammer2.limit_dirty_inodes

* Add vfs.hammer2.limit_dirty_inodes which causes hammer2 to
  immediately begin fsync()ing dirty inodes when the count exceeds
  the limit.  Set a reasonable limit.

* Fixes issues on slower storage when the syncer is unable to
  keep up with the userland frontend, causing the number of
  dirty inodes to increase almost unbounded (limited only by
  kern.maxvnodes).

  Allowing a large number of dirty inodes to accumulate can
  can result in a situation where the clean device buffer
  underpinning the dirty inode is discarded by the kernel before
  the filesystem is able to flush it, forcing additional disk reads
  and slowing things down even more.

* Improve the operation of speedup_syncer() by limiting the
  rate at which we call the function.  It is now called a maximum
  of approximately once per tick (each call speeding up a sync
  by one second).

DragonFlyBSD — sys/kern vfs_sync.c, sys/sys vnode.h

kernel - Add dirty vnode management facility

* Keep track of how many vnodes are queued to the syncer, which
  is basically the number of dirty vnodes.  The syncer vnode is
  included so the idle count is usually 1 and not 0.

* vn_syncer_count() returns the count.

* vn_syncer_one() attempts to fsync the next dirty vnode immediately,
  if it can acquire it non-blocking.  The special syncer vnode is
  ignored.  On failure the vnode will be requeued for 1 second,
  so this routine can be cycled.
Delta File
+88 -27 sys/kern/vfs_sync.c
+2 -0 sys/sys/vnode.h
+90 -27 2 files

DragonFlyBSD — share/man/man4 tcp.4, sys/conf options

kernel: Disable TCP_SIGNATURE in preparation for removing IPSEC.

Keep the code around until it gets fixed at a later date.

Requested-by: sephe
Delta File
+26 -27 share/man/man4/tcp.4
+5 -1 sys/config/LINT64
+1 -1 sys/conf/options
+32 -29 3 files

DragonFlyBSD — sys/netinet6 ip6_mroute.c

inet6/pim: Return IPPROTO_DONE if the mbuf is freed.

This prevents the caller from using the freed mbuf.

Obtained-from: NetBSD via FreeBSD
Delta File
+1 -1 sys/netinet6/ip6_mroute.c
+1 -1 1 file

DragonFlyBSD — sys/netinet6 ip6_mroute.c

inet6/pim: Return IPPROTO_DONE if the mbuf is freed.

This prevents the caller from using the freed mbuf.

Obtained-from: NetBSD via FreeBSD
Delta File
+1 -1 sys/netinet6/ip6_mroute.c
+1 -1 1 file

DragonFlyBSD — sys/kern kern_spinlock.c

kernel - Improve spinlock performance a bit

* Rearrange indefinite_init() and cpu_pause() in _spin_lock_contested()
  and _spin_lock_shared_contested() to improve performance.

* Fix conditional clearing the SHARED bit to use ovalue intead of
  value.  After review, either can be used but ovalue is more
  appropriate and give us an interlock against SPINLOCK_EXCLWAIT.

Reported-by: mjg_
Delta File
+6 -5 sys/kern/kern_spinlock.c
+6 -5 1 file

DragonFlyBSD — sys/conf bsd.kern.mk

kernel: Add -Wmissing-include-dirs to our kernel build.
Delta File
+1 -1 sys/conf/bsd.kern.mk
+1 -1 1 file

DragonFlyBSD — sys/dev/acpica Makefile.inc

kernel/acpica: Remove ${.OBJDIR}/include from Makefile.inc.

This file is included by various module Makefiles, of which only that
of acpica proper needs it. And that already cares about it in the
Makefile. Besides, we build acpica into our standard kernels anyway
now.

This fixes various -Wmissing-include-dirs warnings.
Delta File
+0 -1 sys/dev/acpica/Makefile.inc
+0 -1 1 file