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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65E13C433EF for ; Mon, 9 May 2022 04:18:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D39A16B0071; Mon, 9 May 2022 00:18:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CC22F6B0073; Mon, 9 May 2022 00:18:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B64B46B0074; Mon, 9 May 2022 00:18:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id A81F46B0071 for ; Mon, 9 May 2022 00:18:26 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 7DA813000E for ; Mon, 9 May 2022 04:18:26 +0000 (UTC) X-FDA: 79444897812.16.A5BD819 Received: from out199-3.us.a.mail.aliyun.com (out199-3.us.a.mail.aliyun.com [47.90.199.3]) by imf30.hostedemail.com (Postfix) with ESMTP id DA7B180097 for ; Mon, 9 May 2022 04:18:08 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R541e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0VCcryDl_1652069899; Received: from 30.32.96.14(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VCcryDl_1652069899) by smtp.aliyun-inc.com(127.0.0.1); Mon, 09 May 2022 12:18:20 +0800 Message-ID: Date: Mon, 9 May 2022 12:19:00 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [RFC PATCH 1/3] arm64/hugetlb: Introduce new huge_ptep_get_access_flags() interface To: nh26223@qq.com, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, mike.kravetz@oracle.com, akpm@linux-foundation.org, sj@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Muchun Song References: <5e33cf5e-2c48-89fe-3447-2f29c7844928@linux.alibaba.com> From: Baolin Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: DA7B180097 X-Stat-Signature: ix6aaoykm8bh61nnxcjebcreue1jigie X-Rspam-User: Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf30.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 47.90.199.3 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com X-Rspamd-Server: rspam09 X-HE-Tag: 1652069888-392740 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 5/9/2022 12:10 PM, nh26223@qq.com write: > ----------------8<--------------- >>>> >>>> diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c >>>> index ca8e65c..ce39699 100644 >>>> --- a/arch/arm64/mm/hugetlbpage.c >>>> +++ b/arch/arm64/mm/hugetlbpage.c >>>> @@ -158,6 +158,30 @@ static inline int num_contig_ptes(unsigned long >>>> size, >>>> size_t *pgsize) return contig_ptes; >>>> >>>> } >>>> >>>> +pte_t huge_ptep_get_access_flags(pte_t *ptep, unsigned long sz) >>> >>> The function name looks to me that it returns access flags of PTE. >> >> Yes, not a good name. That's why this is a RFC patch set to get more >> suggestion :) >> >> Maybe huge_ptep_get_with_access_flags()? or do you have some better idea? > I don't have either. "Naming is hard". :) > >>>> diff --git a/include/asm-generic/hugetlb.h >>>> b/include/asm-generic/hugetlb.h >>>> index a57d667..bb77fb0 100644 >>>> --- a/include/asm-generic/hugetlb.h >>>> +++ b/include/asm-generic/hugetlb.h >>>> @@ -150,6 +150,13 @@ static inline pte_t huge_ptep_get(pte_t *ptep) >>>> >>>> } >>>> #endif >>>> >>>> +#ifndef __HAVE_ARCH_HUGE_PTEP_GET_ACCESS_FLAGS >>>> +static inline pte_t huge_ptep_get_access_flags(pte_t *ptep, unsigned >>>> long >>>> sz) +{ >>>> + return ptep_get(ptep); >>> >>> Should be: >>> return huge_ptep_get(ptep) ? >> >> I don't think so. If no ARCH-specific definition, the >> huge_ptep_get_access_flags() implementation should be same as >> huge_ptep_get(). Thanks for your comments. > If no __HAVE_ARCH_HUGE_PTEP_GET, huge_ptep_get() is same as > ptep_get(). > > Or it's not possible no __HAVE_ARCH_HUGE_PTEP_GET_ACCESS_FLAGS > but with __HAVE_ARCH_HUGE_PTEP_GET? Yes, I am wrong, shoule be huge_ptep_get(). Thanks for pointing out issues :) PS: I think I will follow Muchun's suggestion in next version, so no need to add a new interface.