From: Toshi Kani <toshi.kani@hpe.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: mingo@redhat.com, hpa@zytor.com, bp@alien8.de, stsp@list.ru,
x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Borislav Petkov <bp@suse.de>
Subject: Re: [PATCH 2/2] x86/mm/pat: Change free_memtype() to free shrinking range
Date: Tue, 22 Dec 2015 10:19:58 -0700 [thread overview]
Message-ID: <1450804798.10450.45.camel@hpe.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1512201025050.28591@nanos>
On Sun, 2015-12-20 at 10:27 +0100, Thomas Gleixner wrote:
> Toshi,
>
> On Wed, 9 Dec 2015, Toshi Kani wrote:
> > diff --git a/arch/x86/mm/pat_rbtree.c b/arch/x86/mm/pat_rbtree.c
> > index 6393108..d6faef8 100644
> > --- a/arch/x86/mm/pat_rbtree.c
> > +++ b/arch/x86/mm/pat_rbtree.c
> > @@ -107,7 +112,12 @@ static struct memtype
> > *memtype_rb_exact_match(struct rb_root *root,
> > while (match != NULL && match->start < end) {
> > struct rb_node *node;
> >
> > - if (match->start == start && match->end == end)
> > + if ((match_type == MEMTYPE_EXACT_MATCH) &&
> > + (match->start == start) && (match->end == end))
> > + return match;
> > +
> > + if ((match_type == MEMTYPE_SHRINK_MATCH) &&
> > + (match->start < start) && (match->end == end))
>
> Confused. If we shrink a mapping then I'd expect that the start of the
> mapping stays the same and the end changes.
Yes, that is correct after this request is done.
> I certainly miss something here, but if the above is correct, then it
> definitely needs a big fat comment explaining it.
This request specifies a range being "unmapped", not the remaining mapped
range. So, when the mapping range is going to shrink from the end, the
unmapping range has a bigger 'start' value and the same 'end' value.
Thanks,
-Toshi
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2015-12-22 17:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-09 16:26 [PATCH 0/2] Change PAT to support mremap use-cases Toshi Kani
2015-12-09 16:26 ` [PATCH 1/2] x86/mm/pat: Change untrack_pfn() to handle unmapped vma Toshi Kani
2015-12-20 9:21 ` Thomas Gleixner
2015-12-22 17:02 ` Toshi Kani
2015-12-09 16:26 ` [PATCH 2/2] x86/mm/pat: Change free_memtype() to free shrinking range Toshi Kani
2015-12-20 9:27 ` Thomas Gleixner
2015-12-22 17:19 ` Toshi Kani [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=1450804798.10450.45.camel@hpe.com \
--to=toshi.kani@hpe.com \
--cc=bp@alien8.de \
--cc=bp@suse.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@redhat.com \
--cc=stsp@list.ru \
--cc=tglx@linutronix.de \
--cc=x86@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