Hi,
CC-ing Roger as he is working on adding support for the foreign mapping
on x86. Although, I am not expecting any implication as only 4KB mapping
should be supported.
On 08/05/2024 22:05, Julien Grall wrote:
On 07/05/2024 14:30, Luca Fancellu wrote:
On 7 May 2024, at 14:20, Julien Grall <jul...@xen.org> wrote:
Hi Luca,
On 23/04/2024 09:25, Luca Fancellu wrote:
From: Penny Zheng <penny.zh...@arm.com>
But today, p2m_put_l3_page could not handle superpages.
This was done on purpose. Xen is not preemptible and therefore we
need to be cautious how much work is done within the p2m code.
With the below proposal, for 1GB mapping, we may end up to call
put_page() up to 512 * 512 = 262144 times. put_page() can free
memory. This could be a very long operation.
Have you benchmark how long it would take?
I did not, since its purpose was unclear to me and was not commented
in the last serie from Penny.
Honestly, I can't remember why it wasn't commented.
I skimmed through the code to check what we currently do for preemption.
{decrease, increase}_reservation() will allow to handle max_order()
mapping at the time. On a default configuration, the max would be 4MB.
relinquish_p2m_mapping() is preempting every 512 iterations. One
iteration is either a 4KB/2MB/1GB mapping.
relinquish_memory() is checking for preemption after every page.
So I think, it would be ok to allow 2MB mapping for static shared memory
but not 1GB. relinquish_p2m_mapping() would also needs to be updated to
take into account the larger foreign mapping.
I would consider to check for preemption if 't' is p2m_map_foreign and
the order is above 9 (i.e. 2MB).
Cheers,
--
Julien Grall