* pci device assignment and mm, KSM.
@ 2012-07-04 6:16 Kamezawa Hiroyuki
0 siblings, 0 replies; only message in thread
From: Kamezawa Hiroyuki @ 2012-07-04 6:16 UTC (permalink / raw)
To: linux-mm; +Cc: kvm, Hugh Dickins, KOSAKI Motohiro, Minchan Kim
I'm sorry if my understanding is incorrect. Here are some topics on
pci passthrough to guests.
When pci passthrough is used with kvm, guest's all memory are pinned by extra
reference count of get_page(). That pinned pages are never be reclaimable and
movable by migration and cannot be merged by KSM.
Now, the information that 'the page is pinned by kvm' is just represented by
page_count(). So, there are following problems.
a) pages are on ANON_LRU. So, try_to_free_page() and kswapd will scan XX GB of
pages hopelessly.
b) KSM cannot recognize the pages in its early stage. So, it breaks transparent
huge page mapped by kvm into small pages. But it fails to merge them finally,
because of raised page_count(). So, all hugepages are split without any
benefits.
2 ideas for fixing this....
for a) I guess the pages should go to UNEVICTABLE list. But it's not mlocked.
I think we use PagePinned() instread of it and move pages to UNEVICTABLE list.
Then, kswapd etc will ignore pinned pages.
for b) At first, I thought qemu should call madvise(MADV_UNMERGEABLE). But I think
kernel may be able to handle situation with an extra check, PagePinned() or
checking a flag in mm_struct. Should we avoid this in userland or kernel ?
BTW, I think pinned pages cannot be freed until the kvm process exits. Is it right ?
Thanks,
-Kame
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-07-04 6:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-04 6:16 pci device assignment and mm, KSM Kamezawa Hiroyuki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox