freebsd-dev/sys/mips/mips
Konstantin Belousov ee75e7de7b 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
..
autoconf.c o) Eliminate the "stand" frame and its use. Use CALLFRAME_* everywhere. 2010-04-19 07:34:26 +00:00
bus_space_fdt.c Merge Perforce changeset 219925 to head: 2013-01-12 15:58:20 +00:00
bus_space_generic.c Clean up various aspects of the MIPS generic busspace implementation: 2012-05-02 08:23:53 +00:00
busdma_machdep.c Reform the busdma API so that new types may be added without modifying 2013-02-12 16:57:20 +00:00
cache_mipsNN.c o) Use ABI, not ISA_* options, to determine whether to compile bits if libkern 2012-03-12 21:25:32 +00:00
cache.c o) Use ABI, not ISA_* options, to determine whether to compile bits if libkern 2012-03-12 21:25:32 +00:00
cpu.c o) Use ABI, not ISA_* options, to determine whether to compile bits if libkern 2012-03-12 21:25:32 +00:00
db_disasm.c Fix DDB x/i addr[,count] command for count > 1 case 2012-01-08 00:34:39 +00:00
db_interface.c Merge jmallett@'s n64 work into HEAD 2010-07-12 10:22:58 +00:00
db_trace.c Fix backtrace for MIPS64: 2012-01-13 23:31:36 +00:00
dump_machdep.c Fix a typo in cb_dumpdata() about wrongly calling wdog_kern_pat(). 2011-08-13 17:17:04 +00:00
elf_machdep.c - Fix .rela case of R_MIPS_26 relocation. Addednds save diferently for 2012-01-13 07:00:47 +00:00
elf_trampoline.c Support compiling MIPS elf trampoline with a different ABI. 2011-07-16 17:22:01 +00:00
exception.S Add DTrace-related part to machine-dependent code: 2012-03-24 05:17:38 +00:00
fp.S Prefer the cpuregs.h spellings of register and bit names over cpu.h. 2010-07-14 00:41:22 +00:00
freebsd32_machdep.c o) Use ABI, not ISA_* options, to determine whether to compile bits if libkern 2012-03-12 21:25:32 +00:00
gdb_machdep.c Use curthread rather than PCPU_GET(curthread). 'curthread' uses 2011-12-29 16:40:54 +00:00
genassym.c Garbage collect some unused symbols. 2012-03-06 08:40:21 +00:00
in_cksum.c Merge from projects/mips to head by hand: 2010-01-10 20:29:20 +00:00
inckern.S Make the ELF trampoline binary ELF executable (and do some cleanup). 2010-12-16 04:56:03 +00:00
intr_machdep.c Move PMC hook invocation to cpu_intr. The idea is the same as with ast() 2012-03-22 17:47:52 +00:00
libkern_machdep.c o) Use ABI, not ISA_* options, to determine whether to compile bits if libkern 2012-03-12 21:25:32 +00:00
locore.S At the risk of reducing source compatibility with old NetBSD and Sprite: 2012-03-06 19:01:32 +00:00
machdep.c Switch the vm_object mutex to be a rwlock. This will enable in the 2013-03-09 02:32:23 +00:00
mem.c Fix for crash on MIPS /dev/mem read. 2011-10-17 05:42:53 +00:00
minidump_machdep.c Fixup for r216141, dump_add_page needs to be non-static now. 2010-12-03 14:20:20 +00:00
mp_machdep.c Remove pc_cpumask and pc_other_cpus from MIPS support. 2011-06-28 12:51:08 +00:00
mpboot.S Get rid of duplicated versions of the KSU bits. 2012-03-06 23:08:02 +00:00
nexus.c Allow for MIPS devices to have a specific probe/attach order. 2012-04-21 04:17:30 +00:00
octeon_cop2_swtch.S - Add better COP2 (crypto coprocessor) context handler for Octeon. Keep 2012-01-06 01:23:26 +00:00
octeon_cop2.c - Add better COP2 (crypto coprocessor) context handler for Octeon. Keep 2012-01-06 01:23:26 +00:00
pm_machdep.c o) Use ABI, not ISA_* options, to determine whether to compile bits if libkern 2012-03-12 21:25:32 +00:00
pmap.c Implement the concept of the unmapped VMIO buffers, i.e. buffers which 2013-03-19 14:13:12 +00:00
ptrace_machdep.c
sc_machdep.c Provide basic glue to allow syscons to be used on MIPS, modelled 2012-08-25 08:09:37 +00:00
stack_machdep.c Merge jmallett@'s n64 work into HEAD - changeset 7 2010-06-24 08:08:43 +00:00
support.S Remove one wholly-unused and buggy routine and some nearby alternative symbols. 2012-11-17 23:53:12 +00:00
swtch.S o) Use ABI, not ISA_* options, to determine whether to compile bits if libkern 2012-03-12 21:25:32 +00:00
sys_machdep.c Reduce diffs with freebsd32_sysarch. 2012-03-10 06:31:28 +00:00
tick.c MFcalloutng: 2013-02-28 13:46:03 +00:00
tlb.c Introduce a new TLB invalidation function for efficiently invalidating 2012-10-02 07:14:22 +00:00
trap.c userret() already checks for td_locks when INVARIANTS is enabled, so 2012-09-08 18:27:11 +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 o) Use ABI, not ISA_* options, to determine whether to compile bits if libkern 2012-03-12 21:25:32 +00:00