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


Groups > linux.kernel > #1204200 > unrolled thread

[PATCH v2 3/5] mm/hwpoison: introduce put_hwpoison_page to put refcount for memory error handling

Started byWanpeng Li <wanpeng.li@hotmail.com>
First post2015-08-10 14:00 +0200
Last post2015-08-12 11:00 +0200
Articles 5 — 3 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 v2 3/5] mm/hwpoison: introduce put_hwpoison_page to put refcount for memory error handling Wanpeng Li <wanpeng.li@hotmail.com> - 2015-08-10 14:00 +0200
    Re: [PATCH v2 3/5] mm/hwpoison: introduce put_hwpoison_page to put  refcount for memory error handling Andrew Morton <akpm@linux-foundation.org> - 2015-08-12 01:30 +0200
      Re: [PATCH v2 3/5] mm/hwpoison: introduce put_hwpoison_page to put  refcount for memory error handling Wanpeng Li <wanpeng.li@hotmail.com> - 2015-08-12 02:00 +0200
      Re: [PATCH v2 3/5] mm/hwpoison: introduce put_hwpoison_page to put  refcount for memory error handling Wanpeng Li <wanpeng.li@hotmail.com> - 2015-08-12 04:40 +0200
    Re: [PATCH v2 3/5] mm/hwpoison: introduce put_hwpoison_page to put  refcount for memory error handling Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> - 2015-08-12 11:00 +0200

#1204200 — [PATCH v2 3/5] mm/hwpoison: introduce put_hwpoison_page to put refcount for memory error handling

FromWanpeng Li <wanpeng.li@hotmail.com>
Date2015-08-10 14:00 +0200
Subject[PATCH v2 3/5] mm/hwpoison: introduce put_hwpoison_page to put refcount for memory error handling
Message-ID<pVTUf-5qn-25@gated-at.bofh.it>
Introduce put_hwpoison_page to put refcount for memory 
error handling. 

Suggested-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
---
 include/linux/mm.h  |    1 +
 mm/memory-failure.c |   21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 554b0f0..c0a0b9f 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2103,6 +2103,7 @@ extern int memory_failure(unsigned long pfn, int trapno, int flags);
 extern void memory_failure_queue(unsigned long pfn, int trapno, int flags);
 extern int unpoison_memory(unsigned long pfn);
 extern int get_hwpoison_page(struct page *page);
+extern void put_hwpoison_page(struct page *page);
 extern int sysctl_memory_failure_early_kill;
 extern int sysctl_memory_failure_recovery;
 extern void shake_page(struct page *p, int access);
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index e0eb7ab..fa9aa21 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -922,6 +922,27 @@ int get_hwpoison_page(struct page *page)
 }
 EXPORT_SYMBOL_GPL(get_hwpoison_page);
 
+/**
+ * put_hwpoison_page() - Put refcount for memory error handling:
+ * @page:	raw error page (hit by memory error)
+ */
+void put_hwpoison_page(struct page *page)
+{
+	struct page *head = compound_head(page);
+
+	if (PageHuge(head)) {
+		put_page(head);
+		return;
+	}
+
+	if (PageTransHuge(head))
+		if (page != head)
+			put_page(head);
+
+	put_page(page);
+}
+EXPORT_SYMBOL_GPL(put_hwpoison_page);
+
 /*
  * Do all that is necessary to remove user space mappings. Unmap
  * the pages and send SIGBUS to the processes if the data was dirty.
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1205497 — Re: [PATCH v2 3/5] mm/hwpoison: introduce put_hwpoison_page to put refcount for memory error handling

FromAndrew Morton <akpm@linux-foundation.org>
Date2015-08-12 01:30 +0200
SubjectRe: [PATCH v2 3/5] mm/hwpoison: introduce put_hwpoison_page to put refcount for memory error handling
Message-ID<pWr9w-37t-3@gated-at.bofh.it>
In reply to#1204200
On Mon, 10 Aug 2015 19:28:21 +0800 Wanpeng Li <wanpeng.li@hotmail.com> wrote:

> Introduce put_hwpoison_page to put refcount for memory 
> error handling. 
> 
> ...
>
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -922,6 +922,27 @@ int get_hwpoison_page(struct page *page)
>  }
>  EXPORT_SYMBOL_GPL(get_hwpoison_page);
>  
> +/**
> + * put_hwpoison_page() - Put refcount for memory error handling:
> + * @page:	raw error page (hit by memory error)
> + */
> +void put_hwpoison_page(struct page *page)
> +{
> +	struct page *head = compound_head(page);
> +
> +	if (PageHuge(head)) {
> +		put_page(head);
> +		return;
> +	}
> +
> +	if (PageTransHuge(head))
> +		if (page != head)
> +			put_page(head);
> +
> +	put_page(page);
> +}
> +EXPORT_SYMBOL_GPL(put_hwpoison_page);

I don't believe the export is needed?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1205510 — Re: [PATCH v2 3/5] mm/hwpoison: introduce put_hwpoison_page to put refcount for memory error handling

FromWanpeng Li <wanpeng.li@hotmail.com>
Date2015-08-12 02:00 +0200
SubjectRe: [PATCH v2 3/5] mm/hwpoison: introduce put_hwpoison_page to put refcount for memory error handling
Message-ID<pWrCx-3Fa-3@gated-at.bofh.it>
In reply to#1205497

On 8/12/15 7:24 AM, Andrew Morton wrote:
> On Mon, 10 Aug 2015 19:28:21 +0800 Wanpeng Li <wanpeng.li@hotmail.com> wrote:
>
>> Introduce put_hwpoison_page to put refcount for memory
>> error handling.
>>
>> ...
>>
>> --- a/mm/memory-failure.c
>> +++ b/mm/memory-failure.c
>> @@ -922,6 +922,27 @@ int get_hwpoison_page(struct page *page)
>>   }
>>   EXPORT_SYMBOL_GPL(get_hwpoison_page);
>>   
>> +/**
>> + * put_hwpoison_page() - Put refcount for memory error handling:
>> + * @page:	raw error page (hit by memory error)
>> + */
>> +void put_hwpoison_page(struct page *page)
>> +{
>> +	struct page *head = compound_head(page);
>> +
>> +	if (PageHuge(head)) {
>> +		put_page(head);
>> +		return;
>> +	}
>> +
>> +	if (PageTransHuge(head))
>> +		if (page != head)
>> +			put_page(head);
>> +
>> +	put_page(page);
>> +}
>> +EXPORT_SYMBOL_GPL(put_hwpoison_page);
> I don't believe the export is needed?

Indeed, thanks for your fix. :-)

Regards,
Wanpeng Li

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1205557 — Re: [PATCH v2 3/5] mm/hwpoison: introduce put_hwpoison_page to put refcount for memory error handling

FromWanpeng Li <wanpeng.li@hotmail.com>
Date2015-08-12 04:40 +0200
SubjectRe: [PATCH v2 3/5] mm/hwpoison: introduce put_hwpoison_page to put refcount for memory error handling
Message-ID<pWu7n-7pH-1@gated-at.bofh.it>
In reply to#1205497

On 8/12/15 7:24 AM, Andrew Morton wrote:
> On Mon, 10 Aug 2015 19:28:21 +0800 Wanpeng Li <wanpeng.li@hotmail.com> wrote:
>
>> Introduce put_hwpoison_page to put refcount for memory
>> error handling.
>>
>> ...
>>
>> --- a/mm/memory-failure.c
>> +++ b/mm/memory-failure.c
>> @@ -922,6 +922,27 @@ int get_hwpoison_page(struct page *page)
>>   }
>>   EXPORT_SYMBOL_GPL(get_hwpoison_page);
>>   
>> +/**
>> + * put_hwpoison_page() - Put refcount for memory error handling:
>> + * @page:	raw error page (hit by memory error)
>> + */
>> +void put_hwpoison_page(struct page *page)
>> +{
>> +	struct page *head = compound_head(page);
>> +
>> +	if (PageHuge(head)) {
>> +		put_page(head);
>> +		return;
>> +	}
>> +
>> +	if (PageTransHuge(head))
>> +		if (page != head)
>> +			put_page(head);
>> +
>> +	put_page(page);
>> +}
>> +EXPORT_SYMBOL_GPL(put_hwpoison_page);
> I don't believe the export is needed?

ERROR: "put_hwpoison_page" [mm/hwpoison-inject.ko] undefined!
So I'm afraid it should be needed.

Regards,
Wanpeng Li

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1205722 — Re: [PATCH v2 3/5] mm/hwpoison: introduce put_hwpoison_page to put refcount for memory error handling

FromNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Date2015-08-12 11:00 +0200
SubjectRe: [PATCH v2 3/5] mm/hwpoison: introduce put_hwpoison_page to put refcount for memory error handling
Message-ID<pWA39-7Qw-39@gated-at.bofh.it>
In reply to#1204200
On Mon, Aug 10, 2015 at 07:28:21PM +0800, Wanpeng Li wrote:
> Introduce put_hwpoison_page to put refcount for memory 
> error handling. 
> 
> Suggested-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>

Thanks!

Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>

> ---
>  include/linux/mm.h  |    1 +
>  mm/memory-failure.c |   21 +++++++++++++++++++++
>  2 files changed, 22 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 554b0f0..c0a0b9f 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -2103,6 +2103,7 @@ extern int memory_failure(unsigned long pfn, int trapno, int flags);
>  extern void memory_failure_queue(unsigned long pfn, int trapno, int flags);
>  extern int unpoison_memory(unsigned long pfn);
>  extern int get_hwpoison_page(struct page *page);
> +extern void put_hwpoison_page(struct page *page);
>  extern int sysctl_memory_failure_early_kill;
>  extern int sysctl_memory_failure_recovery;
>  extern void shake_page(struct page *p, int access);
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index e0eb7ab..fa9aa21 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -922,6 +922,27 @@ int get_hwpoison_page(struct page *page)
>  }
>  EXPORT_SYMBOL_GPL(get_hwpoison_page);
>  
> +/**
> + * put_hwpoison_page() - Put refcount for memory error handling:
> + * @page:	raw error page (hit by memory error)
> + */
> +void put_hwpoison_page(struct page *page)
> +{
> +	struct page *head = compound_head(page);
> +
> +	if (PageHuge(head)) {
> +		put_page(head);
> +		return;
> +	}
> +
> +	if (PageTransHuge(head))
> +		if (page != head)
> +			put_page(head);
> +
> +	put_page(page);
> +}
> +EXPORT_SYMBOL_GPL(put_hwpoison_page);
> +
>  /*
>   * Do all that is necessary to remove user space mappings. Unmap
>   * the pages and send SIGBUS to the processes if the data was dirty.
> -- 
> 1.7.1
> --
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web