freebsd-skq/sys/amd64/amd64
kib 7c26a038f9 Implement the concept of the unmapped VMIO buffers, i.e. buffers which
do not map the b_pages pages into buffer_map KVA.  The use of the
unmapped buffers eliminate the need to perform TLB shootdown for
mapping on the buffer creation and reuse, greatly reducing the amount
of IPIs for shootdown on big-SMP machines and eliminating up to 25-30%
of the system time on i/o intensive workloads.

The unmapped buffer should be explicitely requested by the GB_UNMAPPED
flag by the consumer.  For unmapped buffer, no KVA reservation is
performed at all. The consumer might request unmapped buffer which
does have a KVA reserve, to manually map it without recursing into
buffer cache and blocking, with the GB_KVAALLOC flag.

When the mapped buffer is requested and unmapped buffer already
exists, the cache performs an upgrade, possibly reusing the KVA
reservation.

Unmapped buffer is translated into unmapped bio in g_vfs_strategy().
Unmapped bio carry a pointer to the vm_page_t array, offset and length
instead of the data pointer.  The provider which processes the bio
should explicitely specify a readiness to accept unmapped bio,
otherwise g_down geom thread performs the transient upgrade of the bio
request by mapping the pages into the new bio_transient_map KVA
submap.

The bio_transient_map submap claims up to 10% of the buffer map, and
the total buffer_map + bio_transient_map KVA usage stays the
same. Still, it could be manually tuned by kern.bio_transient_maxcnt
tunable, in the units of the transient mappings.  Eventually, the
bio_transient_map could be removed after all geom classes and drivers
can accept unmapped i/o requests.

Unmapped support can be turned off by the vfs.unmapped_buf_allowed
tunable, disabling which makes the buffer (or cluster) creation
requests to ignore GB_UNMAPPED and GB_KVAALLOC flags.  Unmapped
buffers are only enabled by default on the architectures where
pmap_copy_page() was implemented and tested.

In the rework, filesystem metadata is not the subject to maxbufspace
limit anymore. Since the metadata buffers are always mapped, the
buffers still have to fit into the buffer map, which provides a
reasonable (but practically unreachable) upper bound on it. The
non-metadata buffer allocations, both mapped and unmapped, is
accounted against maxbufspace, as before. Effectively, this means that
the maxbufspace is forced on mapped and unmapped buffers separately.
The pre-patch bufspace limiting code did not worked, because
buffer_map fragmentation does not allow the limit to be reached.

By Jeff Roberson request, the getnewbuf() function was split into
smaller single-purpose functions.

Sponsored by:	The FreeBSD Foundation
Discussed with:	jeff (previous version)
Tested by:	pho, scottl (previous version), jhb, bf
MFC after:	2 weeks
2013-03-19 14:13:12 +00:00
..
amd64_mem.c Avoid preemption while manipulating CRs and MTRRs. 2011-01-17 17:30:35 +00:00
apic_vector.S Do not EOI local APIC too early. Just do doreti normally after resuming. 2012-02-07 23:24:29 +00:00
atomic.c
atpic_vector.S Introduce the new kernel sub-tree x86 which should contain all the code 2010-02-25 14:13:39 +00:00
autoconf.c
bios.c
bpf_jit_machdep.c If a conditional jump instruction has the same jt and jf, do not perform 2010-04-22 23:47:19 +00:00
bpf_jit_machdep.h If a conditional jump instruction has the same jt and jf, do not perform 2010-04-22 23:47:19 +00:00
cpu_switch.S Add support for the XSAVEOPT instruction use. Our XSAVE/XRSTOR usage 2012-07-14 15:48:30 +00:00
db_disasm.c Several fixes to the amd64 disassembler: 2012-07-06 14:25:59 +00:00
db_interface.c - Adjust the whitespace for the lines that output fields in 'show pcpu' in 2010-05-21 17:17:56 +00:00
db_trace.c Print the frame addresses for the backtraces on i386 and amd64. It 2012-12-03 22:16:51 +00:00
elf_machdep.c Remove duplicate header inclusion of <sys/sysent.h> 2012-08-07 05:46:36 +00:00
exception.S Microoptimize the return path for the fast syscalls on amd64. Arrange 2011-09-15 09:53:04 +00:00
fpu.c Implement an API to allow a hypervisor to save/restore 2012-12-12 08:35:32 +00:00
gdb_machdep.c
genassym.c Add x86/acpica/acpi_wakeup.c for amd64 and i386. Difference of 2012-06-09 00:37:26 +00:00
identcpu.c Do not try to enable new features in the %cr4 if running under 2012-11-09 16:00:30 +00:00
in_cksum.c
initcpu.c Enable the new instructions for reading and writing bases for %fs, 2012-11-01 15:17:43 +00:00
io.c - Extract the IODEV_PIO interface from ia64 and make it MI. 2010-04-28 15:38:01 +00:00
locore.S
machdep.c MFC 2013-03-02 14:48:41 +00:00
mem.c Partially revert r217515 so that the mem_range_softc variable is always 2012-07-09 20:42:08 +00:00
minidump_machdep.c Compute the number of initial kernel page table pages (NKPT) dynamically. 2013-02-06 04:53:00 +00:00
mp_machdep.c cpususpend_handler: mark AP as resumed only after fully setting up lapic 2013-02-02 12:04:32 +00:00
mp_watchdog.c Move <machine/apicreg.h> to <x86/apicreg.h>. 2010-11-01 18:18:46 +00:00
mpboot.S
pmap.c Implement the concept of the unmapped VMIO buffers, i.e. buffers which 2013-03-19 14:13:12 +00:00
prof_machdep.c Use atomic load & store for TSC frequency. It may be overkill for amd64 but 2011-04-07 23:28:28 +00:00
ptrace_machdep.c The PT_I386_{GET,SET}XMMREGS and PT_{GET,SET}XSTATE operate on the 2012-07-21 13:06:37 +00:00
sigtramp.S
stack_machdep.c
support.S - Remove the eintrcnt/eintrnames usage and introduce the concept of 2011-07-18 15:19:40 +00:00
sys_machdep.c Add support for the extended FPU states on amd64, both for native 2012-01-21 17:45:27 +00:00
trap.c Print the %rip value for uprintf_signal. 2012-10-14 17:08:46 +00:00
uio_machdep.c Put the general logic for being a CPU hog into a new function 2011-02-02 16:35:10 +00:00
uma_machdep.c Flip the semantic of M_NOWAIT to only require the allocation to not 2012-11-14 20:01:40 +00:00
vm_machdep.c Add a "pause" to busy wait loops in the cpu reset path. 2013-01-09 02:11:16 +00:00