* [PATCH] mm/zbud: use list_last_entry in zbud_reclaim_page() directly
@ 2014-01-15 4:22 Jeff Liu
2014-01-15 19:48 ` Seth Jennings
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Liu @ 2014-01-15 4:22 UTC (permalink / raw)
To: linux-mm; +Cc: sjenning
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>
---
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>
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] mm/zbud: use list_last_entry in zbud_reclaim_page() directly
2014-01-15 4:22 [PATCH] mm/zbud: use list_last_entry in zbud_reclaim_page() directly Jeff Liu
@ 2014-01-15 19:48 ` Seth Jennings
0 siblings, 0 replies; 2+ messages in thread
From: Seth Jennings @ 2014-01-15 19:48 UTC (permalink / raw)
To: Jeff Liu; +Cc: linux-mm, sjenning
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-15 19:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-15 4:22 [PATCH] mm/zbud: use list_last_entry in zbud_reclaim_page() directly Jeff Liu
2014-01-15 19:48 ` Seth Jennings
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox