Commit Graph

3100 Commits

Author SHA1 Message Date
ad
f391f83641 Add uvm_free(): returns number of free pages in system. 2019-12-21 12:58:26 +00:00
ad
dd632e5898 Split subr_cpu.c out of kern_cpu.c, to contain routines shared with rump. 2019-12-20 21:20:09 +00:00
mlelstv
cea9bbee01 Add error and zero targets to build. 2019-12-17 07:57:25 +00:00
ad
5b04a37fe9 Rump is living up to its name 2019-12-17 00:51:28 +00:00
ad
a98966d3dc - Extend the per-CPU counters matt@ did to include all of the hot counters
in UVM, excluding uvmexp.free, which needs special treatment and will be
  done with a separate commit.  Cuts system time for a build by 20-25% on
  a 48 CPU machine w/DIAGNOSTIC.

- Avoid 64-bit integer divide on every fault (for rnd_add_uint32).
2019-12-16 22:47:54 +00:00
ad
881d12e6f2 Merge from yamt-pagecache:
- do gang lookup of pages using radixtree.
- remove now unused uvm_object::uo_memq and vm_page::listq.queue.
2019-12-15 21:11:34 +00:00
pgoyette
cd4e04efe1 Initialize the module_hook synchronization variables in rump, too.
Fixes recently reported test failures for dev/sysmon/t_swsensor
and net/if_vlan/t_vlan
2019-12-15 14:21:34 +00:00
ad
6857513180 Merge from yamt-pagecache: use radixtree for page lookup.
rbtree page lookup was introduced during the NetBSD 5.0 development cycle to
bypass lock contention problems with the (then) global page hash, and was a
temporary solution to allow us to make progress.  radixtree is the intended
replacement.

Ok yamt@.
2019-12-14 17:28:58 +00:00
ad
5978ddc663 Break the global uvm_pageqlock into a per-page identity lock and a private
lock for use of the pagedaemon policy code.  Discussed on tech-kern.

PR kern/54209: NetBSD 8 large memory performance extremely low
PR kern/54210: NetBSD-8 processes presumably not exiting
PR kern/54727: writing a large file causes unreasonable system behaviour
2019-12-13 20:10:21 +00:00
pgoyette
f01c2b4e29 Eliminate per-hook duplication of common code as suggested by
(and with major contributions from) riastradh@

Welcome to 9.99.23
2019-12-12 22:55:20 +00:00
riastradh
131828f69c Restore call to pserialize_init.
We need it after all for psz_lock on the event counter.
2019-12-07 14:55:58 +00:00
riastradh
38e3ff59e6 Missed a spot in the crypto/arc4 deletion. 2019-12-05 03:57:55 +00:00
riastradh
fd49f423fd Fix rump definition of cpu_number(). 2019-12-04 03:04:52 +00:00
riastradh
a0c864ecf3 Rip out pserialize(9) logic now that the RCU patent has expired.
pserialize_perform() is now basically just xc_barrier(XC_HIGHPRI).
No more tentacles throughout the scheduler.  Simplify the psz read
count for diagnostic assertions by putting it unconditionally into
cpu_info.

From rmind@, tidied up by me.
2019-12-03 05:07:48 +00:00
ad
ea045f02e7 Another instance of cpu_onproc to replace. 2019-12-01 19:21:13 +00:00
ad
bcbc56a72a Regen. 2019-12-01 18:32:07 +00:00
ad
f278a3b979 Add ci_onproc. 2019-12-01 18:29:26 +00:00
ad
64e45337af cpu_onproc -> ci_onproc 2019-12-01 18:12:51 +00:00
ad
94bb47e411 Regen for VOP_LOCK & LK_UPGRADE/LK_DOWNGRADE. 2019-12-01 13:58:52 +00:00
ad
ce41050c72 Regen. 2019-12-01 13:46:34 +00:00
ad
566436656a namecache changes:
- Delete the per-entry lock, and borrow the associated vnode's v_interlock
  instead.  We need to acquire it during lookup anyway.  We can revisit this
  in the future but for now it's a stepping stone, and works within the
  quite limited context of what we have (BSD namecache/lookup design).

- Implement an idea that Mateusz Guzik (mjg@FreeBSD.org) gave me.  In
  cache_reclaim(), we don't need to lock out all of the CPUs to garbage
  collect entries.  All we need to do is observe their locks unheld at least
  once: then we know they are not in the critical section, and no longer
  have visibility of the entries about to be garbage collected.

- The above makes it safe for sysctl to take only namecache_lock to get stats,
  and we can remove all the crap dealing with per-CPU locks.

- For lockstat, make namecache_lock a static now we have __cacheline_aligned.

- Avoid false sharing - don't write back to nc_hittime unless it has changed.
  Put a a comment in place explaining this.  Pretty sure this was there in
  2008/2009 but someone removed it (understandably, the code looks weird).

- Use a mutex to protect the garbage collection queue instead of atomics, and
  adjust the low water mark up so that cache_reclaim() isn't doing so much
  work at once.
2019-12-01 13:39:53 +00:00
ad
11ba4e1830 Minor scheduler cleanup:
- Adapt to cpu_need_resched() changes. Avoid lost & duplicate IPIs and ASTs.
  sched_resched_cpu() and sched_resched_lwp() contain the logic for this.
- Changes for LSIDL to make the locking scheme match the intended design.
- Reduce lock contention and false sharing further.
- Numerous small bugfixes, including some corrections for SCHED_FIFO/RT.
- Use setrunnable() in more places, and merge cut & pasted code.
2019-11-23 19:42:52 +00:00
kamil
77a1ad5f00 Switch the iconv(3) prototype to the POSIX conformant variation
Remove const from the 2nd argument.

