[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bf16195e-2570-3687-2b53-3f597ebfcfec@amd.com>
Date: Thu, 17 Feb 2022 16:12:20 -0500
From: Felix Kuehling <felix.kuehling@....com>
To: Jason Gunthorpe <jgg@...dia.com>,
David Hildenbrand <david@...hat.com>
Cc: Alistair Popple <apopple@...dia.com>,
Christoph Hellwig <hch@....de>,
Alex Sierra <alex.sierra@....com>, akpm@...ux-foundation.org,
linux-mm@...ck.org, rcampbell@...dia.com,
linux-ext4@...r.kernel.org, linux-xfs@...r.kernel.org,
amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
jglisse@...hat.com, willy@...radead.org
Subject: Re: [PATCH v6 01/10] mm: add zone device coherent type memory support
Am 2022-02-16 um 07:26 schrieb Jason Gunthorpe:
> The other place that needs careful audit is all the callers using
> vm_normal_page() - they must all be able to accept a ZONE_DEVICE page
> if we don't set pte_devmap.
How much code are we talking about here? A quick search finds 26
call-sites in 12 files in current master:
fs/proc/task_mmu.c
mm/hmm.c
mm/gup.c
mm/huge_memory.c (vm_normal_page_pmd)
mm/khugepaged.c
mm/madvise.c
mm/mempolicy.c
mm/memory.c
mm/mlock.c
mm/migrate.c
mm/mprotect.c
mm/memcontrol.c
I'm thinking of a more theoretical approach: Instead of auditing all
users, I'd ask, what are the invariants that a vm_normal_page should
have. Then check, whether our DEVICE_COHERENT pages satisfy them. But
maybe the concept of a vm_normal_page isn't defined clearly enough for that.
That said, I think we (Alex and myself) made an implicit assumption from
the start, that a DEVICE_COHERENT page should behave a lot like a normal
page in terms of VMA mappings, even if we didn't know what that means in
detail.
I can now at least name some differences between DEVICE_COHERENT and
normal pages: how the memory is allocated, how data is migrated into
DEVICE_COHERENT pages and that it can't be on any LRU list (because the
lru list_head in struct page is aliased by pgmap and zone_device_data).
Maybe I'll find more differences if I keep digging.
Regards,
Felix
>
> Jason
Powered by blists - more mailing lists