[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1450804798.10450.45.camel@hpe.com>
Date: Tue, 22 Dec 2015 10:19:58 -0700
From: Toshi Kani <toshi.kani@....com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: mingo@...hat.com, hpa@...or.com, bp@...en8.de, stsp@...t.ru,
x86@...nel.org, linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Borislav Petkov <bp@...e.de>
Subject: Re: [PATCH 2/2] x86/mm/pat: Change free_memtype() to free shrinking
range
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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists