From: Glauber Costa <glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
To: Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: <linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org>,
<cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Dave Shrinnker <david-FqsqvQoI3Ljby3iVrkZq2A@public.gmane.org>,
Serge Hallyn
<serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>,
<kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>,
Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>,
Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
<hughd-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
<linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
Dave Chinner <dchinner-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH v3 14/32] xfs: convert buftarg LRU to generic code
Date: Mon, 15 Apr 2013 06:14:44 -0400 [thread overview]
Message-ID: <516BD314.9000302@parallels.com> (raw)
In-Reply-To: <xr9361zo8iav.fsf-aSPv4SP+Du0KgorLzL7FmE7CuiCeIGUxQQ4Iyu8u01E@public.gmane.org>
On 04/15/2013 01:38 AM, Greg Thelen wrote:
> On Mon, Apr 08 2013, Glauber Costa wrote:
>
>> From: Dave Chinner <dchinner-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>>
>> Convert the buftarg LRU to use the new generic LRU list and take
>> advantage of the functionality it supplies to make the buffer cache
>> shrinker node aware.
>>
>> Signed-off-by: Glauber Costa <glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
>> Signed-off-by: Dave Chinner <dchinner-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>>
>> Conflicts with 3b19034d4f:
>> fs/xfs/xfs_buf.c
>> ---
>> fs/xfs/xfs_buf.c | 167 +++++++++++++++++++++++++------------------------------
>> fs/xfs/xfs_buf.h | 5 +-
>> 2 files changed, 79 insertions(+), 93 deletions(-)
>>
>> diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
>> index 8459b5d..4cc6632 100644
>> --- a/fs/xfs/xfs_buf.c
>> +++ b/fs/xfs/xfs_buf.c
>> @@ -85,20 +85,14 @@ xfs_buf_vmap_len(
>> * The LRU takes a new reference to the buffer so that it will only be freed
>> * once the shrinker takes the buffer off the LRU.
>> */
>> -STATIC void
>> +static void
>> xfs_buf_lru_add(
>> struct xfs_buf *bp)
>> {
>> - struct xfs_buftarg *btp = bp->b_target;
>> -
>> - spin_lock(&btp->bt_lru_lock);
>> - if (list_empty(&bp->b_lru)) {
>> - atomic_inc(&bp->b_hold);
>> - list_add_tail(&bp->b_lru, &btp->bt_lru);
>> - btp->bt_lru_nr++;
>> + if (list_lru_add(&bp->b_target->bt_lru, &bp->b_lru)) {
>> bp->b_lru_flags &= ~_XBF_LRU_DISPOSE;
>> + atomic_inc(&bp->b_hold);
>> }
>> - spin_unlock(&btp->bt_lru_lock);
>> }
>>
>> /*
>> @@ -107,24 +101,13 @@ xfs_buf_lru_add(
>> * The unlocked check is safe here because it only occurs when there are not
>> * b_lru_ref counts left on the inode under the pag->pag_buf_lock. it is there
>> * to optimise the shrinker removing the buffer from the LRU and calling
>> - * xfs_buf_free(). i.e. it removes an unnecessary round trip on the
>> - * bt_lru_lock.
>> + * xfs_buf_free().
>> */
>> -STATIC void
>> +static void
>> xfs_buf_lru_del(
>> struct xfs_buf *bp)
>> {
>> - struct xfs_buftarg *btp = bp->b_target;
>> -
>> - if (list_empty(&bp->b_lru))
>> - return;
>> -
>> - spin_lock(&btp->bt_lru_lock);
>> - if (!list_empty(&bp->b_lru)) {
>> - list_del_init(&bp->b_lru);
>> - btp->bt_lru_nr--;
>> - }
>> - spin_unlock(&btp->bt_lru_lock);
>> + list_lru_del(&bp->b_target->bt_lru, &bp->b_lru);
>> }
>>
>> /*
>> @@ -151,18 +134,10 @@ xfs_buf_stale(
>> bp->b_flags &= ~_XBF_DELWRI_Q;
>>
>> atomic_set(&(bp)->b_lru_ref, 0);
>> - if (!list_empty(&bp->b_lru)) {
>> - struct xfs_buftarg *btp = bp->b_target;
>> -
>> - spin_lock(&btp->bt_lru_lock);
>> - if (!list_empty(&bp->b_lru) &&
>> - !(bp->b_lru_flags & _XBF_LRU_DISPOSE)) {
>> - list_del_init(&bp->b_lru);
>> - btp->bt_lru_nr--;
>> - atomic_dec(&bp->b_hold);
>> - }
>> - spin_unlock(&btp->bt_lru_lock);
>> - }
>> + if (!(bp->b_lru_flags & _XBF_LRU_DISPOSE) &&
>> + (list_lru_del(&bp->b_target->bt_lru, &bp->b_lru)))
>> + atomic_dec(&bp->b_hold);
>> +
>> ASSERT(atomic_read(&bp->b_hold) >= 1);
>> }
>>
>> @@ -1498,83 +1473,95 @@ xfs_buf_iomove(
>> * returned. These buffers will have an elevated hold count, so wait on those
>> * while freeing all the buffers only held by the LRU.
>> */
>> -void
>> -xfs_wait_buftarg(
>> - struct xfs_buftarg *btp)
>> +static int
>
> static enum lru_status
>
Uggh, I converted the inode and dcache and forgot to convert xfs. Thanks
for spotting, Greg!
>
next prev parent reply other threads:[~2013-04-15 10:14 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-08 14:00 [PATCH v3 00/32] memcg-aware slab shrinking with lasers and numbers Glauber Costa
[not found] ` <1365429659-22108-1-git-send-email-glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2013-04-08 14:00 ` [PATCH v3 01/32] super: fix calculation of shrinkable objects for small numbers Glauber Costa
2013-04-08 14:00 ` [PATCH v3 02/32] vmscan: take at least one pass with shrinkers Glauber Costa
2013-04-08 14:00 ` [PATCH v3 06/32] mm: new shrinker API Glauber Costa
2013-04-08 14:00 ` [PATCH v3 07/32] shrinker: convert superblock shrinkers to new API Glauber Costa
2013-04-08 14:00 ` [PATCH v3 10/32] dcache: convert to use new lru list infrastructure Glauber Costa
2013-04-08 14:00 ` [PATCH v3 14/32] xfs: convert buftarg LRU to generic code Glauber Costa
2013-04-15 5:38 ` Greg Thelen
[not found] ` <xr9361zo8iav.fsf-aSPv4SP+Du0KgorLzL7FmE7CuiCeIGUxQQ4Iyu8u01E@public.gmane.org>
2013-04-15 10:14 ` Glauber Costa [this message]
2013-04-08 14:00 ` [PATCH v3 15/32] xfs: convert dquot cache lru to list_lru Glauber Costa
2013-04-08 14:00 ` [PATCH v3 17/32] drivers: convert shrinkers to new count/scan API Glauber Costa
2013-04-08 14:00 ` [PATCH v3 19/32] hugepage: convert huge zero page shrinker to new shrinker API Glauber Costa
2013-04-15 5:38 ` Greg Thelen
2013-04-15 8:10 ` Kirill A. Shutemov
2013-04-08 14:00 ` [PATCH v3 21/32] vmscan: also shrink slab in memcg pressure Glauber Costa
2013-04-08 14:00 ` [PATCH v3 22/32] memcg,list_lru: duplicate LRUs upon kmemcg creation Glauber Costa
2013-04-08 14:00 ` [PATCH v3 24/32] list_lru: also include memcg lists in counts and scans Glauber Costa
2013-04-08 14:00 ` [PATCH v3 28/32] memcg: scan cache objects hierarchically Glauber Costa
2013-04-08 14:00 ` [PATCH v3 30/32] memcg: shrink dead memcgs upon global memory pressure Glauber Costa
2013-04-08 14:00 ` [PATCH v3 32/32] memcg: debugging facility to access dangling memcgs Glauber Costa
2013-04-08 20:51 ` [PATCH v3 00/32] memcg-aware slab shrinking with lasers and numbers Andrew Morton
[not found] ` <20130408135128.a5a8b0e5b041f58f9e976bf7-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2013-04-09 7:25 ` Glauber Costa
2013-04-08 14:00 ` [PATCH v3 03/32] dcache: convert dentry_stat.nr_unused to per-cpu counters Glauber Costa
2013-04-08 14:00 ` [PATCH v3 04/32] dentry: move to per-sb LRU locks Glauber Costa
2013-04-08 14:00 ` [PATCH v3 05/32] dcache: remove dentries from LRU before putting on dispose list Glauber Costa
2013-04-08 14:00 ` [PATCH v3 08/32] list: add a new LRU list type Glauber Costa
2013-04-15 5:35 ` Greg Thelen
[not found] ` <xr93r4ic8ify.fsf-aSPv4SP+Du0KgorLzL7FmE7CuiCeIGUxQQ4Iyu8u01E@public.gmane.org>
2013-04-15 17:56 ` Greg Thelen
2013-04-16 14:43 ` Glauber Costa
2013-04-08 14:00 ` [PATCH v3 09/32] inode: convert inode lru list to generic lru list code Glauber Costa
2013-04-08 14:00 ` [PATCH v3 11/32] list_lru: per-node list infrastructure Glauber Costa
2013-04-15 5:37 ` Greg Thelen
2013-04-08 14:00 ` [PATCH v3 12/32] shrinker: add node awareness Glauber Costa
2013-04-15 5:38 ` Greg Thelen
2013-04-08 14:00 ` [PATCH v3 13/32] fs: convert inode and dentry shrinking to be node aware Glauber Costa
2013-04-08 14:00 ` [PATCH v3 16/32] fs: convert fs shrinkers to new scan/count API Glauber Costa
2013-04-08 14:00 ` [PATCH v3 18/32] shrinker: convert remaining shrinkers to count/scan API Glauber Costa
2013-04-08 14:00 ` [PATCH v3 20/32] shrinker: Kill old ->shrink API Glauber Costa
2013-04-15 5:38 ` Greg Thelen
2013-04-08 14:00 ` [PATCH v3 23/32] lru: add an element to a memcg list Glauber Costa
2013-04-08 14:00 ` [PATCH v3 25/32] list_lru: per-memcg walks Glauber Costa
2013-04-08 14:00 ` [PATCH v3 26/32] memcg: per-memcg kmem shrinking Glauber Costa
2013-04-08 14:00 ` [PATCH v3 27/32] list_lru: reclaim proportionaly between memcgs and nodes Glauber Costa
2013-04-08 14:00 ` [PATCH v3 29/32] memcg: move initialization to memcg creation Glauber Costa
2013-04-08 14:00 ` [PATCH v3 31/32] super: targeted memcg reclaim Glauber Costa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=516BD314.9000302@parallels.com \
--to=glommer-bzqdu9zft3wakbo8gow8eq@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=david-FqsqvQoI3Ljby3iVrkZq2A@public.gmane.org \
--cc=dchinner-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
--cc=hughd-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
--cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=mhocko-AlSwsSmVLrQ@public.gmane.org \
--cc=serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).