From: Janosch Frank <frankja@linux.ibm.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>,
Janosch Frank <frankja@linux.vnet.ibm.com>
Cc: KVM <kvm@vger.kernel.org>, David Hildenbrand <david@redhat.com>,
linux-s390 <linux-s390@vger.kernel.org>,
Cornelia Huck <cohuck@redhat.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>
Subject: Re: [PATCH] s390/gmap: return proper error code on ksm unsharing
Date: Fri, 27 Mar 2020 10:10:27 +0100 [thread overview]
Message-ID: <c1a20f51-e39d-f8c6-2bac-e374017f46dd@linux.ibm.com> (raw)
In-Reply-To: <20200327085602.24535-1-borntraeger@de.ibm.com>
[-- Attachment #1.1: Type: text/plain, Size: 1330 bytes --]
On 3/27/20 9:56 AM, Christian Borntraeger wrote:
> If a signal is pending we might return -ENOMEM instead of -EINTR.
> We should propagate the proper error during KSM unsharing.
>
> Fixes: 3ac8e38015d4 ("s390/mm: disable KSM for storage key enabled pages")
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.vnet.ibm.com>
> ---
> arch/s390/mm/gmap.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c
> index 27926a06df32..2bf63035a295 100644
> --- a/arch/s390/mm/gmap.c
> +++ b/arch/s390/mm/gmap.c
> @@ -2552,15 +2552,16 @@ int gmap_mark_unmergeable(void)
> {
> struct mm_struct *mm = current->mm;
> struct vm_area_struct *vma;
> + int ret = 0;
>
> for (vma = mm->mmap; vma; vma = vma->vm_next) {
> - if (ksm_madvise(vma, vma->vm_start, vma->vm_end,
> - MADV_UNMERGEABLE, &vma->vm_flags)) {
> - return -ENOMEM;
> - }
> + ret = ksm_madvise(vma, vma->vm_start, vma->vm_end,
> + MADV_UNMERGEABLE, &vma->vm_flags);
> + if (ret)
> + return ret;
> }
> mm->def_flags &= ~VM_MERGEABLE;
> - return 0;
> + return ret;
That part is not really necessary but also doesn't hurt.
> }
> EXPORT_SYMBOL_GPL(gmap_mark_unmergeable);
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2020-03-27 9:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-27 8:56 [PATCH] s390/gmap: return proper error code on ksm unsharing Christian Borntraeger
2020-03-27 8:59 ` Julian Wiedmann
2020-03-27 9:07 ` David Hildenbrand
2020-03-27 9:08 ` Christian Borntraeger
2020-03-27 9:10 ` Janosch Frank [this message]
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=c1a20f51-e39d-f8c6-2bac-e374017f46dd@linux.ibm.com \
--to=frankja@linux.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=frankja@linux.vnet.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.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