linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Joel Fernandes <joel@joelfernandes.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>,
	 "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Linux-MM <linux-mm@kvack.org>,
	 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Naresh Kamboju <naresh.kamboju@linaro.org>,
	 William Kucharski <william.kucharski@oracle.com>
Subject: Re: [PATCHv2] mm: Fix warning in move_normal_pmd()
Date: Thu, 16 Jul 2020 14:47:35 -0400	[thread overview]
Message-ID: <CAEXW_YRWDwUVrvedLtoMssFcrwAnWHAQ0CWNbR4UF=GS18B3wA@mail.gmail.com> (raw)
In-Reply-To: <CAHk-=wi1PKGsk-Nr_Jd1vHGqg5AjTUtJkeh9R-a9SN-H=i2-1A@mail.gmail.com>

On Thu, Jul 16, 2020 at 1:55 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> On Thu, Jul 16, 2020 at 6:16 AM Kirill A. Shutemov <kirill@shutemov.name> wrote:
> >
> > It can also lead to performance regression: for small mremap() if only one
> > side of the range got aligned and there's no PMD_SIZE range to move,
> > kernel will still iterate over PTEs, but it would need to handle more
> > pte_none()s than without the patch.
>
> Ack, I've dropped the patch from my queue of experiments, because it
> doesn't work for the case I wanted to do, and the other cases could
> regress, as you say.
>
> Plus considering how many problems that patch had, I decided it wasn't
> as simple as I initially thought it would be anyway ;)
>
> Joel - while it's gone from my mind, if you're still interested in
> this, maybe you can do something _similar_ that patch, except perhaps
> also start out checking that the initial size is large enough for this
> to make sense even when one of the sides doesn't align, for example.
>
> (It might be as simple as checking that the initial 'len' is at least
> PMD_SIZE - then you're guaranteed that whichever side gets aligned,
> it's not doing extra work because the other side didn't).

Hi Linus,
Yes I'm quite interested in doing a similar patch and also adding some
test cases to make sure it always works properly. Probably I can add
some kselftest cases doing mremap on various ranges.

I think it will be a great optimization to trigger the PMD move more
often. I'll work on it and get back hopefully soon on this, Thanks!

 - Joel


  reply	other threads:[~2020-07-16 18:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15 13:50 Kirill A. Shutemov
2020-07-15 18:36 ` Linus Torvalds
2020-07-15 20:54   ` Joel Fernandes
2020-07-15 21:13     ` Kirill A. Shutemov
2020-07-15 21:31     ` Linus Torvalds
2020-07-15 21:43       ` Linus Torvalds
2020-07-15 22:22         ` Kirill A. Shutemov
2020-07-15 22:36           ` Linus Torvalds
2020-07-15 22:57           ` Linus Torvalds
2020-07-15 23:04             ` Linus Torvalds
2020-07-15 23:18               ` Linus Torvalds
2020-07-16  6:37                 ` Naresh Kamboju
2020-07-16  7:23                   ` Naresh Kamboju
2020-07-16  8:46                     ` Kirill A. Shutemov
2020-07-16  8:32                 ` Naresh Kamboju
2020-07-16 13:16                 ` Kirill A. Shutemov
2020-07-16 17:54                   ` Linus Torvalds
2020-07-16 18:47                     ` Joel Fernandes [this message]
2020-07-15 20:55   ` Kirill A. Shutemov
2020-07-15 21:35     ` Linus Torvalds
2020-07-15 21:51       ` Linus Torvalds

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='CAEXW_YRWDwUVrvedLtoMssFcrwAnWHAQ0CWNbR4UF=GS18B3wA@mail.gmail.com' \
    --to=joel@joelfernandes.org \
    --cc=akpm@linux-foundation.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=naresh.kamboju@linaro.org \
    --cc=torvalds@linux-foundation.org \
    --cc=william.kucharski@oracle.com \
    /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