Re: [PATCH 09/27] nfs: writeback pages wait queue

From: Peter Zijlstra
Date: Thu Mar 03 2011 - 11:06:54 EST


On Thu, 2011-03-03 at 14:45 +0800, Wu Fengguang wrote:
> +static void nfs_wakeup_congested(long nr,
> + struct backing_dev_info *bdi,
> + wait_queue_head_t *wqh)
> +{
> + long limit = nfs_congestion_kb >> (PAGE_SHIFT - 10);
> +
> + if (nr < 2 * limit - min(limit / 8, NFS_WAIT_PAGES)) {
> + if (test_bit(BDI_sync_congested, &bdi->state)) {
> + clear_bdi_congested(bdi, BLK_RW_SYNC);
> + smp_mb__after_clear_bit();
> + }
> + if (waitqueue_active(&wqh[BLK_RW_SYNC]))
> + wake_up(&wqh[BLK_RW_SYNC]);
> + }
> + if (nr < limit - min(limit / 8, NFS_WAIT_PAGES)) {
> + if (test_bit(BDI_async_congested, &bdi->state)) {
> + clear_bdi_congested(bdi, BLK_RW_ASYNC);
> + smp_mb__after_clear_bit();
> + }
> + if (waitqueue_active(&wqh[BLK_RW_ASYNC]))
> + wake_up(&wqh[BLK_RW_ASYNC]);
> + }
> +}

memory barriers want a comment - always - explaining what they order and
against whoem.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/