From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1639AC433FE for ; Thu, 16 Sep 2021 08:30:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 90A856120F for ; Thu, 16 Sep 2021 08:30:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 90A856120F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 00CA06B0071; Thu, 16 Sep 2021 04:30:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EFF196B0072; Thu, 16 Sep 2021 04:30:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DC6C9900002; Thu, 16 Sep 2021 04:30:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id CEC5C6B0071 for ; Thu, 16 Sep 2021 04:30:26 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 4A5B22D380 for ; Thu, 16 Sep 2021 08:30:26 +0000 (UTC) X-FDA: 78592764852.07.2F905B0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf25.hostedemail.com (Postfix) with ESMTP id B8209B000188 for ; Thu, 16 Sep 2021 08:30:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631781025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QfBVqsgDph978vd7uxoPuxcND045kBmQjEMf3xFIUro=; b=Hqh9G2tjiK5fJY1zInzKSExzTZSP18qecqsi8XPy9OVgnuRpBDJl6CpzUvnwjTtOlYzJzO a/V+amQxAs7G6+DunzQVnxI6h/oq+Rn1Be8+Lc0xbr67AD8pJ6eB6wLeQe3Qdnh/CR2r+O wSZ5v6G9wFderyC6eb1YXNpWwfLWpdo= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-188-fWJVa7-0Oeekis-uBPW39g-1; Thu, 16 Sep 2021 04:30:23 -0400 X-MC-Unique: fWJVa7-0Oeekis-uBPW39g-1 Received: by mail-wm1-f71.google.com with SMTP id x10-20020a7bc76a000000b002f8cba3fd65so2318102wmk.2 for ; Thu, 16 Sep 2021 01:30:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=QfBVqsgDph978vd7uxoPuxcND045kBmQjEMf3xFIUro=; b=HwKWu8IEkYfuMvw6h3I8K/66xPW2J+LjBpwuTHek8vbvrnPXaNRdtqOTuF05U0LIqj 0JoI+EhoGwGBXn+p9KgbYujoaKzVcZhy9uuPvjpvE+fKTBQemhAIcOX/a2lZCu55mKpG zoiij49NYrBgsmO8X/1XLCKSVzk6pkctqycEDocqSCkWpD3Qnvl4cfFleH482ZMEyg/o CwxjjlgSmkKsCekh1HvoyrYxpCcIptqD07+tOpIvwFjdPj36izAXKw5MqgYXlF6xoMff tbzGV/7M6jPfXwBPFcPQEgf7jnr2FJobvrqJgdtvQUNwI3o8MbYUdjMId67MkOxSVI2H iMsQ== X-Gm-Message-State: AOAM530QjvMfwbbjMS/8tm7B5Afie42ItCxFaqpRKKJJuTXWfPtWeLVM CP6zuiKGKFexok7ivsSiGVO5KANiyvnoZMvQuUKNeIqUtysg3LNfCVOqg/RITi2AVwN47yN4JjL dkqomQblgqc8= X-Received: by 2002:a1c:9dd2:: with SMTP id g201mr8610181wme.46.1631781022703; Thu, 16 Sep 2021 01:30:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzE2zWRN4h3CiVwdhdjW3gid/lPl3CkT/IUtUfZzt6UDdN+RX5Qu2Z8r2/NQNcCglaP/qdLPA== X-Received: by 2002:a1c:9dd2:: with SMTP id g201mr8610146wme.46.1631781022459; Thu, 16 Sep 2021 01:30:22 -0700 (PDT) Received: from [192.168.3.132] (p4ff23828.dip0.t-ipconnect.de. [79.242.56.40]) by smtp.gmail.com with ESMTPSA id s10sm2533403wrg.42.2021.09.16.01.30.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Sep 2021 01:30:22 -0700 (PDT) Subject: Re: [PATCH v2 0/9] Free user PTE page table pages To: Qi Zheng , Jason Gunthorpe Cc: akpm@linux-foundation.org, tglx@linutronix.de, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, kirill.shutemov@linux.intel.com, mika.penttila@nextfour.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, songmuchun@bytedance.com References: <20210819031858.98043-1-zhengqi.arch@bytedance.com> <5b9348fc-95fe-5be2-e9df-7c906e0c9b81@redhat.com> <41ceeec1-52c4-4e99-201c-e1e05b2afbbc@bytedance.com> <20210915145933.GH3544071@ziepe.ca> From: David Hildenbrand Organization: Red Hat Message-ID: Date: Thu, 16 Sep 2021 10:30:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Stat-Signature: dsbgxhf5eeaa9yfynr3exafi8imdkqez Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Hqh9G2tj; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf25.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: B8209B000188 X-HE-Tag: 1631781025-548556 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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