Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp586021rwd; Mon, 12 Jun 2023 19:20:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4gZEZQhDNBO37NWQfq2DVWzMPqDvGPAOw0HM8ritEQPUt9JQHPNoxQ99Qz8suwtfHthae3 X-Received: by 2002:a17:907:368d:b0:974:1c91:a751 with SMTP id bi13-20020a170907368d00b009741c91a751mr10793213ejc.29.1686622853378; Mon, 12 Jun 2023 19:20:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686622853; cv=none; d=google.com; s=arc-20160816; b=HJenR7lXzxOVKBrD0d2wS6UBBVyHQlBT7qz4YIiAzXhmP8myLZT66BPDbpZMhEb1V3 7Amu1/enEkE0agd5jsDA1XpACBr23R0uPVOuKgm3IAiRt5/7PPWTVKW8/dl7BpLUgAP0 5lckl2iNo8Q2PcFP+F3VNCmzIG0R3m8OprxUIWIW1RMN2iu50tehppFITW0e9fEwaPpJ qeIaAzMPI9YG4RRduYTE+XWpFpboCU8HxvOy11/jX3+aWcmcanSTECdfzZCQQ5CXXWP9 IuMcTZgzy4wuAssWjagwbIqw06WVIITWJvNZgW5Nc3WyvPGqvl5H4KAs9L6r4Q9lieyx 3RgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=17ugyNFhbrwEanCoHF7v9qrJ1jJmHx/jdN9D7BRY9oE=; b=L4RCK/pPBTSBzMunQD66TTHmo+eQOeW1s7aeiYPGh0LbRa4VUyHP461qmu4S2e5J42 YyKSwvI5xoovbEfnjtDKZDoOlHgVXhCNHvk31dVh5k71DZVLcBPEKmdmO9NYGEEnabfe OGQ5AHW4M0vJjqIzKC/UC/ppuximjKkwPuuwzrka3a89siZi2OUHCfQdTIFNSLh5qEgm pZbldJTssIYbCph+U4fFetWPNpPwS+DLjj83Ww564WfUUTqZV91we9C6BaZFGoiMHHTO c8zNRHxp51L/2/OguCkiL7juDjc1kcrto9XU4dwoC+sFMszDL1lI6gLOdDcUwPnzdWTr Umdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=m7DmPVEX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ju14-20020a17090798ae00b009655045843fsi2556784ejc.204.2023.06.12.19.20.29; Mon, 12 Jun 2023 19:20:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=m7DmPVEX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233482AbjFMCRW (ORCPT + 99 others); Mon, 12 Jun 2023 22:17:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbjFMCRT (ORCPT ); Mon, 12 Jun 2023 22:17:19 -0400 Received: from out-40.mta0.migadu.com (out-40.mta0.migadu.com [91.218.175.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A28C410FA for ; Mon, 12 Jun 2023 19:17:18 -0700 (PDT) Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1686622633; 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=17ugyNFhbrwEanCoHF7v9qrJ1jJmHx/jdN9D7BRY9oE=; b=m7DmPVEXGMkpf0bo+q5pbu5oDDKH189Z/XzRq7Dih/3Dx0SQfpjZXQWTSJWS3TkVoCDoXU +v02nL8NwADRue1ybe3/uGEqr48aSC+9ZD5XlLUCSo4eNSNQeoeI8A91KFFzRGT1sCbUPr MXmvlJA1v+AC/K7Zq4kbQC18O8E8+QA= MIME-Version: 1.0 Subject: Re: [PATCH v3 0/3] Encapsulate PTE contents from non-arch code X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <20230612151545.3317766-1-ryan.roberts@arm.com> Date: Tue, 13 Jun 2023 10:16:26 +0800 Cc: Andrew Morton , SeongJae Park , "Matthew Wilcox (Oracle)" , "Kirill A. Shutemov" , Mike Rapoport , Yu Zhao , Jason Gunthorpe , David Airlie , Daniel Vetter , Dimitri Sivanich , Alex Williamson , Oleksandr Tyshchenko , Alexander Viro , Christian Brauner , Mike Kravetz , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , =?utf-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Naoya Horiguchi , Miaohe Lin , Pasha Tatashin , Uladzislau Rezki , Christoph Hellwig , Lorenzo Stoakes , linux-kernel@vger.kernel.org, Linux Memory Management List , damon@lists.linux.dev Content-Transfer-Encoding: quoted-printable Message-Id: <3ECE40AA-536E-4A2C-82BA-FE74AA6FB689@linux.dev> References: <20230612151545.3317766-1-ryan.roberts@arm.com> To: Ryan Roberts X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jun 12, 2023, at 23:15, Ryan Roberts wrote: >=20 > Hi All, >=20 > (Including wider audience this time since changes touch a fair few = subsystems) >=20 > This is the second half of v3 of a series to improve the encapsulation = of pte > entries by disallowing non-arch code from directly dereferencing pte_t = pointers. > Based on earlier feedback, I split the series in 2; the first part, = fixes for > existing bugs, was already posted at [3] and merged into mm-stable. = This second > part contains the conversion from direct dereferences to instead use > ptep_get()/ptep_get_lockless(). >=20 > See the v1 cover letter at [1] for rationale for this work. >=20 > Based on feedback at v2, I've removed the new ptep_deref() helper I = originally > added, and am now using the existing ptep_get() and = ptep_get_lockless() helpers. When I first saw the name of ptep_get()/ptep_get_lockless(), I thought the pte seems like to be protected by the refcount mechanism (Why I have this though? Because Qi Zheng has proposed a approach to free pte page = tables by using the refcount mechanism [1]). And your proposed name of = ptep_deref() is intuitive for me, so I have another thought, should we rename = ptep_get() to ptep_deref()? Just a thought from me, I'd like to hear if others = object. Thanks. [1] = https://lore.kernel.org/lkml/20211110105428.32458-7-zhengqi.arch@bytedance= .com/=