| To: | Dave Chinner <david@xxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH 17/18] xfs: add a lru to the XFS buffer cache |
| From: | Christoph Hellwig <hch@xxxxxxxxxxxxx> |
| Date: | Tue, 14 Sep 2010 19:16:44 -0400 |
| Cc: | xfs@xxxxxxxxxxx |
| In-reply-to: | <1284461777-1496-18-git-send-email-david@xxxxxxxxxxxxx> |
| References: | <1284461777-1496-1-git-send-email-david@xxxxxxxxxxxxx> <1284461777-1496-18-git-send-email-david@xxxxxxxxxxxxx> |
| User-agent: | Mutt/1.5.20 (2009-08-17) |
Looks correct to me, although probably indeed a bit simplistic. > + /* add to LRU */ > + spin_lock(&btp->bt_lru_lock); > + list_add_tail(&new_bp->b_lru, &btp->bt_lru); > + btp->bt_lru_nr++; > + atomic_inc(&new_bp->b_hold); > + spin_unlock(&btp->bt_lru_lock); Just for clarity it would be nice to have this as an xfs_buf_lru_add helper. > + /* remove from LRU */ > + spin_lock(&btp->bt_lru_lock); > + list_del_init(&bp->b_lru); > + btp->bt_lru_nr--; > + spin_unlock(&btp->bt_lru_lock); And this ad xfs_buf_lru_del. |
| Previous by Date: | Re: [PATCH 01/18] xfs: single thread inode cache shrinking., Dave Chinner |
|---|---|
| Next by Date: | Re: [PATCH 05/18] xfs: convert inode cache lookups to use RCU locking, Dave Chinner |
| Previous by Thread: | [PATCH 17/18] xfs: add a lru to the XFS buffer cache, Dave Chinner |
| Next by Thread: | Re: [PATCH 17/18] xfs: add a lru to the XFS buffer cache, Dave Chinner |
| Indexes: | [Date] [Thread] [Top] [All Lists] |