On 06.02.20 23:15, Michael Hinton wrote:
> On Thursday, February 6, 2020 at 12:23:47 PM UTC-7, Jan Kiszka wrote:
> 
>     On 06.02.20 20:15, Michael Hinton wrote:
>     > Hi Jan,
>     >
>     > On Thursday, February 6, 2020 at 12:06:05 PM UTC-7, Jan Kiszka wrote:
>     >
>     >     On 06.02.20 20:00, Michael Hinton wrote:
>     >     > map_range((char *)MGH_HEAP_BASE, MGH_HEAP_SIZE, MAP_UNCACHED);
>     >
>     >     Why are you mapping your RAM uncached? That's (roughly) only
>     needed for
>     >     MMIO.
>     >
> 
>     >
>     > I see that it sets the PG_PCD argument to the page table entry in
>     > map_range(). What does that do?
> 
>     That controls caching on page-level granularity.
> 
>     >
>     > Should I set it to MAP_UNCACHED and see if that helps with
>     performance?
> 
>     MAP_CACHED. When it's uncached, every memory access will hit the RAM.
>     That is... not very fast.
> 
>     Jan
> 
> 
> Switching to MAP_CACHED worked! My inmate now runs 100 ms faster than
> the same workload in the root cell. The inmate went from 2.8 s down to
> 1.1 seconds with that change.
> 
>     > I guess I was copying the other map_range() call used to set up the 
>     > IVSHMEM from the ivshmem demo. So I have no particular reason. 
>     The ivshmem demo is doing that only for the MMIO register region, not 
>     the shared memory is later maps. 
> 
> 
> Running the workload directly on input in shared memory with IVSHMEM is
> super slow, so I'm wondering if the data portion is indeed UNCACHED,
> contrary to what you say. Or maybe there is some other bottleneck. I
> will try to investigate that some more (maybe I will change it to CACHED
> as well and see what happens). But at any rate, for my purposes, I can
> always copy the data out of IVSHMEM into the cached memory region for
> now now.

Oh, now I see where this confusion came from: Old
inmates/demos/x86/ivshmem-demo.c used to map MMIO + shared mem in one
chunk, and that uncached (for the sake of the MMIO part). You need to
look at inmates/demos/ivshmem-demo.c from latest 0.12 to find the better
pattern (also how to use the latest ivshmem interface).

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/a93c1ea5-2c50-7dcc-42e8-fbe9b31db08c%40siemens.com.

Reply via email to