freebsd-dev/sys/sparc64/sparc64
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
..
ata_machdep.c Correct double "the the" 2012-09-14 21:28:56 +00:00
autoconf.c
bus_machdep.c Reform the busdma API so that new types may be added without modifying 2013-02-12 16:57:20 +00:00
cache.c Now that we have a working OF_printf() since r230631 and a OF_panic() 2012-01-27 23:21:54 +00:00
cam_machdep.c For sparc64 also adjust the geometry of da(4) driven disks to not overflow 2011-11-27 15:43:40 +00:00
cheetah.c - For Cheetah- and Zeus-class CPUs don't flush all unlocked entries from 2011-07-02 11:14:54 +00:00
clock.c Now that we have a working OF_printf() since r230631 and a OF_panic() 2012-01-27 23:21:54 +00:00
counter.c - Remove redundant timecounter masking from counter_get_timecount(). 2011-07-12 18:02:37 +00:00
db_disasm.c
db_hwwatch.c
db_interface.c
db_trace.c
dump_machdep.c - Merge from r147740: 2011-08-06 17:45:52 +00:00
eeprom.c s,KOBJMETHOD_END,DEVMETHOD_END,g in order to fully hide the explicit mention 2011-11-22 21:55:40 +00:00
elf_machdep.c
exception.S Also allocate space for the PIL counters. Given that no machine actually 2011-10-01 13:11:29 +00:00
gdb_machdep.c
genassym.c Nuke SUN4U #ifdef's which with the demise of sun4v no longer serve any 2011-10-01 13:16:01 +00:00
identcpu.c Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
in_cksum.c
interrupt.S Revert bogus part of r241740. 2013-01-03 23:12:08 +00:00
intr_machdep.c - Give PIL_PREEMPT the lowest priority just above low/stray interrupts. 2012-10-20 12:07:48 +00:00
iommu.c Reform the busdma API so that new types may be added without modifying 2013-02-12 16:57:20 +00:00
jbusppm.c s,KOBJMETHOD_END,DEVMETHOD_END,g in order to fully hide the explicit mention 2011-11-22 21:55:40 +00:00
locore.S
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
mp_exception.S Don't waste a delay slot. 2011-07-02 11:46:23 +00:00
mp_locore.S Adapt CATR() to r222813. This is somewhat tricky as we can't afford using 2011-06-07 17:33:39 +00:00
mp_machdep.c - Unlike cache invalidation and TLB demapping IPIs, reading registers from 2012-08-29 16:56:50 +00:00
nexus.c s,KOBJMETHOD_END,DEVMETHOD_END,g in order to fully hide the explicit mention 2011-11-22 21:55:40 +00:00
ofw_machdep.c - Now that we have a working OF_printf() since r230631, use it for 2012-01-27 22:35:53 +00:00
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
rtc.c s,KOBJMETHOD_END,DEVMETHOD_END,g in order to fully hide the explicit mention 2011-11-22 21:55:40 +00:00
rwindow.c
sc_machdep.c s,KOBJMETHOD_END,DEVMETHOD_END,g in order to fully hide the explicit mention 2011-11-22 21:55:40 +00:00
schppm.c s,KOBJMETHOD_END,DEVMETHOD_END,g in order to fully hide the explicit mention 2011-11-22 21:55:40 +00:00
spitfire.c - For Cheetah- and Zeus-class CPUs don't flush all unlocked entries from 2011-07-02 11:14:54 +00:00
ssm.c s,KOBJMETHOD_END,DEVMETHOD_END,g in order to fully hide the explicit mention 2011-11-22 21:55:40 +00:00
stack_machdep.c
support.S Add a global MD macro for the VIS block size instead of duplicating 2012-08-31 11:15:01 +00:00
swtch.S - Use atomic operations rather than sched_lock for safely assigning pm_active 2011-10-06 11:01:31 +00:00
sys_machdep.c Trace attempts to call restricted MD syscalls. 2011-10-18 07:39:27 +00:00
tick.c MFcalloutng: 2013-02-28 13:46:03 +00:00
tlb.c - Remove MD usage of pc_cpumask and pc_other_cpus. [1] 2011-06-20 21:31:01 +00:00
trap.c userret() already checks for td_locks when INVARIANTS is enabled, so 2012-09-08 18:27:11 +00:00
tsb.c Merge from vmobj-rwlock branch: 2013-02-26 01:00:11 +00:00
uio_machdep.c
upa.c s,KOBJMETHOD_END,DEVMETHOD_END,g in order to fully hide the explicit mention 2011-11-22 21:55:40 +00:00
vm_machdep.c Flip the semantic of M_NOWAIT to only require the allocation to not 2012-11-14 20:01:40 +00:00
zeus.c - For Cheetah- and Zeus-class CPUs don't flush all unlocked entries from 2011-07-02 11:14:54 +00:00