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=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 DD820C433E2 for ; Fri, 17 Jul 2020 17:26:40 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ADB4320737 for ; Fri, 17 Jul 2020 17:26:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dPbigK2d"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="iJmBdc5/"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="ZVR12+8A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ADB4320737 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lXOd5b2pKtepEtxHCEAixgjr5hzbQDAZs+eYvrIdGxI=; b=dPbigK2dpMWavMm7THTN0+U7T jWKiCeoelnDohGJ/ZwpB6z/mIJqdhi99/+3kAnKkjxwWHLFqvp6HUvvjyqGLPptlj4cPAw4qd/peq mltFDcdkwLh7TvgONF6hnFMBAQjjPfsaUXPhumFpZNksDfudJo4Kw8/SpUpWLL2o09OsUWwmWxABd K/JP/YTcrpI8/mIoCOQyOMKDPpK0t4PkYYXc4m4wLQGYLP/ZDxvUJkGuWqb3FtvRr/DSu1Fy6IYtH RKfvvvIZiSnXHr0+sOKKWlYxFDY4UlY878TAuo1UpufLlwaCzzxtr0k9cHnbpmctcwg8DI0sbuWR0 Z5RWNvipA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwU6m-0003XV-1y; Fri, 17 Jul 2020 17:25:16 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwU6j-0003Wy-Rm for linux-arm-kernel@merlin.infradead.org; Fri, 17 Jul 2020 17:25:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=jYNO0+Oailn1mCGSYSTW+k8UQDhh58KKaKRy8a62Dfg=; b=iJmBdc5/nrjdPxEL3npRGgnhUP l2J9Z6IITkzomLmP/DYHozYbzuvsIQpEvL8oGFkUgLgiDWmKPIRss6v+x7rHzh7ZygchulLrW3SWD lXEl9tP8Mu3/cVCXkj6mX4eLMxqu2jc7iMMsTM22PHiEKFTEnvCzVTL4Q1volUNtpjm/BBoswVivK FslDJiBBskSqx8pMe1xHBCzC+leeBuz58MTwgEFK/zFmr3OBxmzcaOl55hFu9aSAowwVwZ0KZBnrr TcNSyMZxz8VFfJ4MX4Jed4ZN06aa1bu/4V/YQ4YU6u6yQxB92R8sbsCRYvh5eq88IspSUe8RJnpmu 2yxyjEBw==; Received: from aserp2130.oracle.com ([141.146.126.79]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwTlY-0000W1-9i for linux-arm-kernel@lists.infradead.org; Fri, 17 Jul 2020 17:03:24 +0000 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 06HGwCdC051024; Fri, 17 Jul 2020 17:02:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=jYNO0+Oailn1mCGSYSTW+k8UQDhh58KKaKRy8a62Dfg=; b=ZVR12+8AQ/+x1jr/t5KkspwgFzKWkQX6qlePTN8IAlMPpZbP8wvJ6K+tz5R4IT5IjiOv gMlHief6PEjwOcBy9/FeuPThpFvPQ4C9jXIUbx8HbQbRkbc5VI2+wX5BS89vVfvHgCR0 yM6K24taG6IuBqKQ3CU7wM1Q6N2d6nz5BgxIZqIhIiT4rvY8DTF4JdZ3n1CX5sizaJ78 AtREaiO0TAG7qcJiRePk2XtKmWNaGxwD16SFKZAM4oMNAfyQzGrZM4sdiOez/qrugUT/ MTag2/aUxkKB+ARF1XOb0fPPFtDGFr2UiTdhzEfNEAw1T27sMREkX24i06I3DyKZ4xjy DQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2130.oracle.com with ESMTP id 327s65xqg5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 17 Jul 2020 17:02:27 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 06HGwtLl003275; Fri, 17 Jul 2020 17:02:26 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 32bf3k4m48-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Jul 2020 17:02:26 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 06HH2Kav005669; Fri, 17 Jul 2020 17:02:22 GMT Received: from [192.168.2.112] (/50.38.35.18) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 17 Jul 2020 10:02:20 -0700 Subject: Re: [PATCH v3] mm/hugetlb: split hugetlb_cma in nodes with memory To: Anshuman Khandual , Will Deacon , Roman Gushchin References: <20200710120950.37716-1-song.bao.hua@hisilicon.com> <359ea1d0-b1fd-d09f-d28a-a44655834277@oracle.com> <20200715081822.GA5683@willie-the-truck> <5724f1f8-63a6-ee0f-018c-06fb259b6290@oracle.com> <20200716081243.GA6561@willie-the-truck> <81103d30-f4fd-8807-03f9-d131da5097bd@arm.com> From: Mike Kravetz Message-ID: <1efdfe52-abdb-3931-742c-70e4a170e403@oracle.com> Date: Fri, 17 Jul 2020 10:02:18 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <81103d30-f4fd-8807-03f9-d131da5097bd@arm.com> Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9685 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=100 bulkscore=0 phishscore=0 adultscore=0 spamscore=100 mlxlogscore=-1000 suspectscore=0 malwarescore=0 mlxscore=100 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007170119 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9685 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=100 adultscore=0 malwarescore=0 phishscore=0 mlxscore=100 priorityscore=1501 lowpriorityscore=0 spamscore=100 clxscore=1015 bulkscore=0 mlxlogscore=-1000 impostorscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007170119 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200717_180321_104959_9880C27B X-CRM114-Status: GOOD ( 29.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Barry Song , "H.Peter Anvin" , Catalin Marinas , x86@kernel.org, linux-kernel@vger.kernel.org, linuxarm@huawei.com, linux-mm@kvack.org, Ingo Molnar , Borislav Petkov , Jonathan Cameron , Thomas Gleixner , Mike Rapoport , akpm@linux-foundation.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 7/16/20 10:02 PM, Anshuman Khandual wrote: > > > On 07/16/2020 11:55 PM, Mike Kravetz wrote: >> >From 17c8f37afbf42fe7412e6eebb3619c6e0b7e1c3c Mon Sep 17 00:00:00 2001 >> From: Mike Kravetz >> Date: Tue, 14 Jul 2020 15:54:46 -0700 >> Subject: [PATCH] hugetlb: move cma reservation to code setting up gigantic >> hstate >> >> Instead of calling hugetlb_cma_reserve() directly from arch specific >> code, call from hugetlb_add_hstate when adding a gigantic hstate. >> hugetlb_add_hstate is either called from arch specific huge page setup, >> or as the result of hugetlb command line processing. In either case, >> this is late enough in the init process that all numa memory information >> should be initialized. And, it is early enough to still use early >> memory allocator. > > This assumes that hugetlb_add_hstate() is called from the arch code at > the right point in time for the generic HugeTLB to do the required CMA > reservation which is not ideal. I guess it must have been a reason why > CMA reservation should always called by the platform code which knows > the boot sequence timing better. Actually, the code does not make the assumption that hugetlb_add_hstate is called from arch specific huge page setup. It can even be called later at the time of hugetlb command line processing. My 'reasoning' is that gigantic pages can currently be preallocated from bootmem/memblock_alloc at the time of command line processing. Therefore, we should be able to reserve bootmem for CMA at the same time. Is there something wrong with this reasoning? I tested this on x86 by removing the call to hugetlb_add_hstate from arch specific code and instead forced the call at command line processing time. The ability to reserve CMA was the same. Yes, the CMA reservation interface says it should be called from arch specific code. However, if we currently depend on the ability to do memblock_alloc at hugetlb command line processing time for gigantic page preallocation, then I think we can do the CMA reservation here as well. Thinking about it some more, I suppose there could be some arch code that could call hugetlb_add_hstate too early in the boot process. But, I do not think we have an issue with calling it too late. -- Mike Kravetz _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel