Linux Manual Pages development
 help / color / mirror / Atom feed
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;
>  }
> 

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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1453451277-20979-1-git-send-email-n-horiguchi@ah.jp.nec.com>
     [not found] ` <1453451277-20979-1-git-send-email-n-horiguchi-PaJj6Psr51x8UrSeD/g0lQ@public.gmane.org>
2016-01-27 13:59   ` Vlastimil Babka [this message]
2016-01-28  5:49     ` [PATCH v1] mm/madvise: pass return code of memory_failure() to userspace 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-alswssmvlrq@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=gong.chen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=n-horiguchi-PaJj6Psr51x8UrSeD/g0lQ@public.gmane.org \
    --cc=nao.horiguchi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox