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.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED 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 B4A7BC00449 for ; Wed, 3 Oct 2018 11:17:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 718C32098A for ; Wed, 3 Oct 2018 11:17:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 718C32098A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726781AbeJCSFw (ORCPT ); Wed, 3 Oct 2018 14:05:52 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:49854 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbeJCSFw (ORCPT ); Wed, 3 Oct 2018 14:05:52 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5186018A; Wed, 3 Oct 2018 04:17:56 -0700 (PDT) Received: from [10.4.13.23] (en101.emea.arm.com [10.4.13.23]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6834B3F5A0; Wed, 3 Oct 2018 04:17:54 -0700 (PDT) Subject: Re: [PATCH 1/4] mm/hugetlb: Enable PUD level huge page migration To: Anshuman Khandual , linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: punit.agrawal@arm.com, will.deacon@arm.com, Steven.Price@arm.com, catalin.marinas@arm.com, mhocko@kernel.org, mike.kravetz@oracle.com, n-horiguchi@ah.jp.nec.com References: <1538482531-26883-1-git-send-email-anshuman.khandual@arm.com> <1538482531-26883-2-git-send-email-anshuman.khandual@arm.com> <835085a2-79c2-4eb5-2c10-13bb2893f611@arm.com> From: Suzuki K Poulose Message-ID: <789784ee-4830-753b-5d14-f5c7d90622c4@arm.com> Date: Wed, 3 Oct 2018 12:17:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/10/18 12:10, Anshuman Khandual wrote: > > > On 10/03/2018 03:52 PM, Suzuki K Poulose wrote: >> >> >> On 02/10/18 13:56, Anshuman Khandual wrote: >>> >>> >>> On 10/02/2018 06:08 PM, Suzuki K Poulose wrote: >>>> Hi Anshuman >>>> >>>> On 02/10/18 13:15, Anshuman Khandual wrote: >>>>> Architectures like arm64 have PUD level HugeTLB pages for certain configs >>>>> (1GB huge page is PUD based on ARM64_4K_PAGES base page size) that can be >>>>> enabled for migration. It can be achieved through checking for PUD_SHIFT >>>>> order based HugeTLB pages during migration. >>>>> >>>>> Signed-off-by: Anshuman Khandual >>>>> --- >>>>>    include/linux/hugetlb.h | 3 ++- >>>>>    1 file changed, 2 insertions(+), 1 deletion(-) >>>>> >>>>> diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h >>>>> index 6b68e34..9c1b77f 100644 >>>>> --- a/include/linux/hugetlb.h >>>>> +++ b/include/linux/hugetlb.h >>>>> @@ -483,7 +483,8 @@ static inline bool hugepage_migration_supported(struct hstate *h) >>>>>    { >>>>>    #ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION >>>>>        if ((huge_page_shift(h) == PMD_SHIFT) || >>>>> -        (huge_page_shift(h) == PGDIR_SHIFT)) >>>>> +        (huge_page_shift(h) == PUD_SHIFT) || >>>> >>>> >>>>> +            (huge_page_shift(h) == PGDIR_SHIFT)) >>>> >>>> nit: Extra Tab ^^. >>> >>> The tab is in there when you apply this patch and all three checks are tab separated >>> in a newline. >> >> Well, with the patch applied, at least I can see 2 tabs for the >> PUD_SHIFT check and 3 tabs for PGDIR_SHIFT check. Which seems >> inconsistent. Is it just me (my mail client) ? > > I am sorry, you are right. Did not understand your point earlier. Yeah there is > increasing number of tabs for each new line with a conditional check. Is there > a problem with this style of indentation ? Though I will be happy to change. I have been under the idea that all the checks at the same level could have the same indentation. (i.e, 2 tabs in this case for each). Looks like there is no rule about it. How about replacing it with a switch..case ? Cheers Suzuki