freebsd-skq/sys/vm
bmilekic 1edc23feaa Make the slabrefzone, the zone from which we allocated slabs with
internal reference counters, UMA_ZONE_NOFREE.  This way, those slabs
(with their ref counts) will be effectively type-stable, then using
a trick like this on the refcount is no longer dangerous:

        MEXT_REM_REF(m);
        if (atomic_cmpset_int(m->m_ext.ref_cnt, 0, 1)) {
                if (m->m_ext.ext_type == EXT_PACKET) {
                        uma_zfree(zone_pack, m);
                        return;
                } else if (m->m_ext.ext_type == EXT_CLUSTER) {
                        uma_zfree(zone_clust, m->m_ext.ext_buf);
                        m->m_ext.ext_buf = NULL;
                } else {
                        (*(m->m_ext.ext_free))(m->m_ext.ext_buf,
                            m->m_ext.ext_args);
                        if (m->m_ext.ext_type != EXT_EXTREF)
                                free(m->m_ext.ref_cnt, M_MBUF);
                }
        }
        uma_zfree(zone_mbuf, m);

Previously, a second thread hitting the above cmpset might
actually read the refcnt AFTER it has already been freed.  A very
rare occurance.  Now we'll know that it won't be freed, though.

Spotted by: julian, pjd
2004-06-09 19:18:50 +00:00
..
default_pager.c
device_pager.c
phys_pager.c
pmap.h
swap_pager.c
swap_pager.h
uma_core.c Make the slabrefzone, the zone from which we allocated slabs with 2004-06-09 19:18:50 +00:00
uma_dbg.c Bring in mbuma to replace mballoc. 2004-05-31 21:46:06 +00:00
uma_dbg.h
uma_int.h Bring in mbuma to replace mballoc. 2004-05-31 21:46:06 +00:00
uma.h Fix a comment above uma_zsecond_create(), describing its arguments. 2004-06-01 01:36:26 +00:00
vm_contig.c
vm_extern.h
vm_fault.c
vm_glue.c
vm_init.c
vm_kern.c Bring in mbuma to replace mballoc. 2004-05-31 21:46:06 +00:00
vm_kern.h
vm_map.c Back out previous commit; it went to the wrong file. 2004-05-25 18:28:52 +00:00
vm_map.h
vm_meter.c
vm_mmap.c
vm_object.c MFS: vm_map.c rev 1.187.2.27 through 1.187.2.29, fix MS_INVALIDATE 2004-05-25 18:40:53 +00:00
vm_object.h
vm_page.c
vm_page.h Update stale comments regarding page coloring. 2004-06-05 21:06:42 +00:00
vm_pageout.c
vm_pageout.h
vm_pageq.c Remove references to L1 in the comments, according to Alan they are 2004-06-07 19:33:05 +00:00
vm_pager.c
vm_pager.h
vm_param.h
vm_unix.c
vm_zeroidle.c
vm.h
vnode_pager.c
vnode_pager.h