Commit Graph

128 Commits

Author SHA1 Message Date
rmind fc8b3b7154 Replace tmpfs_pool custom allocator code with a simpler layer for memory
accounting.  Use wired memory (which can be limited) for meta-data, and
kmem(9) for string allocations.

Close PR/31944.  Fix PR/38361 while here.  OK ad@.
2010-06-22 18:32:07 +00:00
rmind ef1673540e KNF and tidy-up example module slightly. 2010-06-22 18:30:20 +00:00
mjf e0e10b0607 Add __cacheline_aligned and __read_mostly annotations.
These annotations help to mitigate false sharing on multiprocessor
systems.

Variables annotated with __cacheline_aligned are placed into the
.data.cacheline_aligned section in the kernel. Each item in this
section is aligned on a cachline boundary - this avoids false
sharing. Highly contended global locks are a good candidate for
__cacheline_aligned annotation.

Variables annotated with __read_mostly are packed together tightly
into a .data.read_mostly section in the kernel. The idea here is that
we can pack infrequently modified data items into a cacheline and
avoid having to purge the cache, which would happen if read mostly
data and write mostly data shared a cachline. Initialisation variables
are a prime candiate for __read_mostly annotations.
2010-06-01 22:13:30 +00:00
pgoyette 6c40070d66 Extract ACPIVERBOSE into a kernel module. The module can be builtin
by defining 'options ACPIVERBOSE' in the kernel config file (no change
from current behavior), or it can be loaded at boot time on those
architectures that support the boot loader's "load" command.

ACPIVERBOSE also includes code to dump acpi/wmi data.
2010-05-31 20:32:28 +00:00
pgoyette 700e1731f0 Extract MIIVERBOSE into a kernel module. The module can be builtin
by defining 'options MIIVERBOSE' in the kernel config file (no change
from current behavior), or it can be loaded at boot time on those
architectures that support the boot loader's "load" command.
2010-05-30 17:44:07 +00:00
pgoyette 1dad7e2286 Extract SCSIVERBOSE into a kernel module. The module can be builtin
by defining 'options SCSIVERBOSE' in the kernel config file (no change
from current behavior), or it can be loaded at boot time on those
architectures that support the boot loader's "load" command.

The module is built for all architectures, whether or not SCSI or
atapi support exists.
2010-05-30 04:38:03 +00:00
pgoyette 3f79fb26a7 Extract USBVERBOSE into a kernel module. The module can be builtin
by defining 'options USBVERBOSE' in the kernel config file (no change
from current behavior), or it can be loaded at boot time on those
architectures that support the boot loader's "load" command.

The module is built for all architectures, whether or not USB support
exists.
2010-05-29 01:14:29 +00:00
mrg 5373bec4d9 add r600_blit.c and radeon_cs.c. 2010-05-27 07:27:35 +00:00
pgoyette 72a7c70b78 Extract the vendor/product tables and related access routines into a
separate kernel module.  Update pci bus attach routine to load the
module (if available) when we're about to start scanning the bus, and
unload the module after the scan is finished.

On architectures which support loading of modules by the boot loader,
the 'pciverbose' module can be loaded and executed without needing to
rebuild the kernel.  On all architectures, using 'options PCIVERBOSE'
in the kernel configuration file will create a 'builtin' module which
is functionally equivalent to previous behavior.

XXX Although not nearly as large as the vendor and product tables,
XXX the PCI class and subclass tables might also be offloaded into
XXX the module at a future time.

