From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757643AbcIPN7L (ORCPT ); Fri, 16 Sep 2016 09:59:11 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:54547 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755319AbcIPN7C (ORCPT ); Fri, 16 Sep 2016 09:59:02 -0400 Subject: Re: [PATCH] memory-hotplug: Fix bad area access on dissolve_free_huge_pages() To: Dave Hansen , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1473755948-13215-1-git-send-email-rui.teng@linux.vnet.ibm.com> <57D83821.4090804@linux.intel.com> <57D97CAF.7080005@linux.intel.com> Cc: Andrew Morton , Naoya Horiguchi , Michal Hocko , "Kirill A . Shutemov" , Vlastimil Babka , Mike Kravetz , "Aneesh Kumar K . V" , Paul Gortmaker , Santhosh G From: Rui Teng Date: Fri, 16 Sep 2016 21:58:48 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <57D97CAF.7080005@linux.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16091613-0024-0000-0000-00001497008A X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005771; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000185; SDB=6.00758324; UDB=6.00359914; IPR=6.00532023; BA=6.00004731; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012692; XFM=3.00000011; UTC=2016-09-16 13:58:54 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16091613-0025-0000-0000-0000448B520F Message-Id: <566c04af-c937-cbe0-5646-2cc2c816cc3f@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-16_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609020000 definitions=main-1609160177 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/15/16 12:37 AM, Dave Hansen wrote: > On 09/14/2016 09:33 AM, Rui Teng wrote: >> >> How about return the size of page freed from dissolve_free_huge_page(), >> and jump such step on pfn? > > That would be a nice improvement. > > But, as far as describing the initial problem, can you explain how the > tail pages still ended up being PageHuge()? Seems like dissolving the > huge page should have cleared that. > I use the scripts of tools/testing/selftests/memory-hotplug/mem-on- off-test.sh to test and reproduce this bug. And I printed the pfn range on dissolve_free_huge_pages(). The sizes of the pfn range are always 4096, and the ranges are separated. [ 72.362427] start_pfn: 204800, end_pfn: 208896 [ 72.371677] start_pfn: 2162688, end_pfn: 2166784 [ 72.373945] start_pfn: 217088, end_pfn: 221184 [ 72.383218] start_pfn: 2170880, end_pfn: 2174976 [ 72.385918] start_pfn: 2306048, end_pfn: 2310144 [ 72.388254] start_pfn: 2326528, end_pfn: 2330624 Sometimes, it will report a failure: [ 72.371690] memory offlining [mem 0x2100000000-0x210fffffff] failed And sometimes, it will report following: [ 72.373956] Offlined Pages 4096 Whether the start_pfn and end_pfn of dissolve_free_huge_pages could be *random*? If so, the range may not include any page head and start from tail page, right?