freebsd-dev/sys
Konstantin Belousov a546448b8d Rewrite amd64 PCID implementation to follow an algorithm described in
the Vahalia' "Unix Internals" section 15.12 "Other TLB Consistency
Algorithms".  The same algorithm is already utilized by the MIPS pmap
to handle ASIDs.

The PCID for the address space is now allocated per-cpu during context
switch to the thread using pmap, when no PCID on the cpu was ever
allocated, or the current PCID is invalidated.  If the PCID is reused,
bit 63 of %cr3 can be set to avoid TLB flush.

Each cpu has PCID' algorithm generation count, which is saved in the
pmap pcpu block when pcpu PCID is allocated.  On invalidation, the
pmap generation count is zeroed, which signals the context switch code
that already allocated PCID is no longer valid.  The implication is
the TLB shootdown for the given cpu/address space, due to the
allocation of new PCID.

The pm_save mask is no longer has to be tracked, which (significantly)
reduces the targets of the TLB shootdown IPIs.  Previously, pm_save
was reset only on pmap_invalidate_all(), which made it accumulate the
cpuids of all processors on which the thread was scheduled between
full TLB shootdowns.

Besides reducing the amount of TLB shootdowns and removing atomics to
update pm_saves in the context switch code, the algorithm is much
simpler than the maintanence of pm_save and selection of the right
address space in the shootdown IPI handler.

Reviewed by:	alc
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
2015-05-09 19:11:01 +00:00
..
amd64 Rewrite amd64 PCID implementation to follow an algorithm described in 2015-05-09 19:11:01 +00:00
arm Pass the resources requests to the upper bus. 2015-05-09 03:39:18 +00:00
arm64 Port x86 busdma to ARM64 2015-05-08 18:47:19 +00:00
boot Move the text section to the start of the output file, so that when you 2015-05-08 19:43:53 +00:00
bsm
cam Handle EDQUOT backend storage errors same as ENOSPC. 2015-05-06 19:47:31 +00:00
cddl MFV r282630: 5809 Blowaway full receive in v1 pool causes kernel panic 2015-05-08 14:03:14 +00:00
compat Fix an error in r281551, part of the getfsstat() / kern_getfsstat() 2015-05-05 05:14:12 +00:00
conf Port x86 busdma to ARM64 2015-05-08 18:47:19 +00:00
contrib Move ALTQ from contrib to net/altq. The ALTQ code is for many years 2015-04-16 20:22:40 +00:00
crypto In the version of gcc in the FreeBSD tree, this modification was made to 2015-04-16 17:42:52 +00:00
ddb
dev If x86 CPU implementation of the MWAIT instruction reasonably 2015-05-09 12:28:48 +00:00
fs Fix the NFS server's handling of a bogus NFSv2 ROOT RPC. 2015-04-25 00:58:24 +00:00
gdb
geom Add apple-boot, apple-hfs and apple-ufs aliases to MBR scheme. 2015-05-05 09:33:02 +00:00
gnu The GNU Amlogic DTS files have some errors (e.g. bad register 2015-04-11 08:17:39 +00:00
i386 If x86 CPU implementation of the MWAIT instruction reasonably 2015-05-09 12:28:48 +00:00
isa
kern Do not return from thread_single(SINGLE_BOUNDARY) until all stopped 2015-05-09 18:32:13 +00:00
kgssapi
libkern Move zlib.c from net to libkern. 2015-04-22 14:38:58 +00:00
mips The add_bounce_page() function can be called when loading physical 2015-04-28 06:12:37 +00:00
modules Include makefiles necessary to make ixgbe build with the new code. 2015-04-30 22:56:43 +00:00
net Pass mtag argument into m_tag_locate() to continue the search from 2015-05-06 14:02:57 +00:00
net80211 Fix string concatenation - "wlan_##name" -> "wlan_" #name 2015-05-04 00:47:22 +00:00
netgraph Move zlib.c from net to libkern. 2015-04-22 14:38:58 +00:00
netinet Add a state transition call to show that we have entered TIME_WAIT. 2015-05-01 12:49:03 +00:00
netinet6 Mark data checksum as valid for multicast packets, that we send back 2015-05-07 14:17:43 +00:00
netipsec Fix the comment. We will not do SPD lookup again, because 2015-04-28 11:03:47 +00:00
netnatm
netpfil Fix panic when prepare_batch_buffer() returns error. 2015-05-06 07:53:43 +00:00
netsmb
nfs Avoid closing unallocated socket in case socreate fails. 2015-02-28 20:30:29 +00:00
nfsclient Remove some oldnfs remnants. 2015-04-18 16:08:06 +00:00
nfsserver Use M_SIZE() instead of hand-crafted (and mostly correct) NFSMSIZ() macro 2015-01-07 17:22:56 +00:00
nlm
ofed Don't drop the idr lock before verifying that the newly-inserted element 2015-05-02 00:26:38 +00:00
opencrypto Move zlib.c from net to libkern. 2015-04-22 14:38:58 +00:00
pc98 Fix kernel build ${MACHINE} path 2015-04-16 22:34:10 +00:00
powerpc Missed ofw_machdep.c in r282264. 2015-04-30 03:15:07 +00:00
rpc Remove hard limits on number of accepting NFS connections. 2015-04-07 10:25:27 +00:00
security cred: add proc_set_cred helper 2015-03-16 00:10:03 +00:00
sparc64 Update this driver to not save copies of registers that are no longer used 2015-04-24 13:12:04 +00:00
sys Convert hwpmc(4) debug printfs over to KTR. 2015-05-08 19:40:00 +00:00
teken mdoc: improvements to SEE ALSO. 2014-12-27 07:07:37 +00:00
tools
ufs Limit the number of cylinder groups that will be searched when 2015-04-24 23:27:50 +00:00
vm Place VM objects on the object list when created and never remove them. 2015-05-08 19:43:37 +00:00
x86 Rewrite amd64 PCID implementation to follow an algorithm described in 2015-05-09 19:11:01 +00:00
xdr
xen xen: introduce a newbus function to allocate unused memory 2015-05-08 14:48:40 +00:00
Makefile