linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Souptick Joarder <jrdr.linux@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Mark Rutland <mark.rutland@arm.com>,
	aryabinin@virtuozzo.com, Dmitry Vyukov <dvyukov@google.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Greg KH <gregkh@linuxfoundation.org>,
	tchibo@google.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kernel/kcov: Replace vm_insert_page with vmf_insert_page
Date: Mon, 24 Sep 2018 13:23:05 +0530	[thread overview]
Message-ID: <CAFqt6za2iZDwoemUBSGb0BUnWffOH4Ek5hpEbmFMepw655QfNA@mail.gmail.com> (raw)
In-Reply-To: <20180922142241.GD14042@bombadil.infradead.org>

On Sat, Sep 22, 2018 at 7:52 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Fri, Sep 21, 2018 at 12:42:54AM +0530, Souptick Joarder wrote:
> >               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");
> >               }
>
> I think this is the wrong approach (as well as being buggy).
>
> We should have a vmalloc_insert_range() _or something similar_ that
> replaces this entire loop.  That makes each _user_ simpler.  What you're
> trying to do right now makes each user more complex, and that's the
> wrong approach.

There are two different opinions here.

Andrey mentioned, to use vmf_insert_page() in fault handlers context and
not to remove vm_insert_page in his review comments.

And your opinion is to have vmalloc_insert_range() _or something similar_
that will replace whole loop. with this vm_insert_page will be removed.

Which one is better to go with ??

      reply	other threads:[~2018-09-24  7:53 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
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 [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=CAFqt6za2iZDwoemUBSGb0BUnWffOH4Ek5hpEbmFMepw655QfNA@mail.gmail.com \
    --to=jrdr.linux@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=aryabinin@virtuozzo.com \
    --cc=dvyukov@google.com \
    --cc=gregkh@linuxfoundation.org \
    --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).