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=-6.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 B0F03C433FE for ; Thu, 16 Sep 2021 05:32:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1102F6120F for ; Thu, 16 Sep 2021 05:32:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1102F6120F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 266346B0071; Thu, 16 Sep 2021 01:32:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 216B56B0072; Thu, 16 Sep 2021 01:32:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0DEA66B0073; Thu, 16 Sep 2021 01:32:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0249.hostedemail.com [216.40.44.249]) by kanga.kvack.org (Postfix) with ESMTP id EFF836B0071 for ; Thu, 16 Sep 2021 01:32:25 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 7876D1820BA71 for ; Thu, 16 Sep 2021 05:32:25 +0000 (UTC) X-FDA: 78592316250.18.3FC8783 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by imf24.hostedemail.com (Postfix) with ESMTP id 3A45DB0000A6 for ; Thu, 16 Sep 2021 05:32:24 +0000 (UTC) Received: by mail-pf1-f170.google.com with SMTP id j6so4861059pfa.4 for ; Wed, 15 Sep 2021 22:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=lpQeXpJnDPLq9EM++SgX1hsrS2o8DK7oqXbcQuiENms=; b=dVuOTjqdxMs7om2GBMnJW1JtJirdyLapvbyYqIaA0hSto0TKuv32C2H+M4lfHE+N8L EpBTiaPuVp9FrkviqdynL7lFW3P+hOtb6OcSR3elIgIC+9pUYEOO85zqTjLdQpuwd0wL 7bFne5kV0t7j1Onoz4HSFMwgwH9Am996EtkPCWhpu722UNu4Mav/xAvZiJLeF5+JwI5q Tzi9Vp+sG1UrVpl7CWqeklL8wKzdz74IOvO+olUpsm3x1WZGzUVLih3l7dz4CY55pzua 9NyFTgN9D6cIs7W/VUwYJNrp2QAQx6bgj6GewaLr97VyAHQSOzOgX454JDvmDcpMZhJF 04Vg== 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:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=lpQeXpJnDPLq9EM++SgX1hsrS2o8DK7oqXbcQuiENms=; b=4NCdi1yM1YScxhzEOetgxhK5wRcnXJlzWPqmaMmVzvo3g2kDWKDmseipkx2KkH8rt8 0IqZpwkOD0zM04wUckPHMleQyjJ85H08ovsYemH+whFYiHLIf/IY2Qr5hhFJmP1HahVC yJvf+4MWe+Zk4xm30FC5DH1NDrDGGEhzzobqKD6cVMgCAK9pIZZ8J1YKp5y1um2yHzJy SIW2OAWSuyCzlBXPWAyqY7sAHlYbG3vOmO1AGSea/2rQJyA1LstPr96ZRuQOXfjLsh61 fP4CMzpbrp3JjofKVA6kaVMHrK2KvNbzpC8LGxgxrJhs1e3mIFTuLDV4P+zIKR5tgInm H58Q== X-Gm-Message-State: AOAM533vPgseU2RIzKk956rBaN2x9CVReZDhvhFfwkq+t6yPdJuaLUXo 2r2JFHs0r/Irc5L1wL1PyP/+4Q== X-Google-Smtp-Source: ABdhPJwtKQswoEXBPAUSCEEpeqsvci1Aec5NdxszOeNoWmCa3dPa5iejw520VsTlXmc5sLmJj84WHw== X-Received: by 2002:a63:f501:: with SMTP id w1mr3284849pgh.57.1631770343134; Wed, 15 Sep 2021 22:32:23 -0700 (PDT) Received: from [10.254.159.231] ([139.177.225.245]) by smtp.gmail.com with ESMTPSA id c15sm689474pfn.105.2021.09.15.22.32.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Sep 2021 22:32:22 -0700 (PDT) Subject: Re: [PATCH v2 0/9] Free user PTE page table pages To: Jason Gunthorpe Cc: David Hildenbrand , 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: Qi Zheng Message-ID: Date: Thu, 16 Sep 2021 13:32:17 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20210915145933.GH3544071@ziepe.ca> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=dVuOTjqd; spf=pass (imf24.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.210.170 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 3A45DB0000A6 X-Stat-Signature: z9uz4xmzya9ekbnngc7qze3waokf7hxb X-HE-Tag: 1631770344-940638 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 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. > > When you get to step 3 you just change pte_try_map() and the callsites > don't need changing. > > Jason > Thanks, Qi