Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1426603 > unrolled thread

[PATCH 1/1] mm/page_ref: introduce page_ref_inc_return

Started byChristian Borntraeger <borntraeger@de.ibm.com>
First post2016-06-20 15:30 +0200
Last post2016-06-21 01:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/1] mm/page_ref: introduce page_ref_inc_return Christian Borntraeger <borntraeger@de.ibm.com> - 2016-06-20 15:30 +0200
    Re: [PATCH 1/1] mm/page_ref: introduce page_ref_inc_return Andrew Morton <akpm@linux-foundation.org> - 2016-06-21 01:20 +0200

#1426603 — [PATCH 1/1] mm/page_ref: introduce page_ref_inc_return

FromChristian Borntraeger <borntraeger@de.ibm.com>
Date2016-06-20 15:30 +0200
Subject[PATCH 1/1] mm/page_ref: introduce page_ref_inc_return
Message-ID<rM7r4-jP-33@gated-at.bofh.it>
From: David Hildenbrand <dahi@linux.vnet.ibm.com>

Let's introduce that helper.

Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 include/linux/page_ref.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/linux/page_ref.h b/include/linux/page_ref.h
index 8b5e0a9..610e132 100644
--- a/include/linux/page_ref.h
+++ b/include/linux/page_ref.h
@@ -124,6 +124,15 @@ static inline int page_ref_sub_and_test(struct page *page, int nr)
 	return ret;
 }
 
+static inline int page_ref_inc_return(struct page *page)
+{
+	int ret = atomic_inc_return(&page->_refcount);
+
+	if (page_ref_tracepoint_active(__tracepoint_page_ref_mod_and_return))
+		__page_ref_mod_and_return(page, 1, ret);
+	return ret;
+}
+
 static inline int page_ref_dec_and_test(struct page *page)
 {
 	int ret = atomic_dec_and_test(&page->_refcount);
-- 
2.5.5

[toc] | [next] | [standalone]


#1427125

FromAndrew Morton <akpm@linux-foundation.org>
Date2016-06-21 01:20 +0200
Message-ID<rMgE1-6eH-5@gated-at.bofh.it>
In reply to#1426603
On Mon, 20 Jun 2016 12:38:13 +0200 Christian Borntraeger <borntraeger@de.ibm.com> wrote:

> From: David Hildenbrand <dahi@linux.vnet.ibm.com>
> 
> Let's introduce that helper.
> 
> ...
>
> +static inline int page_ref_inc_return(struct page *page)
> +{
> +	int ret = atomic_inc_return(&page->_refcount);
> +
> +	if (page_ref_tracepoint_active(__tracepoint_page_ref_mod_and_return))
> +		__page_ref_mod_and_return(page, 1, ret);
> +	return ret;
> +}

Acked-by: Andrew Morton <akpm@linux-foundation.org>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web