# Re: \[PATCH v2 0/9\] Free user PTE page table pages

- From: David Hildenbrand \<hidden\>
- Date: 2021-09-16 08:30:28 
- List: linux-doc
- Page: https://ratatoskr.run/linux-doc/2021/09/1510148
- Thread: https://ratatoskr.run/linux-doc/2021/08/1482406/t.md

```text
On 16.09.21 07:32, Qi Zheng wrote:
>
>
> On 9/15/21 10:59 PM, Jason Gunthorpe wrote:
>> On Wed, Sep 15, 2021 at 10:52:40PM +0800, Qi Zheng wrote:
>>> I am going to split this patch series as follows:
>>>
>>> 1. Introduce the new dummy APIs, which is an empty implementation.
>>>      But I will explain its semantics.
>>> 2. Merge #6, #7 and #8, and call these dummy APIs in any necessary
>>>      location, and split some special cases into single patches, such as
>>>      pagefault and gup, etc. So that we can explain in more detail the
>>>      concurrency in these cases. For example, we don't need to hold any
>>>      pte_refcount in the fast path in gup on the x86_64 platform. Because
>>>      the PTE page can't be freed after the local CPU interrupt is closed
>>>      in the fast path in gup.
>>> 3. Introduce CONFIG_FREE_USER_PTE and implement these empty dummy APIs.
>>> 4. Add a description document.
>>>
>>> And I try to add a function that combines pte_offset_map() and
>>> pte_try_get(). Maybe the func name is pte_try_map() recommended by
>>> Jason, or keep the pte_offset_map() unchanged?
>>
>> It is part of the transformation, add a
>> pte_try_map()/pte_undo_try_map() and replace all the pte_offset_map()
>> callsites that can use the new API with it. The idea was that try_map
>> would incorporate the pmd_trans_unstable/etc mess so searching for
>> trans_unstable is a good place to start finding candidates. Some are
>> simple, some are tricky.
>
> Yes, I will search pte_offset_map()/pmd_trans_unstable/etc, and then
> analyze the specific situation.

Maybe propose the new API first, before doing the actual implementation. Might safe you from doing some additional back-and-forth
work eventually.


-- 
Thanks,

David / dhildenb

```
