linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Seth Jennings <sjennings@variantweb.net>
To: Jeff Liu <jeff.liu@oracle.com>
Cc: linux-mm@kvack.org, sjenning@linux.vnet.ibm.com
Subject: Re: [PATCH] mm/zbud: use list_last_entry in zbud_reclaim_page() directly
Date: Wed, 15 Jan 2014 13:48:49 -0600	[thread overview]
Message-ID: <20140115194849.GA11176@cerebellum.variantweb.net> (raw)
In-Reply-To: <52D60CF9.3010609@oracle.com>

On Wed, Jan 15, 2014 at 12:22:17PM +0800, Jeff Liu wrote:
> From: Jie Liu <jeff.liu@oracle.com>
> 
> Get rid of the self defined list_tail_entry() helper and
> use list_last_entry() in zbud_reclaim_page() directly.
> 
> Signed-off-by: Jie Liu <jeff.liu@oracle.com>

Good find :)

Acked-by: Seth Jennings <sjennings@variantweb.net>

> ---
>  mm/zbud.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/mm/zbud.c b/mm/zbud.c
> index 9451361..8ac1e97 100644
> --- a/mm/zbud.c
> +++ b/mm/zbud.c
> @@ -360,9 +360,6 @@ void zbud_free(struct zbud_pool *pool, unsigned long handle)
>  	spin_unlock(&pool->lock);
>  }
>  
> -#define list_tail_entry(ptr, type, member) \
> -	list_entry((ptr)->prev, type, member)
> -
>  /**
>   * zbud_reclaim_page() - evicts allocations from a pool page and frees it
>   * @pool:	pool from which a page will attempt to be evicted
> @@ -411,7 +408,7 @@ int zbud_reclaim_page(struct zbud_pool *pool, unsigned int retries)
>  		return -EINVAL;
>  	}
>  	for (i = 0; i < retries; i++) {
> -		zhdr = list_tail_entry(&pool->lru, struct zbud_header, lru);
> +		zhdr = list_last_entry(&pool->lru, struct zbud_header, lru);
>  		list_del(&zhdr->lru);
>  		list_del(&zhdr->buddy);
>  		/* Protect zbud page against free */
> -- 
> 1.8.3.2
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2014-01-15 19:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-15  4:22 Jeff Liu
2014-01-15 19:48 ` Seth Jennings [this message]

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=20140115194849.GA11176@cerebellum.variantweb.net \
    --to=sjennings@variantweb.net \
    --cc=jeff.liu@oracle.com \
    --cc=linux-mm@kvack.org \
    --cc=sjenning@linux.vnet.ibm.com \
    /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