linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] introduce page_ref_inc_return
@ 2016-06-20 10:38 Christian Borntraeger
  2016-06-20 10:38 ` [PATCH 1/1] mm/page_ref: " Christian Borntraeger
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Borntraeger @ 2016-06-20 10:38 UTC (permalink / raw)
  To: Andrew Morton, linux-mm
  Cc: Paolo Bonzini, Radim Krčmář,
	KVM, Cornelia Huck, linux-s390, Christian Borntraeger,
	David Hildenbrand, linux-kernel, Vlastimil Babka, Joonsoo Kim

commit 0139aa7b7fa1 ("mm: rename _count, field of the struct page,
to _refcount") changed all accesses to page->_count to use wrappers.
There is already a page_ref_dec_return and we need for kvm/s390
code the function "page_ref_inc_return" as well.

FWIW, the code is under
https://git.kernel.org/cgit/linux/kernel/git/kvms390/linux.git/log/?h=next


Can I get an ack to carry this patch via the KVM/s390 tree (will
be merged into Paolos kvm tree soon)?

David Hildenbrand (1):
  mm/page_ref: introduce page_ref_inc_return

 include/linux/page_ref.h | 9 +++++++++
 1 file changed, 9 insertions(+)

-- 
2.5.5

--
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] 3+ messages in thread

* [PATCH 1/1] mm/page_ref: introduce page_ref_inc_return
  2016-06-20 10:38 [PATCH 0/1] introduce page_ref_inc_return Christian Borntraeger
@ 2016-06-20 10:38 ` Christian Borntraeger
  2016-06-20 23:11   ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Borntraeger @ 2016-06-20 10:38 UTC (permalink / raw)
  To: Andrew Morton, linux-mm
  Cc: Paolo Bonzini, Radim Krčmář,
	KVM, Cornelia Huck, linux-s390, Christian Borntraeger,
	David Hildenbrand, linux-kernel, Vlastimil Babka, Joonsoo Kim

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

--
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 related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] mm/page_ref: introduce page_ref_inc_return
  2016-06-20 10:38 ` [PATCH 1/1] mm/page_ref: " Christian Borntraeger
@ 2016-06-20 23:11   ` Andrew Morton
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2016-06-20 23:11 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: linux-mm, Paolo Bonzini, Radim Krčmář,
	KVM, Cornelia Huck, linux-s390, David Hildenbrand, linux-kernel,
	Vlastimil Babka, Joonsoo Kim

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>

--
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] 3+ messages in thread

end of thread, other threads:[~2016-06-20 23:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-20 10:38 [PATCH 0/1] introduce page_ref_inc_return Christian Borntraeger
2016-06-20 10:38 ` [PATCH 1/1] mm/page_ref: " Christian Borntraeger
2016-06-20 23:11   ` Andrew Morton

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).