lkml.org 
[lkml]   [2015]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] x86/mm/pat: Change free_memtype() to free shrinking range
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. I certainly miss something
here, but if the above is correct, then it definitely needs a big fat
comment explaining it.

Thanks,

tglx




\
 
 \ /
  Last update: 2015-12-20 11:01    [W:0.053 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site