lkml.org 
[lkml]   [2011]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 09/27] nfs: writeback pages wait queue
From
Date
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.



\
 
 \ /
  Last update: 2011-03-03 17:09    [W:0.235 / U:5.912 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site