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=-17.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 56336C433DB for ; Fri, 5 Feb 2021 16:12:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DAC5664FCB for ; Fri, 5 Feb 2021 16:12:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DAC5664FCB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3D9456B007E; Fri, 5 Feb 2021 11:12:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 389A26B0080; Fri, 5 Feb 2021 11:12:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 27A2C6B0081; Fri, 5 Feb 2021 11:12:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0186.hostedemail.com [216.40.44.186]) by kanga.kvack.org (Postfix) with ESMTP id 0B9866B007E for ; Fri, 5 Feb 2021 11:12:34 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C80DE8249980 for ; Fri, 5 Feb 2021 16:12:33 +0000 (UTC) X-FDA: 77784706986.01.burn71_2e0e3dc275e6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id A61311004BE3C for ; Fri, 5 Feb 2021 16:12:33 +0000 (UTC) X-HE-Tag: burn71_2e0e3dc275e6 X-Filterd-Recvd-Size: 3437 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Fri, 5 Feb 2021 16:12:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612541552; 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=3TsJGd0+8Rr5FyrVFN0YQ1LVOoJ9uc/e+iMpGoDsN6c=; b=EAdzdZqAMZOP8xdDPHP5YEiKva4TlKW0xFgjcsgAkjGx/UifIOi6CH019ex8TYKwaiAAcG b56xob6BH31UEpYc718x0C1Pbdnst2kCK/2plyIdV3NtfNx9+sXzlPgzBHMC8SrfyiOeLx RAeC/3kiSDSwGXjK3UI07U4ybBazk2Q= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-167-h5tM4UstNoKPRL5aLC_cUg-1; Fri, 05 Feb 2021 11:12:30 -0500 X-MC-Unique: h5tM4UstNoKPRL5aLC_cUg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 888EF80402C; Fri, 5 Feb 2021 16:12:29 +0000 (UTC) Received: from [10.36.113.156] (ovpn-113-156.ams2.redhat.com [10.36.113.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D86919C47; Fri, 5 Feb 2021 16:12:28 +0000 (UTC) Subject: Re: [PATCH] mm/hugetlb: use helper huge_page_size() to simplify the hugetlb_vm_op_pagesize() To: Miaohe Lin , akpm@linux-foundation.org, mike.kravetz@oracle.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210205092209.16024-1-linmiaohe@huawei.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <2743477c-a256-0295-884d-5354c634508d@redhat.com> Date: Fri, 5 Feb 2021 17:12:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20210205092209.16024-1-linmiaohe@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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 05.02.21 10:22, Miaohe Lin wrote: > We can use helper huge_page_size() to get the size of the pages allocated > when backing a VMA directly to make the code more simplified. > > Signed-off-by: Miaohe Lin > --- > mm/hugetlb.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index 18628f8dbfb0..3eea2a34d9f5 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -3647,9 +3647,7 @@ static int hugetlb_vm_op_split(struct vm_area_struct *vma, unsigned long addr) > > static unsigned long hugetlb_vm_op_pagesize(struct vm_area_struct *vma) > { > - struct hstate *hstate = hstate_vma(vma); > - > - return 1UL << huge_page_shift(hstate); > + return huge_page_size(hstate_vma(vma)); > } Maybe it makes sense to squash all of these individual patches you send that do the same things/perform the same cleanups. Shouldn't be to hard to identify all these cases using simple "git grep". Makes life of reviewers and maintainers easier ... -- Thanks, David / dhildenb