From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932789AbcIVIFV (ORCPT ); Thu, 22 Sep 2016 04:05:21 -0400 Received: from out0-157.mail.aliyun.com ([140.205.0.157]:39230 "EHLO out0-157.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753162AbcIVIFS (ORCPT ); Thu, 22 Sep 2016 04:05:18 -0400 X-Greylist: delayed 394 seconds by postgrey-1.27 at vger.kernel.org; Thu, 22 Sep 2016 04:05:18 EDT X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03308;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=14;SR=0;TI=SMTPD_---.7-M1GdS_1474531096; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "'Gerald Schaefer'" , "'Andrew Morton'" , "'Naoya Horiguchi'" Cc: , , "'Michal Hocko'" , "'Kirill A . Shutemov'" , "'Vlastimil Babka'" , "'Mike Kravetz'" , "'Aneesh Kumar K . V'" , "'Martin Schwidefsky'" , "'Heiko Carstens'" , "'Dave Hansen'" , "'Rui Teng'" References: <20160920155354.54403-1-gerald.schaefer@de.ibm.com> <20160920155354.54403-2-gerald.schaefer@de.ibm.com> <05d701d213d1$7fb70880$7f251980$@alibaba-inc.com> <20160921143534.0dd95fe7@thinkpad> In-Reply-To: <20160921143534.0dd95fe7@thinkpad> Subject: Re: [PATCH v2 1/1] mm/hugetlb: fix memory offline with hugepage size > memory block size Date: Thu, 22 Sep 2016 15:58:15 +0800 Message-ID: <003e01d214a7$13a72220$3af56660$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQGdgOGGb3gdWTxMo8wXsJcMytekfQI4fuo9AhEMDCUCBZZ2r6C70kQw Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > dissolve_free_huge_pages() will either run into the VM_BUG_ON() or a > list corruption and addressing exception when trying to set a memory > block offline that is part (but not the first part) of a hugetlb page > with a size > memory block size. > > When no other smaller hugetlb page sizes are present, the VM_BUG_ON() > will trigger directly. In the other case we will run into an addressing > exception later, because dissolve_free_huge_page() will not work on the > head page of the compound hugetlb page which will result in a NULL > hstate from page_hstate(). > > To fix this, first remove the VM_BUG_ON() because it is wrong, and then > use the compound head page in dissolve_free_huge_page(). > > Also change locking in dissolve_free_huge_page(), so that it only takes > the lock when actually removing a hugepage. > > Signed-off-by: Gerald Schaefer > --- Acked-by: Hillf Danton