Re: remap allocator for per-CPU memory

From: Jan Beulich
Date: Wed May 13 2009 - 08:51:39 EST


>>> Tejun Heo <teheo@xxxxxxxxxx> 13.05.09 13:29 >>>
>Tejun Heo wrote:
>> Andi Kleen wrote:
>>> Tejun Heo <teheo@xxxxxxxxxx> writes:
>>>> Okay, just glanced over the pageattr code. I don't think we need any
>>>> special provisions for this as long as the TLB is fine with having
>>>> overlapping PMD and PTE mappings with different attributes (please
>>>> note that these two mappings aren't occupying the same linear
>>>> addresses - they're aliases). This is allowed, right?
>>> Nope.
>>
>> Yeah, I'm going through the manual now and can't find anything which
>> allows such behavior. I haven't been able to find anything which
>>> describes what happens between large page and 4k page aliases.
>> Aieee... I'll dig through the manual a bit more and see whether this
>> can be worked around somehow. :-(
>
>Looks like we're screwed.
>
>I couldn't find anything explicitly prohibiting PMD/PTE aliases w/
>different attributes although there are plenty of warnings and don'ts
>against giving different attributes to the same linear addresses. At
>any rate, it definitely looks way too dangerous to depend on.
>
>And, set_memory_*() is basically allowed on any memory allocated via
>get_free_page(), so... we're between rock and hard place. Looks like
>remapping partially using large pages is no go.
>
>Any ideas?

I think the only two alternatives are

(a) don't use large pages in the first place here, or

(b) teach the pageattr code to handle the per-CPU virtual area similarly to
the kernel space for x86-64 (though it's going to be a little more complicated
since there's no pre-determined relation between the virtual and physical
addresses - the necessary lookup might become expensive on systems with
very many [possible] CPUs).

Jan

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/