Commit Graph

163 Commits

Author SHA1 Message Date
pooka
1c4a50f192 sprinkle _KERNEL_OPT 2015-08-24 22:21:26 +00:00
maxv
7ad874c499 typo (comment) 2015-07-24 12:29:55 +00:00
mlelstv
c75410f9e1 Correct m_len calculation for m_dup() with mbuf clusters.
Fixes kern/49650.
2015-02-08 14:46:30 +00:00
ozaki-r
087b8cc474 Revert "Pull if_drain routine out of m_reclaim"
The commit broke dlopen()'d rumpnet on platforms where ld.so does not
override weak aliases (e.g. musl, Solaris, potentially OS X, ...).

Requested by pooka@.
2014-12-02 04:43:35 +00:00
ozaki-r
0b2631673e Pull if_drain routine out of m_reclaim
It's if-specific and should be in if.c.

No functional change.
2014-11-27 03:15:51 +00:00
pooka
4f6fb3bf35 Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
2014-02-25 18:30:08 +00:00
christos
1a9e8a975e remove trigger happy assertion. in m_adj negative lengths are valid. 2013-11-15 17:48:55 +00:00
christos
b764989391 - add KASSERTS on functions that don't accept M_COPYALL
- compute length for m_copyback0, m_makewritable used from ipf, is using
  M_COPYALL.
2013-11-14 18:54:40 +00:00
skrll
955298ee4a Deal with M_COPYALL becoming -ve properly in m_copym0.
I can now mount via nfs again.
2013-11-14 09:21:30 +00:00
christos
b89fa8e9d5 change M_COPYALL to be -1 instead of depending on it too be "too large",
so that we check explicitly against it in all places. ok gimpy
2013-11-14 00:50:36 +00:00
christos
6427a54f86 - initialize m_len m_pkthgr.len to 0 in constructors, as discussed in tech-net.
- s/MGET/m_get
- s/0/NULL
2013-10-09 20:15:20 +00:00
christos
2c8afde7d0 mark mbuf as free when we return it to the pool (Beverly Schwartz) 2013-09-20 19:13:39 +00:00
matt
a8c0b1a9f4 Make m_copydata panics more verbose 2013-06-28 01:23:05 +00:00
christos
45ab582ccf - add m_add() that puts an mbuf to end of a chain
- m_append() and m_align() with their family
- remove parameters from prototypes
2013-06-27 17:47:18 +00:00
pooka
1fddf4baef print more diagnostic info in panic message 2013-05-08 11:08:45 +00:00
rmind
d3cb55ca37 Add m_ensure_contig() routine, which is equivalent to m_pullup, but does not
destroy the mbuf chain on failure (it is kept valid).
2013-01-19 00:51:52 +00:00
para
fc7d559bb7 bring comment up to reality
kmem_map => kmem_arena
2012-10-18 19:33:38 +00:00
dsl
dbd0815551 Remove the unused 'struct malloc_type' args to kern_malloc/realloc/free
The M_xxx arg is left on the calls to malloc() and free(),
  maybe they could be converted to an enumeration and just saved in
  the malloc header (for deep diag use).
Remove the malloc_type from mbuf extension.
Fixes rump build as well.
Welcome to 6.99.6
2012-04-29 16:36:53 +00:00
para
4c23b30cff proper sizing of kmem_arena on different ports
PR port-i386/45946: Kernel locks up in VMEM system
2012-02-10 17:35:47 +00:00
para
e62ee4d475 extending vmem(9) to be able to allocated resources for it's own needs.
simplifying uvm_map handling (no special kernel entries anymore no relocking)
make malloc(9) a thin wrapper around kmem(9)
(with private interface for interrupt safety reasons)

releng@ acknowledged
2012-01-27 19:48:38 +00:00
plunky
7f3d4048d7 NULL does not need a cast 2011-08-31 18:31:02 +00:00
dyoung
f77a583767 Miscellaneous mbuf changes:
1 Add some protection against double-freeing mbufs in DIAGNOSTIC kernels.

2 Add a m_defrag() that's derived from
  sys/dev/pci/if_vge.c:vge_m_defrag().  This one copies the packet
  header.

3 Constify m_tag_find().
2011-08-08 19:10:33 +00:00
uebayasi
2de1fdfe8b These don't need uvm/uvm_extern.h. 2011-07-27 14:35:33 +00:00
rmind
bd5b92d68b - Replace few malloc(9) uses with kmem(9).
- Rename buf_malloc() to buf_alloc(), fix comments.
- Remove some unnecessary inclusions.
2011-04-24 18:46:22 +00:00
uebayasi
9d567f003d Include internal definitions (uvm/uvm.h) only where necessary. 2011-01-17 07:13:31 +00:00
cegger
0afb168c64 No need to print '0x' twice in the printing of
the mbuf flags via 'show mbuf'
2010-11-24 14:49:18 +00:00
seanb
49025bce19 Always use m_split() in m_copyback() instead of its
local, abridged, version.  This closes a window where
a new mbuf (n) can be inserted where n->m_next == n.
2010-10-28 14:21:50 +00:00
pooka
a96791040e remove unnecessary #ifdef 2010-05-11 20:21:56 +00:00
rmind
93deacb9f4 Remove mclpool_allocator, which is unnecessary since mb_map removal. 2010-04-16 02:57:15 +00:00
joerg
1476e7a45a Handle rump like the direct mapping case. 2010-02-08 22:55:36 +00:00
joerg
d621e29eca Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.
2010-02-08 19:02:25 +00:00
bouyer
f8059f7e67 m_split0(): If the newly allocated mbuf holds only the header,
don't forget to set m_len to 0. Otherwise whatever will compute the size
of this chain (including s_split() itself if called again on this chain)
will get it wrong, leading to various issues.

Bug exposed by the NFS server code with linux clients using TCP mounts.
2009-04-05 16:31:21 +00:00
cegger
b8817e4aed ansify function definitions 2009-03-15 17:14:40 +00:00
christos
9a5d3f2817 replace bitmask_snprintf(9) with snprintb(3) 2008-12-16 22:35:21 +00:00
pooka
54b9426187 Move some sysctl node creations away from linksets and into the
constructors for subsystems.

XXX: CTLFLAG_PERMANENT is non-sensible.
2008-12-07 20:58:46 +00:00
matt
1906aa3e59 Switch from KASSERT to CTASSERT for those asserts testing sizes of types. 2008-07-02 14:47:34 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
thorpej
0cfa6e7487 Make the percpu API a little more friendly:
- percpu_getptr() is now called percpu_getref() and implicitly disables
  preemption (via crit_enter()) when it is called.
- Added percpu_putref() which implicitly reenables preemption (via
  crit_exit()).
2008-04-09 05:11:20 +00:00
yamt
9a4b7dd279 merge yamt-lazymbuf branch. 2008-03-24 12:24:37 +00:00
yamt
44dac61d31 make some mbuf related statistics per-cpu. 2008-01-17 14:49:28 +00:00
yamt
326b67ad4b m_print: avoid sign extention of m_flags. 2007-11-14 14:11:57 +00:00
ad
d18c6ca4de Merge from vmlocking:
- pool_cache changes.
- Debugger/procfs locking fixes.
- Other minor changes.
2007-11-07 00:23:13 +00:00
ad
59d979c5f1 Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-12 18:18:22 +00:00
yamt
95ef0a2720 fix a fallout from caddr_t changes. 2007-03-04 14:33:57 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
thorpej
4f3d5a9cc0 TRUE -> true, FALSE -> false 2007-02-22 06:34:42 +00:00
thorpej
712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
yamt
1a7bc55dcc remove some __unused from function parameters. 2006-11-01 10:17:58 +00:00
christos
4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
dogcow
55ddfc9aae change the MOWNER_INIT define to take two args; fix extant struct mowner
decls to use it. Makes options MBUFTRACE compile again and not whinge about
missing structure declarations. (Also makes initialization consistent.)
2006-10-10 21:49:14 +00:00