freebsd-nq/sys
Alan Cox 8f0d5d3b9f When I pushed down the page queues lock into pmap_is_modified(), I created
an ordering dependence: A pmap operation that clears PG_WRITEABLE and calls
vm_page_dirty() must perform the call first.  Otherwise, pmap_is_modified()
could return FALSE without acquiring the page queues lock because the page
is not (currently) writeable, and the caller to pmap_is_modified() might
believe that the page's dirty field is clear because it has not seen the
effect of the vm_page_dirty() call.

When I pushed down the page queues lock into pmap_is_modified(), I
overlooked one place where this ordering dependence is violated:
pmap_enter().  In a rare situation pmap_enter() can be called to replace a
dirty mapping to one page with a mapping to another page.  (I say rare
because replacements generally occur as a result of a copy-on-write fault,
and so the old page is not dirty.)  This change delays clearing PG_WRITEABLE
until after vm_page_dirty() has been called.

Fixing the ordering dependency also makes it easy to introduce a small
optimization: When pmap_enter() used to replace a mapping to one page with a
mapping to another page, it freed the pv entry for the first mapping and
later called the pv entry allocator for the new mapping.  Now, pmap_enter()
attempts to recycle the old pv entry, saving two calls to the pv entry
allocator.

There is no point in setting PG_WRITEABLE on unmanaged pages, so don't.
Update a comment to reflect this.

Tidy up the variable declarations at the start of pmap_enter().
2010-05-29 17:10:45 +00:00
..
amd64 When I pushed down the page queues lock into pmap_is_modified(), I created 2010-05-29 17:10:45 +00:00
arm Push down page queues lock acquisition in pmap_enter_object() and 2010-05-26 18:00:44 +00:00
boot boot/zfs: fix gang block reading code 2010-05-28 07:34:20 +00:00
bsm
cam Add a new primitive, XPT_SCAN_TGT, to cover the range between scanning a 2010-05-26 22:49:42 +00:00
cddl Remove kstat.zfs.arcstats.l2_write_bytes_written 2010-05-23 21:16:34 +00:00
compat Bring USB fixes for linux(4). 2010-05-24 07:04:00 +00:00
conf Introduce kernel build options for the Flattened Device Tree support. 2010-05-28 10:35:44 +00:00
contrib Sync run(4) driver from author's site. 2010-05-13 00:19:03 +00:00
crypto
ddb MFp4 @178364: 2010-05-24 16:41:05 +00:00
dev Due to the way HALDEBUG() is defined, we need to add curly brackets 2010-05-29 16:14:02 +00:00
fs Allow the experimental NFSv4 client to use cached attributes 2010-05-18 05:18:21 +00:00
gdb
geom Fix some whitespace nits. 2010-05-24 17:33:02 +00:00
gnu Move checking against RLIMIT_FSIZE into one place, vn_rlimit_fsize(). 2010-05-05 16:44:25 +00:00
i386 When I pushed down the page queues lock into pmap_is_modified(), I created 2010-05-29 17:10:45 +00:00
ia64 Push down page queues lock acquisition in pmap_enter_object() and 2010-05-26 18:00:44 +00:00
isa Do not attempt to switch to the same VTs between suspend and resume. 2010-05-26 16:37:54 +00:00
kern Avoid a wakeup(9) if we can be sure no one is waiting on the task. 2010-05-28 18:15:34 +00:00
kgssapi
libkern Switch to our preferred 2-clause BSD license. 2010-04-07 16:50:38 +00:00
mips Fix lock order reversal, unlock page queue and pmap locks before 2010-05-28 12:05:56 +00:00
modules Revert r208590. A license ack is not needed as per r186984. 2010-05-27 12:54:42 +00:00
net This patch fixes the problem where proxy ARP entries cannot be added 2010-05-25 20:42:35 +00:00
net80211 Add new tunable 'net.link.ifqmaxlen' to set default send interface 2010-05-03 07:32:50 +00:00
netatalk
netgraph Fix a race between ngs_rcvmsg() and soclose() which closes the control 2010-05-19 15:06:09 +00:00
netinet This patch fixes the problem where proxy ARP entries cannot be added 2010-05-25 20:42:35 +00:00
netinet6 Fix our version of IPv6 address representation. 2010-05-19 00:35:47 +00:00
netipsec MFp4 @178283: 2010-05-24 16:27:47 +00:00
netipx
netnatm
netncp Switch to our preferred 2-clause BSD license. 2010-04-07 16:50:38 +00:00
netsmb Switch to our preferred 2-clause BSD license. 2010-04-07 16:50:38 +00:00
nfs Factor out the code shared between NFS client and server into its own 2010-02-16 20:00:21 +00:00
nfsclient Fix build: newnp represents newvp so KDTRACE_NFS_ATTRCACHE_FLUSH_DONE() 2010-05-27 22:59:37 +00:00
nfsserver Patch the regular NFS server so that it returns ESTALE to the client 2010-03-26 01:19:29 +00:00
nlm
opencrypto Add comments trying to explain what bad things happen here, i.e. 2010-01-09 15:43:47 +00:00
pc98 MFi386: the part of revision 181809 2010-05-29 09:12:02 +00:00
pci Add new tunable 'net.link.ifqmaxlen' to set default send interface 2010-05-03 07:32:50 +00:00
powerpc Prepare and extend OFW layer for FDT support. 2010-05-28 10:43:56 +00:00
rpc When the regular NFS server replied to a UDP client out of the replay 2010-03-23 23:03:30 +00:00
security Add a case to make sure that internal audit records get converted 2010-05-04 15:29:07 +00:00
sparc64 Push down page queues lock acquisition in pmap_enter_object() and 2010-05-26 18:00:44 +00:00
sun4v Push down page queues lock acquisition in pmap_enter_object() and 2010-05-26 18:00:44 +00:00
sys Revert r207439 and solve the problem differently. The task handler 2010-05-28 18:15:28 +00:00
teken Just use <stdint.h> instead of <inttypes.h>. We don't need it here. 2010-04-03 17:22:28 +00:00
tools
ufs ffs_mount: accept and drop userland-only options that can be passed from 2010-05-19 09:32:11 +00:00
vm When I pushed down the page queues lock into pmap_is_modified(), I created 2010-05-29 17:10:45 +00:00
x86 Add support for corrected machine check interrupts. CMCI is a new local 2010-05-24 15:45:05 +00:00
xdr
xen don't hold spin lock across free 2010-02-21 01:12:18 +00:00
Makefile