const char ** and char ** are incompatible types and it was a cost to keep
the technically incompatible form for a more purist variation. NetBSD was
almost the last alive OS to still keep the const argument (known leftovers:
Minix and Illumos).

Keep the const form for the internal purposes inside citrus and rump.

Address the build breakage fallout in the same change.

There are no ABI changes.

Change accepted by core@.
2019-10-24 18:17:14 +00:00
christos
075f50f56a Add a function cast for enosys 2019-10-15 18:36:38 +00:00
mrg
de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
christos
916f96072a regen 2019-10-09 01:43:35 +00:00
uwe
edcef67ec2 xc_barrier - convenience function to xc_broadcast() a nop.
Make the intent more clear and also avoid a bunch of (xcfunc_t)nullop
casts that gcc 8 -Wcast-function-type is not happy about.
2019-10-06 15:11:16 +00:00
mrg
21303c93e9 convert HAVE_GCC == 7 to HAVE_GCC >= 7. 2019-09-29 23:44:58 +00:00
bad
62a168f97a Remove libelf from "usr" list. Deleted 2015-09-30. 2019-09-27 11:57:42 +00:00
bad
c0a44e83e0 Exclude sys/external/{gpl2/dts,bsd/drm*}.
Saves some 100MB in the src-netbsd repo.
2019-09-27 11:53:42 +00:00
bad
604f5fbb67 rtadvd needs expandm.[hc] from libwrap. 2019-09-26 22:43:36 +00:00
bad
6551e0cc8c revert r1.35-r1.40 of sys/rump/listsrcdirs.
addressed differently in tools/Makefile r1.204.
2019-09-26 22:39:55 +00:00
bad
c3c178f615 Provide a weak alias for vnode_to_path to be used unless librumpvfs is present. 2019-09-26 17:52:50 +00:00
christos
e613c37a50 Regen 2019-09-25 16:44:42 +00:00
christos
ff17893526 regen 2019-09-22 23:03:20 +00:00
christos
38aa2a6771 Regen 2019-09-13 13:59:31 +00:00
bad
10596c0d1e typo: ARCH_EXTRA -> ARCHS_EXTRA 2019-09-12 21:37:06 +00:00
bad
f079d6d375 Add ews4800mips and sh3 heads only listed in src/tools/Makefile.nbincludes. 2019-09-12 21:10:19 +00:00
bad
bd3d17d9c3 Make include_headerlist ignore files in already exported directories.
Invoke include_headerlist after exporting the ARCHS directories.
2019-09-12 20:10:00 +00:00
bad
bc4d18d525 Summary: export the files from headerlist before the ARCHS's includes.
Or else cvs export will complain about them being in the way.
2019-09-12 18:28:05 +00:00
bad
f86b98ed53 Summary: add the files from src/tools/headerlist to the output. 2019-09-12 17:35:58 +00:00
bad
db28717fb4 Summary: pax needs pack_dev.h from mknod. move mknod to sys sources 2019-09-12 15:17:08 +00:00
bad
24626c2518 Summary: ammend previous. remove pax from userspace sources.
CVS: ----------------------------------------------------------------------
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?
2019-09-12 00:56:05 +00:00
bad
03c90d02ab Summary: add grep and stat.
CVS: ----------------------------------------------------------------------
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?
2019-09-12 00:17:03 +00:00
bad
dd3d5d3fbe add src/external/public-domain/xz. 2019-09-11 22:30:16 +00:00
bad
0f1e944e9e define sysautoload here too, to catch up with kern/makesyscalls.sh r1.173
XXX: This needs to be re-thought
2019-09-11 20:31:30 +00:00
riastradh
8e07b51739 Switch from NIST CTR_DRBG with AES to NIST Hash_DRBG with SHA-256.
Benefits:

- larger seeds -- a 128-bit key alone is not enough for `128-bit security'
- better resistance to timing side channels than AES
- a better-understood security story (https://eprint.iacr.org/2018/349)
- no loss in compliance with US government standards that nobody ever
  got fired for choosing, at least in the US-dominated western world
- no dirty endianness tricks
- self-tests

Drawbacks:

- performance hit: throughput is reduced to about 1/3 in naive measurements
  => possible to mitigate by using hardware SHA-256 instructions
  => all you really need is 32 bytes to seed a userland PRNG anyway
  => if we just used ChaCha this would go away...

XXX pullup-7
XXX pullup-8
XXX pullup-9
2019-09-02 20:09:29 +00:00
rmind
dadc88e3b0 NPF improvements:
- Add support for dynamic NETMAP algorithm (stateful net-to-net).
- Add most of the support for the dynamic NAT rules; a little bit more
  userland work is needed to finish this up and enable.
- Replace 'stateful-ends' with more permissive 'stateful-all'.
- Add various tunable parameters and document them, see npf-params(7).
- Reduce the memory usage of the connection state table (conndb).
- Portmap rewrite: use memory more efficiently, handle addresses dynamically.
- Bug fix: add splsoftnet()/splx() around the thmap writers and comment.
- npftest: clean up and simplify; fix some memleaks to make ASAN happy.
2019-07-23 00:52:01 +00:00
kamil
3c0a7f49e5 Drop unused retval pointer from do_sys_mknod{,at}()
No functional change intended.
2019-06-18 22:34:25 +00:00
msaitoh
97ab5c0053 Regen. 2019-06-03 06:05:39 +00:00