[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 03 Mar 2011 17:08:01 +0100
From: Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: Wu Fengguang <fengguang.wu@...el.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, Jan Kara <jack@...e.cz>,
Jens Axboe <axboe@...nel.dk>,
Chris Mason <chris.mason@...cle.com>,
Trond Myklebust <Trond.Myklebust@...app.com>,
Christoph Hellwig <hch@....de>,
Dave Chinner <david@...morbit.com>,
Theodore Ts'o <tytso@....edu>, Mel Gorman <mel@....ul.ie>,
Rik van Riel <riel@...hat.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Greg Thelen <gthelen@...gle.com>,
Minchan Kim <minchan.kim@...il.com>,
Vivek Goyal <vgoyal@...hat.com>,
Andrea Righi <arighi@...eler.com>,
Balbir Singh <balbir@...ux.vnet.ibm.com>,
linux-mm <linux-mm@...ck.org>, linux-fsdevel@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 09/27] nfs: writeback pages wait queue
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists