Re: [PATCHv5 06/19] mm/khugepaged: Handle encrypted pages

2018-07-20 Thread Kirill A. Shutemov
On Thu, Jul 19, 2018 at 07:13:39AM -0700, Dave Hansen wrote: > On 07/19/2018 01:59 AM, Kirill A. Shutemov wrote: > > On Wed, Jul 18, 2018 at 04:11:57PM -0700, Dave Hansen wrote: > >> On 07/17/2018 04:20 AM, Kirill A. Shutemov wrote: > >>> khugepaged allocates page in advance, before we found a VMA

Re: [PATCHv5 06/19] mm/khugepaged: Handle encrypted pages

2018-07-19 Thread Dave Hansen
On 07/19/2018 01:59 AM, Kirill A. Shutemov wrote: > On Wed, Jul 18, 2018 at 04:11:57PM -0700, Dave Hansen wrote: >> On 07/17/2018 04:20 AM, Kirill A. Shutemov wrote: >>> khugepaged allocates page in advance, before we found a VMA for >>> collapse. We don't yet know which KeyID to use for the alloca

Re: [PATCHv5 06/19] mm/khugepaged: Handle encrypted pages

2018-07-19 Thread Kirill A. Shutemov
On Wed, Jul 18, 2018 at 04:11:57PM -0700, Dave Hansen wrote: > On 07/17/2018 04:20 AM, Kirill A. Shutemov wrote: > > khugepaged allocates page in advance, before we found a VMA for > > collapse. We don't yet know which KeyID to use for the allocation. > > That's not really true. We have the VMA a

Re: [PATCHv5 06/19] mm/khugepaged: Handle encrypted pages

2018-07-18 Thread Dave Hansen
On 07/17/2018 04:20 AM, Kirill A. Shutemov wrote: > khugepaged allocates page in advance, before we found a VMA for > collapse. We don't yet know which KeyID to use for the allocation. That's not really true. We have the VMA and the address in the caller (khugepaged_scan_pmd()), but we drop the l

[PATCHv5 06/19] mm/khugepaged: Handle encrypted pages

2018-07-17 Thread Kirill A. Shutemov
khugepaged allocates page in advance, before we found a VMA for collapse. We don't yet know which KeyID to use for the allocation. The page is allocated with KeyID-0. Once we know that the VMA is suitable for collapsing, we prepare the page for KeyID we need, based on vma_keyid(). Signed-off-by: