From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933698AbcHaI1x (ORCPT ); Wed, 31 Aug 2016 04:27:53 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:22223 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933663AbcHaI1S (ORCPT ); Wed, 31 Aug 2016 04:27:18 -0400 Message-ID: <57C6933E.2090907@huawei.com> Date: Wed, 31 Aug 2016 16:20:14 +0800 From: Xishi Qiu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: , , Andrew Morton , CC: Linux MM , LKML Subject: two questions: hugetlb, how to set huge_bootmem_page->phys before gather_bootmem_prealloc() Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.25.179] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.57C6935A.01DA,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: c449507affd12c61034591d08bd3d2ef Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the system is 32 bit, usually we will have a highmem zone. I find gather_bootmem_prealloc() will free the huge_bootmem_page and then prep the new huge page in CONFIG_HIGHMEM. But alloc_bootmem_huge_page() we will use the beginning of the huge page to store the huge_bootmem_page struct, so how to set huge_bootmem_page->phys? commit(ee8f248d266ec6966c0ce6b7dec24de43dcc1b58) add phys addr to struct huge_bootmem_page Another question, commit(8b89a1169437541a2a9b62c8f7b1a5c0ceb0fbde) update the interface, and the following code actually fix a bug too, right? We should use phys instead of virt when calling free_bootmem_late(), But it has not reported to stable. - free_bootmem_late((unsigned long)m, - sizeof(struct huge_bootmem_page)); + memblock_free_late(__pa(m), + sizeof(struct huge_bootmem_page)); Thanks, Xishi Qiu