All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Chen Gong <gong.chen@linux.intel.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Naoya Horiguchi <nao.horiguchi@gmail.com>,
	Linux API <linux-api@vger.kernel.org>,
	linux-man@vger.kernel.org,
	Michael Kerrisk <mtk.manpages@gmail.com>
Subject: Re: [PATCH v1] mm/madvise: pass return code of memory_failure() to userspace
Date: Wed, 27 Jan 2016 14:59:11 +0100	[thread overview]
Message-ID: <56A8CD2F.5080903@suse.cz> (raw)
In-Reply-To: <1453451277-20979-1-git-send-email-n-horiguchi@ah.jp.nec.com>

[CC += linux-api, linux-man]

On 01/22/2016 09:27 AM, Naoya Horiguchi wrote:
> Currently the return value of memory_failure() is not passed to userspace, which
> is inconvenient for test programs that want to know the result of error handling.
> So let's return it to the caller as we already do in MADV_SOFT_OFFLINE case.
> 
> Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> ---
>  mm/madvise.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git v4.4-mmotm-2016-01-20-16-10/mm/madvise.c v4.4-mmotm-2016-01-20-16-10_patched/mm/madvise.c
> index f56825b..6a77114 100644
> --- v4.4-mmotm-2016-01-20-16-10/mm/madvise.c
> +++ v4.4-mmotm-2016-01-20-16-10_patched/mm/madvise.c
> @@ -555,8 +555,9 @@ static int madvise_hwpoison(int bhv, unsigned long start, unsigned long end)
>  		}
>  		pr_info("Injecting memory failure for page %#lx at %#lx\n",
>  		       page_to_pfn(p), start);
> -		/* Ignore return value for now */
> -		memory_failure(page_to_pfn(p), 0, MF_COUNT_INCREASED);
> +		ret = memory_failure(page_to_pfn(p), 0, MF_COUNT_INCREASED);
> +		if (ret)
> +			return ret;

Can you explain what madvise can newly return for MADV_HWPOISON in which
situations, for the purposes of updated man page?

Thanks,
Vlastimil

>  	}
>  	return 0;
>  }
> 

WARNING: multiple messages have this Message-ID (diff)
From: Vlastimil Babka <vbabka-AlSwsSmVLrQ@public.gmane.org>
To: Naoya Horiguchi
	<n-horiguchi-PaJj6Psr51x8UrSeD/g0lQ@public.gmane.org>,
	Andrew Morton
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Cc: Chen Gong <gong.chen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Naoya Horiguchi
	<nao.horiguchi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Linux API <linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Michael Kerrisk
	<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH v1] mm/madvise: pass return code of memory_failure() to userspace
Date: Wed, 27 Jan 2016 14:59:11 +0100	[thread overview]
Message-ID: <56A8CD2F.5080903@suse.cz> (raw)
In-Reply-To: <1453451277-20979-1-git-send-email-n-horiguchi-PaJj6Psr51x8UrSeD/g0lQ@public.gmane.org>

[CC += linux-api, linux-man]

On 01/22/2016 09:27 AM, Naoya Horiguchi wrote:
> Currently the return value of memory_failure() is not passed to userspace, which
> is inconvenient for test programs that want to know the result of error handling.
> So let's return it to the caller as we already do in MADV_SOFT_OFFLINE case.
> 
> Signed-off-by: Naoya Horiguchi <n-horiguchi-PaJj6Psr51x8UrSeD/g0lQ@public.gmane.org>
> ---
>  mm/madvise.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git v4.4-mmotm-2016-01-20-16-10/mm/madvise.c v4.4-mmotm-2016-01-20-16-10_patched/mm/madvise.c
> index f56825b..6a77114 100644
> --- v4.4-mmotm-2016-01-20-16-10/mm/madvise.c
> +++ v4.4-mmotm-2016-01-20-16-10_patched/mm/madvise.c
> @@ -555,8 +555,9 @@ static int madvise_hwpoison(int bhv, unsigned long start, unsigned long end)
>  		}
>  		pr_info("Injecting memory failure for page %#lx at %#lx\n",
>  		       page_to_pfn(p), start);
> -		/* Ignore return value for now */
> -		memory_failure(page_to_pfn(p), 0, MF_COUNT_INCREASED);
> +		ret = memory_failure(page_to_pfn(p), 0, MF_COUNT_INCREASED);
> +		if (ret)
> +			return ret;

Can you explain what madvise can newly return for MADV_HWPOISON in which
situations, for the purposes of updated man page?

Thanks,
Vlastimil

>  	}
>  	return 0;
>  }
> 

WARNING: multiple messages have this Message-ID (diff)
From: Vlastimil Babka <vbabka@suse.cz>
To: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Chen Gong <gong.chen@linux.intel.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Naoya Horiguchi <nao.horiguchi@gmail.com>,
	Linux API <linux-api@vger.kernel.org>,
	linux-man@vger.kernel.org,
	Michael Kerrisk <mtk.manpages@gmail.com>
Subject: Re: [PATCH v1] mm/madvise: pass return code of memory_failure() to userspace
Date: Wed, 27 Jan 2016 14:59:11 +0100	[thread overview]
Message-ID: <56A8CD2F.5080903@suse.cz> (raw)
In-Reply-To: <1453451277-20979-1-git-send-email-n-horiguchi@ah.jp.nec.com>

[CC += linux-api, linux-man]

On 01/22/2016 09:27 AM, Naoya Horiguchi wrote:
> Currently the return value of memory_failure() is not passed to userspace, which
> is inconvenient for test programs that want to know the result of error handling.
> So let's return it to the caller as we already do in MADV_SOFT_OFFLINE case.
> 
> Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> ---
>  mm/madvise.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git v4.4-mmotm-2016-01-20-16-10/mm/madvise.c v4.4-mmotm-2016-01-20-16-10_patched/mm/madvise.c
> index f56825b..6a77114 100644
> --- v4.4-mmotm-2016-01-20-16-10/mm/madvise.c
> +++ v4.4-mmotm-2016-01-20-16-10_patched/mm/madvise.c
> @@ -555,8 +555,9 @@ static int madvise_hwpoison(int bhv, unsigned long start, unsigned long end)
>  		}
>  		pr_info("Injecting memory failure for page %#lx at %#lx\n",
>  		       page_to_pfn(p), start);
> -		/* Ignore return value for now */
> -		memory_failure(page_to_pfn(p), 0, MF_COUNT_INCREASED);
> +		ret = memory_failure(page_to_pfn(p), 0, MF_COUNT_INCREASED);
> +		if (ret)
> +			return ret;

Can you explain what madvise can newly return for MADV_HWPOISON in which
situations, for the purposes of updated man page?

Thanks,
Vlastimil

>  	}
>  	return 0;
>  }
> 

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

  parent reply	other threads:[~2016-01-27 13:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-22  8:27 [PATCH v1] mm/madvise: pass return code of memory_failure() to userspace Naoya Horiguchi
2016-01-22  8:27 ` Naoya Horiguchi
2016-01-26 23:27 ` Andrew Morton
2016-01-26 23:27   ` Andrew Morton
2016-01-27  1:26   ` Naoya Horiguchi
2016-01-27  1:26     ` Naoya Horiguchi
2016-01-27 13:59 ` Vlastimil Babka [this message]
2016-01-27 13:59   ` Vlastimil Babka
2016-01-27 13:59   ` Vlastimil Babka
2016-01-28  5:49   ` Naoya Horiguchi
2016-01-28  5:49     ` Naoya Horiguchi

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=56A8CD2F.5080903@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=gong.chen@linux.intel.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mtk.manpages@gmail.com \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=nao.horiguchi@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.