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.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 C8658C433FE for ; Thu, 16 Sep 2021 08:42:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 299006008E for ; Thu, 16 Sep 2021 08:42:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 299006008E 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 A61036B0071; Thu, 16 Sep 2021 04:42:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A0FFE6B0072; Thu, 16 Sep 2021 04:42:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8D6F56B0073; Thu, 16 Sep 2021 04:42:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0046.hostedemail.com [216.40.44.46]) by kanga.kvack.org (Postfix) with ESMTP id 801346B0071 for ; Thu, 16 Sep 2021 04:42:06 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 27D722C68C for ; Thu, 16 Sep 2021 08:42:06 +0000 (UTC) X-FDA: 78592794252.27.3D9BECB Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by imf12.hostedemail.com (Postfix) with ESMTP id 033D210000A9 for ; Thu, 16 Sep 2021 08:42:04 +0000 (UTC) Received: by mail-pj1-f54.google.com with SMTP id nn5-20020a17090b38c500b0019af1c4b31fso4196445pjb.3 for ; Thu, 16 Sep 2021 01:42:04 -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=k/PqPd1xiOKmyZtqIYtnsu2EbJDbi6Weae7ssrSWY2M=; b=lFM72qvnql8Gi0BrFoVtqXEq7H2gzwZmLRl3uo+Q8TFKf4j6OBxOfL8EZIIl6nwG6k 1rD/+1UG+hVERQxCokOnbvutvYmUbBU9XWxSgi5aYlwWcnxq1mh6azAGEjVZSprwuiAz 6mC4F6CkTaCJTQBeqNG6SFCrNTbCSDLIx63IflPaXx2tOr3aI5Eha1PcC9VV4wlGaah+ Uhu3QEdnVHsja54X20l36OV/vdef5j2M+DCP3jkJ+oxqtoN0HcFfdfBzm6PUHG7ZqXh4 +x3Ey9nrzcLR1RjRCIR4krylXQH+KeQpOBv+pWYU2Wi8RLRFRftsgYZq8Pm17vjtSftC BrIA== 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=k/PqPd1xiOKmyZtqIYtnsu2EbJDbi6Weae7ssrSWY2M=; b=MOfArkhXjogKv9A8mccmIfiKvZ+A9Vl2Y7cs/MZJTZOK9OlybOtoOk84HpHBx1mlLH Ny7Z5qpUvX2Dr1k/vqdYi+7dQqZrtRESOzk77AoJ9bWtZ6ovf6YL78C30AHKNNVDJGSh YyyMPyqg/UfbqnsIXYcrR6awvbGDoVanm83HY8uZfZEvosYN5xEXCC6epKESFwg8Eh+Q WStPlaEO8Qy77nGs4r/0r94CN6x10bCMeOJu+V8wJpATBhbNuJrAlF9hfifzX+SHBgsN eVbWF2WUZzQbEPn0o6iE3DIUP+E7hftVZ03PtKTYPa+hcA2/C1FfSGbhKWF39kQoM7ZL dVwA== X-Gm-Message-State: AOAM530hP3k7pJmOrAovV94+hFChLKovVAV4zEsZUfTNb+gphGXa8bhp bYlYvGu27Luqu6iX/zDdw+TUYg== X-Google-Smtp-Source: ABdhPJw6e4BTwxgsM/UjNPTgBViVxZTWeAbr81eOn2XSEZUvaUVaMsgHXZ1ubSN3W47yeAUgxwnMbw== X-Received: by 2002:a17:902:7b84:b0:13b:90a7:e270 with SMTP id w4-20020a1709027b8400b0013b90a7e270mr3655442pll.21.1631781723597; Thu, 16 Sep 2021 01:42:03 -0700 (PDT) Received: from [10.254.159.231] ([139.177.225.245]) by smtp.gmail.com with ESMTPSA id a15sm2599933pgn.25.2021.09.16.01.41.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Sep 2021 01:42:03 -0700 (PDT) Subject: Re: [PATCH v2 0/9] Free user PTE page table pages To: David Hildenbrand , 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: Qi Zheng Message-ID: Date: Thu, 16 Sep 2021 16:41:57 +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: Content-Type: text/plain; charset=utf-8; format=flowed Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=lFM72qvn; spf=pass (imf12.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.216.54 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: jpkym4tacykjcwk7a9m6hfm6psb69utf X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 033D210000A9 X-HE-Tag: 1631781724-621243 Content-Transfer-Encoding: quoted-printable 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/16/21 4:30 PM, David Hildenbrand wrote: > 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. >>>> =C2=A0=C2=A0=C2=A0=C2=A0 But I will explain its semantics. >>>> 2. Merge #6, #7 and #8, and call these dummy APIs in any necessary >>>> =C2=A0=C2=A0=C2=A0=C2=A0 location, and split some special cases into= single patches,=20 >>>> such as >>>> =C2=A0=C2=A0=C2=A0=C2=A0 pagefault and gup, etc. So that we can expl= ain in more detail the >>>> =C2=A0=C2=A0=C2=A0=C2=A0 concurrency in these cases. For example, we= don't need to hold any >>>> =C2=A0=C2=A0=C2=A0=C2=A0 pte_refcount in the fast path in gup on the= x86_64 platform.=20 >>>> Because >>>> =C2=A0=C2=A0=C2=A0=C2=A0 the PTE page can't be freed after the local= CPU interrupt is=20 >>>> closed >>>> =C2=A0=C2=A0=C2=A0=C2=A0 in the fast path in gup. >>>> 3. Introduce CONFIG_FREE_USER_PTE and implement these empty dummy AP= Is. >>>> 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. >=20 > Maybe propose the new API first, before doing the actual implementation= .=20 > Might safe you from doing some additional back-and-forth > work eventually. >=20 OK, I prepare to propose all the dummy APIs in the step 1. Thanks, Qi >=20