[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFqt6za2iZDwoemUBSGb0BUnWffOH4Ek5hpEbmFMepw655QfNA@mail.gmail.com>
Date: Mon, 24 Sep 2018 13:23:05 +0530
From: Souptick Joarder <jrdr.linux@...il.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Mark Rutland <mark.rutland@....com>, aryabinin@...tuozzo.com,
Dmitry Vyukov <dvyukov@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>,
Greg KH <gregkh@...uxfoundation.org>, tchibo@...gle.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kernel/kcov: Replace vm_insert_page with vmf_insert_page
On Sat, Sep 22, 2018 at 7:52 PM Matthew Wilcox <willy@...radead.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 ??
Powered by blists - more mailing lists