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 16144C433EF for ; Fri, 17 Jun 2022 00:54:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1D1426B0071; Thu, 16 Jun 2022 20:54:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 17F756B0072; Thu, 16 Jun 2022 20:54:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EEC566B0073; Thu, 16 Jun 2022 20:53:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id DA0076B0071 for ; Thu, 16 Jun 2022 20:53:59 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B0C9935948 for ; Fri, 17 Jun 2022 00:53:59 +0000 (UTC) X-FDA: 79585905798.11.EBD5F39 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf14.hostedemail.com (Postfix) with ESMTP id 53E12100076 for ; Fri, 17 Jun 2022 00:53:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655427230; 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: in-reply-to:in-reply-to:references:references; bh=cqh/xCqSrPT5XnCWpPALZ1TXJ2uqqL1RdR3h2gkY1hY=; b=H6oO8HSk9uLpp3wiU/C5hhh9FWFCPdSTnCsjxMmytaoqKdKNv92xlyAbK12lMEZnMaioEZ Lcqv5uWABP7SZumyoZe+WLxDvzdYRJ5YgxZtZ4bKfSNF/xctF3WhToMjj+6Iq85o4e7c7a 3/F9JZicYTWwmAqh12Uz/fvE7pGhp74= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-330-GYj60yb7M1-KQMb4ur2GSw-1; Thu, 16 Jun 2022 20:53:47 -0400 X-MC-Unique: GYj60yb7M1-KQMb4ur2GSw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E9E00801756; Fri, 17 Jun 2022 00:53:46 +0000 (UTC) Received: from localhost (ovpn-12-181.pek2.redhat.com [10.72.12.181]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E54F740EC002; Fri, 17 Jun 2022 00:53:45 +0000 (UTC) Date: Fri, 17 Jun 2022 08:53:41 +0800 From: Baoquan He To: Mike Kravetz Cc: Baolin Wang , songmuchun@bytedance.com, akpm@linux-foundation.org, catalin.marinas@arm.com, will@kernel.org, anshuman.khandual@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] arm64/hugetlb: Implement arm64 specific hugetlb_mask_last_hp Message-ID: References: <7256dbe078d7231f45b0f47c2c52a3bd3aa10da7.1655350193.git.baolin.wang@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=H6oO8HSk; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf14.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bhe@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655427237; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=cqh/xCqSrPT5XnCWpPALZ1TXJ2uqqL1RdR3h2gkY1hY=; b=u5bHNtmTyVbS2DbD8i9LDwMQ14Kia83r7Q8Cxq6hyGagQPLP4eUMiTrXHkocnRVwIvkxQu rwXaJR2MYach+Ty92G3cKRmR3flfzogo1pynR3ti0SObfAf4wVhihU4Bg7U49NXx6tdU+4 ydQOSr05mpe3hKxz5I2orYVOb4yBQaU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655427237; a=rsa-sha256; cv=none; b=EYM7OCKHXBlJiAjd5lEdOzQ3Qzn2jhImoxZyaE+/n45z18HJPsCfGczyD78iWmbvtFE33t p5JmBpB+LyngswQRWHg8Xl54YQo/CrMJwxqifNAJIX+jIJiRm26YEW3fmld1JL6YCQpIBY mwiCOBZl8aU3gYsH1eG4mFHq9oaiYts= X-Stat-Signature: miu9fu5f11ejma8k85z3n1azs5iikfgm X-Rspamd-Queue-Id: 53E12100076 X-Rspam-User: Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=H6oO8HSk; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf14.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bhe@redhat.com X-Rspamd-Server: rspam10 X-HE-Tag: 1655427237-64423 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 06/16/22 at 10:35am, Mike Kravetz wrote: > On 06/16/22 20:05, Baoquan He wrote: > > On 06/16/22 at 11:34am, Baolin Wang wrote: > > > The HugeTLB address ranges are linearly scanned during fork, unmap and > > > remap operations, and the linear scan can skip to the end of range mapped > > > by the page table page if hitting a non-present entry, which can help > > > to speed linear scanning of the HugeTLB address ranges. > > > > > > So hugetlb_mask_last_hp() is introduced to help to update the address in > > > the loop of HugeTLB linear scanning with getting the last huge page mapped > > > by the associated page table page[1], when a non-present entry is encountered. > > > > > > Considering ARM64 specific cont-pte/pmd size HugeTLB, this patch implemented > > > an ARM64 specific hugetlb_mask_last_hp() to help this case. > > > > > > [1] https://lore.kernel.org/linux-mm/20220527225849.284839-1-mike.kravetz@oracle.com/ > > > > > > Signed-off-by: Baolin Wang > > > --- > > > Note: this patch is based on the series: "hugetlb: speed up linear > > > address scanning" from Mike. Mike, please fold it into your series. > > > Thanks. > > > --- > > > arch/arm64/mm/hugetlbpage.c | 20 ++++++++++++++++++++ > > > 1 file changed, 20 insertions(+) > > > > > > diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c > > > index e2a5ec9..958935c 100644 > > > --- a/arch/arm64/mm/hugetlbpage.c > > > +++ b/arch/arm64/mm/hugetlbpage.c > > > @@ -368,6 +368,26 @@ pte_t *huge_pte_offset(struct mm_struct *mm, > > > return NULL; > > > } > > > > > > +unsigned long hugetlb_mask_last_hp(struct hstate *h) > > > +{ > > > + unsigned long hp_size = huge_page_size(h); > > > > hp_size may not be a good name, it reminds me of hotplug. I would name > > it hpage_size even though a little more characters are added. > > > > How about just hugetlb_mask_last_page? Since the routine is prefixed > with 'hugetlb' and we are passing in a pointer to a hstate, I think there > is enough context to know we are talking about a huge page mask as > opposed to a base page mask. Agree, hugetlb_mask_last_page looks good to me regarding the function name, thx.