DragonFly-2.3.1.916.gae8e master sys/bus/cam cam_sim.c cam_xpt.c

看板DFBSD_commit作者時間16年前 (2009/07/15 11:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
commit ae8e83e6e95ab527d7528e1f38a1f95aa251908e Author: Matthew Dillon <dillon@apollo.backplane.com> Date: Tue Jul 14 19:31:18 2009 -0700 MPSAFE - tsleep_interlock, BUF/BIO, cluster, swap_pager. * tsleep_interlock()/tsleep() could miss wakeups during periods of heavy cpu activity. What would happen is code inbetween the two calls would try to send an IPI (say, issue a wakeup()), but while sending the IPI the kernel would be forced to process incoming IPIs synchronous to avoid a deadlock. The new tsleep_interlock()/tsleep() code adds another TAILQ_ENTRY to the thread structure allowing tsleep_interlock() to formally place the thread on the appropriate sleep queue without having to deschedule the thread. Any wakeup which occurs between the interlock and the real tsleep() call will remove the thread from the queue and the later tsleep() call will recognize this and simply return without sleeping. The new tsleep() call requires PINTERLOCKED to be passed to tsleep so tsleep() knows that the thread has already been placed on a sleep queue. * Continue making BUF/BIO MPSAFE. Remove B_ASYNC and B_WANT from buf->b_flag and add a new bio->bio_flags field to the bio. Add BIO_SYNC, BIO_WANT, and BIO_DONE. Use atomic_cmpset_int() (aka cmpxchg) to interlock biodone() against biowait(). vn_strategy() and dev_dstrategy() call semantics now require that synchronous BIO's install a bio_done function and set BIO_SYNC in the bio. * Clean up the cluster code a bit. * Redo the swap_pager code. Instead of issuing I/O during the collection, which depended on critical sections to avoid races in the cluster append, we now build the entire collection first and then dispatch the I/O. This allows us to use only async completion for the BIOs, instead of a hybrid sync-or-async completion. Summary of changes: sys/bus/cam/cam_sim.c | 4 +- sys/bus/cam/cam_xpt.c | 4 +- sys/dev/disk/ahci/ahci_dragonfly.c | 4 +- sys/dev/disk/aic7xxx/aic_osm_lib.c | 8 +- sys/dev/disk/ata/ata-raid.c | 25 +-- sys/dev/disk/fd/fd.c | 19 +-- sys/dev/disk/nata/ata-raid.c | 4 +- sys/dev/disk/sili/sili_dragonfly.c | 4 +- sys/dev/disk/vn/vn.c | 2 - sys/dev/drm/drmP.h | 4 +- sys/dev/drm/drm_drv.c | 6 +- sys/dev/drm/drm_lock.c | 4 +- sys/dev/drm/radeon_cp.c | 10 +- sys/dev/netif/iwi/if_iwi.c | 20 +-- sys/dev/raid/aac/aac.c | 12 +- sys/dev/raid/vinum/vinuminterrupt.c | 1 + sys/dev/raid/vinum/vinumio.c | 4 +- sys/dev/raid/vinum/vinumrequest.c | 3 +- sys/dev/raid/vinum/vinumrevive.c | 14 +- sys/dev/sound/pcm/sound.c | 4 +- sys/kern/kern_device.c | 5 +- sys/kern/kern_lock.c | 6 +- sys/kern/kern_physio.c | 15 +- sys/kern/kern_synch.c | 252 ++++++++++++--------- sys/kern/kern_umtx.c | 2 +- sys/kern/lwkt_ipiq.c | 4 +- sys/kern/lwkt_serialize.c | 9 +- sys/kern/lwkt_thread.c | 11 + sys/kern/subr_bus.c | 4 +- sys/kern/subr_diskgpt.c | 8 +- sys/kern/subr_disklabel32.c | 16 +- sys/kern/subr_disklabel64.c | 12 +- sys/kern/subr_diskmbr.c | 8 +- sys/kern/sys_pipe.c | 4 +- sys/kern/vfs_aio.c | 22 +- sys/kern/vfs_bio.c | 420 ++++++++++++++++++++++------------- sys/kern/vfs_cluster.c | 96 +++++---- sys/kern/vfs_subr.c | 16 +- sys/kern/vfs_vnops.c | 4 +- sys/net/tap/if_tap.c | 4 +- sys/netproto/smb/smb_subr.c | 4 +- sys/sys/bio.h | 8 + sys/sys/buf.h | 26 +-- sys/sys/buf2.h | 14 ++ sys/sys/systm.h | 3 +- sys/sys/thread.h | 3 +- sys/vfs/gnu/ext2fs/ext2_bmap.c | 9 +- sys/vfs/gnu/ext2fs/ext2_inode.c | 4 +- sys/vfs/hammer/hammer_io.c | 41 +--- sys/vfs/hammer/hammer_subs.c | 8 +- sys/vfs/mfs/mfs_vnops.c | 1 - sys/vfs/nfs/nfs_bio.c | 32 +++- sys/vfs/nfs/nfs_serv.c | 13 +- sys/vfs/nfs/nfs_syscalls.c | 1 + sys/vfs/nfs/nfs_vnops.c | 9 +- sys/vfs/nwfs/nwfs_io.c | 7 +- sys/vfs/nwfs/nwfs_vnops.c | 5 +- sys/vfs/smbfs/smbfs_io.c | 7 +- sys/vfs/smbfs/smbfs_vnops.c | 5 +- sys/vfs/specfs/spec_vnops.c | 33 +-- sys/vfs/ufs/ffs_balloc.c | 1 - sys/vfs/ufs/ffs_inode.c | 8 +- sys/vfs/ufs/ffs_rawread.c | 28 +-- sys/vfs/ufs/ufs_bmap.c | 9 +- sys/vm/swap_pager.c | 178 +++++----------- 65 files changed, 784 insertions(+), 747 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/ae8e83e6e95ab527d7528e1f38a1f95aa251908e -- DragonFly BSD source repository
文章代碼(AID): #1ANKPo56 (DFBSD_commit)