linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: Souptick Joarder <jrdr.linux@gmail.com>,
	willy@infradead.org, akpm@linux-foundation.org,
	mark.rutland@arm.com, dvyukov@google.com, tglx@linutronix.de,
	gregkh@linuxfoundation.org, tchibo@google.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kernel/kcov: Replace vm_insert_page with vmf_insert_page
Date: Fri, 21 Sep 2018 12:37:16 +0300	[thread overview]
Message-ID: <6fa7d32b-07f0-ab6d-8053-021b171153e6@virtuozzo.com> (raw)
In-Reply-To: <20180920191254.GA22764@jordon-HP-15-Notebook-PC>

On 09/20/2018 10:12 PM, Souptick Joarder wrote:
> There is a plan to replace vm_insert_page with new API
> vmf_insert_page. As part of it, converting vm_insert_page
> to use vmf_insert_page.
> 
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
> ---
>  kernel/kcov.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/kcov.c b/kernel/kcov.c
> index 3ebd09e..8900d8e 100644
> --- a/kernel/kcov.c
> +++ b/kernel/kcov.c
> @@ -293,8 +293,9 @@ static int kcov_mmap(struct file *filep, struct vm_area_struct *vma)
>  		spin_unlock(&kcov->lock);
>  		for (off = 0; off < size; off += PAGE_SIZE) {
>  			page = vmalloc_to_page(kcov->area + off);
> -			if (vm_insert_page(vma, vma->vm_start + off, page))
> -				WARN_ONCE(1, "vm_insert_page() failed");
> +			if (vmf_insert_page(vma, vma->vm_start + off, page)
> +					!= VM_FAULT_NOPAGE)
> +				WARN_ONCE(1, "vmf_insert_page() failed");

Nack, don't see the reason for such change, it only makes code worse.



  reply	other threads:[~2018-09-21  9:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20 19:12 [PATCH] kernel/kcov: Replace vm_insert_page with vmf_insert_page Souptick Joarder
2018-09-21  9:37 ` Andrey Ryabinin [this message]
2018-09-21 10:03   ` Souptick Joarder
2018-09-21 11:53     ` Andrey Ryabinin
2018-09-21 13:25       ` Souptick Joarder
2018-09-21 14:45         ` Andrey Ryabinin
2018-09-21 16:20           ` Souptick Joarder
2018-09-22 14:22 ` Matthew Wilcox
2018-09-24  7:53   ` Souptick Joarder

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=6fa7d32b-07f0-ab6d-8053-021b171153e6@virtuozzo.com \
    --to=aryabinin@virtuozzo.com \
    --cc=akpm@linux-foundation.org \
    --cc=dvyukov@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jrdr.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=tchibo@google.com \
    --cc=tglx@linutronix.de \
    --cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).