XXX Cardbus (and possibly other) drivers should also be modified to
XXX load the module before scanning/attaching devices.
2010-05-24 20:29:40 +00:00
ahoka 0edd676945 Remove bpfilter.h as not needed. 2010-04-13 13:09:46 +00:00
ahoka edd6235b94 Connect the pf module to the build. 2010-04-12 14:08:58 +00:00
ahoka dcc843776f Add new type kernel module for pf (includes pflog, but not pfsync). 2010-04-12 14:05:38 +00:00
ahoka 4a9711fd6e Connect the pad(4) kernel module to the build on i386 and amd64. 2010-04-09 13:49:12 +00:00
ahoka 07c8a4984d Makefile to build kernel module for pad. 2010-04-09 13:41:45 +00:00
mrg eaa088bcc1 add powerpc64 support. from dennis.c.ferguson@gmail.com in PR#43029. 2010-03-22 02:00:33 +00:00
pooka f3beefdb45 Convert acpibat to use ioconf instead of homerolled config glue.
Note, config whines about things like:
files.acpi:30: attaching undefined device `apm'

I intentionally was a lazy boy and didn't include a ton of dirt to
keep the hot napalm and riot blasts in the config thread rolling ;)

tested by jruoho (thanks!)
2010-03-21 07:09:56 +00:00
pooka ce672f239f include bsd.ioconf.mk when necessary 2010-03-21 06:56:52 +00:00
christos fc75a712eb Include ../../Makefile.inc now that it works. 2010-03-13 22:29:33 +00:00
christos 1b57f2e4ab now that I've fixed Makefile.inc, include it. 2010-03-13 22:23:47 +00:00
christos 26d6c574bd Don't hard-code ../../ so that we can handle multi-level modules (dtrace) 2010-03-13 22:06:30 +00:00
darran f6bf800773 DTrace: Add the Function Boundary Trace (FBT) provider moduile. This
module  instruments every function in the kernel with entry and exit
probes.  These probes are true zero-effect probes in that they don't
exist in the code until they are enabled.  The probes are enabled by
directly patching the function entry and exit points to make jumps into
the dtrace framework.
This gives us over 29,000 trace points in the kernel.
2010-03-12 21:53:15 +00:00
darran 328338d6bd DTrace: Add support for a simulated solaris_cpu[] data structure per
cpu.  Needed for the FBT provider amongst other features.
2010-03-12 21:37:37 +00:00
darran 33bc31b9e2 DTrace: fix a build problem for the SDT provider. 2010-03-10 23:40:53 +00:00
pooka c79910eee7 -DFFS is no longer necessary 2010-03-03 00:01:20 +00:00
pooka dd0604d344 Reflect removal of fs_nfs.h and -DNFS 2010-03-02 23:37:16 +00:00
pooka dfe63e3e16 Remove the ufs_vnops.c hacks from the lfs module, since ffs (and
hence ufs) has been required by lfs for ages now.
2010-03-02 18:00:24 +00:00
darran 6a9056a926 DTrace: Add an SDT (Statically Defined Tracing) provider framework, and
implement most of the proc provider.  Adds proc:::create, exec,
exec_success, exec_faillure, signal_send, signal_discard, signal_handle,
lwp_create, lwp_start, lwp_exit.
2010-03-01 21:10:13 +00:00
jruoho a92215aa7e Add makefiles for a sample of ACPI kernel modules. 2010-02-28 17:40:51 +00:00
haad c2a856c467 Update zfs module to new sources. 2010-02-28 15:22:16 +00:00
darran f802834604 DTrace: add the dtrace module. 2010-02-21 11:16:19 +00:00
darran dea8f231d6 DTrace: add the dtrace module to the build. 2010-02-21 11:14:47 +00:00
pooka 27d2b45e99 add bpf kmod 2010-01-25 22:21:28 +00:00
dyoung 6bcc29ee08 Fix MKBINUTILS=no builds by leaving out xldscripts. 2010-01-05 20:49:04 +00:00
njoly 54d7ff3b44 Add netbsd32_compat_50.c to netbsd32 module sources list. 2009-12-21 16:40:58 +00:00
nakayama 1c54a66d99 System utilities, boot programs and kernel modules are machine
(port) specific not CPU, so use MACHINE not MACHINE_ARCH.
2009-12-13 05:01:32 +00:00
uebayasi 42bd5b4c13 Typo. 2009-12-07 07:43:05 +00:00
pooka 70d4493c77 Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs.  User functionality remains the same.
2009-12-05 20:11:01 +00:00
skrll 25edd46c0c Move the kmodule linker script source into sys/modules/xldscripts. It is
not part of binutils and definitely not GPL v3.

Discussed with mrg.
2009-11-10 14:47:52 +00:00
jnemeth 3f353bcfa2 Check to see if we were passed a NULL proplist dictionary. 2009-10-20 05:33:30 +00:00
haad fbd1c01117 Add zfs sets and needed veriables to hook zfs into the build. ZFS on i386
need still one fix othervise it should be ready for testing.
2009-10-05 22:32:58 +00:00
elad 53ca19a3b3 First part of secmodel cleanup and other misc. changes:
- Separate the suser part of the bsd44 secmodel into its own secmodel
    and directory, pending even more cleanups. For revision history
    purposes, the original location of the files was

        src/sys/secmodel/bsd44/secmodel_bsd44_suser.c
        src/sys/secmodel/bsd44/suser.h

  - Add a man-page for secmodel_suser(9) and update the one for
    secmodel_bsd44(9).

  - Add a "secmodel" module class and use it. Userland program and
    documentation updated.

  - Manage secmodel count (nsecmodels) through the module framework.
    This eliminates the need for secmodel_{,de}register() calls in
    secmodel code.

  - Prepare for secmodel modularization by adding relevant module bits.
    The secmodels don't allow auto unload. The bsd44 secmodel depends
    on the suser and securelevel secmodels. The overlay secmodel depends
    on the bsd44 secmodel. As the module class is only cosmetic, and to
    prevent ambiguity, the bsd44 and overlay secmodels are prefixed with
    "secmodel_".

  - Adapt the overlay secmodel to recent changes (mainly vnode scope).

  - Stop using link-sets for the sysctl node(s) creation.

  - Keep sysctl variables under nodes of their relevant secmodels. In
    other words, don't create duplicates for the suser/securelevel
    secmodels under the bsd44 secmodel, as the latter is merely used
    for "grouping".

  - For the suser and securelevel secmodels, "advertise presence" in
    relevant sysctl nodes (sysctl.security.models.{suser,securelevel}).

  - Get rid of the LKM preprocessor stuff.

  - As secmodels are now modules, there's no need for an explicit call
    to secmodel_start(); it's handled by the module framework. That
    said, the module framework was adjusted to properly load secmodels
    early during system startup.

  - Adapt rump to changes: Instead of using empty stubs for securelevel,
    simply use the suser secmodel. Also replace secmodel_start() with a
    call to secmodel_suser_start().

  - 5.99.20.

Testing was done on i386 ("release" build). Spearated module_init()
changes were tested on sparc and sparc64 as well by martin@ (thanks!).

Mailing list reference:

	http://mail-index.netbsd.org/tech-kern/2009/09/25/msg006135.html
2009-10-02 18:50:12 +00:00
jmcneill 35a2c68409 enable viadrm kmod for i386 2009-09-27 12:46:39 +00:00
jmcneill 19c6e1e04c Add viadrm kmod 2009-09-27 12:44:05 +00:00
jnemeth 7220a79813 Not all platforms can do PaX stuff. The list was derived in private
conversation with several developers.  The change was tested on
sparc64.

NetBSD ultra.example.ca 5.99.17 NetBSD 5.99.17 (MODULAR) #0: Tue Sep 15 19:08:02 PDT 2009  jnemeth@ultra.example.ca:/usr/local/current/objdir/sys/arch/sparc64/compile/MODULAR sparc64

NAME		CLASS	SOURCE	REFS	SIZE	REQUIRES
...
exec_elf64      misc	filesys	0	6981	coredump
...
2009-09-17 23:07:12 +00:00
haad a83da6a90d Enable taskq which was disabled during testing. 2009-08-10 22:55:08 +00:00
haad 614ae6725c Remove strange looking -I entries. 2009-08-10 22:38:59 +00:00
haad 4837c664b3 Add raidframe module dir. Rf needs some fixes before it can be used as a
kernel module.
2009-08-10 07:19:11 +00:00
haad 58d687496c Add solaris and zfs kernel modules build directories. These modules will
not be built during release build until we import other kernel patches needed.
2009-08-10 07:16:06 +00:00
rmind 7512d1e720 Make POSIX message queues a kernel module. 2009-07-19 02:50:44 +00:00
reinoud 69a586f230 Import read-only part of the NiLFS (v2) implementation for NetBSD. It has been
tested with a DEBUG+DIAGNOSTIC+LOCKDEBUG kernel. To summerise NiLFS, i'll
repeat my posting to tech-kern here:

NiLFS stands for New implementation of Logging File System; LFS done
right they claim :) It is at version 2 now and is being developed by NTT, the
Japanese telecom company and recently put into the linux source tree. See
http://www.nilfs.org. The on-disc format is not completely frozen and i expect
at least one minor revision to come in time.

The benefits of NiLFS are build-in fine-grained checkpointing, persistent
snapshots, multiple mounts and very large file and media support. Every
checkpoint can be transformed into a snapshot and v.v. It is said to perform
very well on flash media since it is not overwriting pieces apart from a
incidental update of the superblock, but that might change. It is accompanied
by a cleaner to clean up the segments and recover lost space.

My work is not a port of the linux code; its a new implementation. Porting the
code would be more work since its very linux oriented and never written to be
ported outside linux. The goal is to be fully interchangable. The code is non
intrusive to other parts of the kernel. It is also very light-weight.

The current state of the code is read-only access to both clean and dirty
NiLFS partitions. On mounting a dirty partition it rolls forward the log to
the last checkpoint. Full read-write support is however planned!

Just as the linux code, mount_nilfs allows for the `head' to be mounted
read/write and allows multiple read-only snapshots/checkpoint mounts next to
it.

By allowing the RW mount at a different snapshot for read-write it should be
possible eventually to revert back to a previous state; i.e. try to upgrade a
system and being able to revert to the exact state prior to the upgrade.

Compared to other FS's its pretty light-weight, suitable for embedded use and
on flash media. The read-only code is currently 17kb object code on
NetBSD/i386. I doubt the read-write code will surpass the 50 or 60. Compared
this to FFS being 156kb, UDF being 84 kb and NFS being 130kb. Run-time memory
usage is most likely not very different from other uses though maybe a bit
higher than FFS.
2009-07-18 16:31:41 +00:00