From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752653AbdAZWog (ORCPT ); Thu, 26 Jan 2017 17:44:36 -0500 Received: from mail-by2nam03on0125.outbound.protection.outlook.com ([104.47.42.125]:17056 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752169AbdAZWoe (ORCPT ); Thu, 26 Jan 2017 17:44:34 -0500 From: "Kani, Toshimitsu" To: "akpm@linux-foundation.org" CC: "zhenzhang.zhang@huawei.com" , "linux-kernel@vger.kernel.org" , "arbab@linux.vnet.ibm.com" , "abanman@sgi.com" , "linux-mm@kvack.org" , "dan.j.williams@intel.com" , "gregkh@linuxfoundation.org" , "rientjes@google.com" Subject: Re: [PATCH 2/2] base/memory, hotplug: fix a kernel oops in show_valid_zones() Thread-Topic: [PATCH 2/2] base/memory, hotplug: fix a kernel oops in show_valid_zones() Thread-Index: AQHSeBWjOkXjwcJt+kuo8lphqr5N1KFLTOwAgAAY2QA= Date: Thu, 26 Jan 2017 22:26:23 +0000 Message-ID: <1485472910.2029.28.camel@hpe.com> References: <20170126214415.4509-1-toshi.kani@hpe.com> <20170126214415.4509-3-toshi.kani@hpe.com> <20170126135254.cbd0bdbe3cdc5910c288ad32@linux-foundation.org> In-Reply-To: <20170126135254.cbd0bdbe3cdc5910c288ad32@linux-foundation.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=toshi.kani@hpe.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [15.219.163.9] x-ms-office365-filtering-correlation-id: 6c5851ca-c6d0-4eaa-e028-08d4463a5c7d x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CS1PR84MB0295; x-microsoft-exchange-diagnostics: 1;CS1PR84MB0295;7:noAfrqs7/n8AuNMVLaiPnykKNxlmvjZJGpk8hsqFmlFR7PX21EJRZR+rJxXs61FsFEEMsUPkDhXXS75qJRHUxIRyoJvCD+zHCFXk1/sIbghv1aEwmMnU0ubPMHSw84VOltFBTVK/s0nXOyHJ4tFlYlfPaT0h/SYaP7521DewQk32FutXua5xngRvZ3Il+jKuB0pE9GxtEhjH9RP5ndUES8FH9t2zPx36TXG6963wZrvqCb4UCPk6ZxyW4V4KjTxImzEM5h6YfCFOWLNtF2LvvPAmMTtdlRIZmlFPp+93yjLVvzwJlBc+roN9C/+5IQlVdNXalLl57uJ1v241sGF+l9VCu/CJl7szBILyH17a+lFAWAJv5+NZ5kem2KI1RquJDRhtYQaXMClkB4jxW7KSQWHT5243EqSpUpVGgxhYI5oZuhmIUb7sK2X92SWKTMD6CMwiH+6EC63fZy73vorxnw== x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(227479698468861)(36064498253994); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(6072148);SRVR:CS1PR84MB0295;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0295; x-forefront-prvs: 019919A9E4 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(39410400002)(39850400002)(39840400002)(39860400002)(39450400003)(54534003)(24454002)(189002)(377424004)(199003)(2351001)(7736002)(106116001)(4326007)(105586002)(106356001)(5640700003)(101416001)(229853002)(103116003)(36756003)(33646002)(6436002)(3846002)(50986999)(6116002)(102836003)(76176999)(3280700002)(54356999)(966004)(77096006)(6486002)(38730400001)(6506006)(53936002)(189998001)(2501003)(3660700001)(5660300001)(92566002)(122556002)(6916009)(2950100002)(97736004)(68736007)(86362001)(2906002)(305945005)(6512007)(8676002)(54906002)(1730700003)(6306002)(81156014)(8936002)(66066001)(81166006)(110136003)(2900100001);DIR:OUT;SFP:1102;SCL:1;SRVR:CS1PR84MB0295;H:CS1PR84MB0294.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <092889B8DAAF034D972DEB9F1620A498@NAMPRD84.PROD.OUTLOOK.COM> MIME-Version: 1.0 X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jan 2017 22:26:23.7711 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR84MB0295 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v0QMiujL016250 On Thu, 2017-01-26 at 13:52 -0800, Andrew Morton wrote: > On Thu, 26 Jan 2017 14:44:15 -0700 Toshi Kani > wrote: > > > Reading a sysfs memoryN/valid_zones file leads to the following > > oops when the first page of a range is not backed by struct page. > > show_valid_zones() assumes that 'start_pfn' is always valid for > > page_zone(). > > > >  BUG: unable to handle kernel paging request at ffffea017a000000 > >  IP: show_valid_zones+0x6f/0x160 > > > > Since test_pages_in_a_zone() already checks holes, extend this > > function to return 'valid_start' and 'valid_end' for a given range. > > show_valid_zones() then proceeds with the valid range. > > This doesn't apply to current mainline due to changes in > zone_can_shift().  Please redo and resend. Sorry, I will rebase to the -mm tree and resend the patches. > Please also update the changelog to provide sufficient information > for others to decide which kernel(s) need the fix.  In particular: > under what circumstances will it occur?  On real machines which real > people own? Yes, this issue happens on real x86 machines with 64GiB or more memory. On such systems, the memory block size is bumped up to 2GiB. [1] Here is an example system. 0x3240000000 is only aligned by 1GiB and its memory block starts from 0x3200000000, which is not backed by struct page.  BIOS-e820: [mem 0x0000003240000000-0x000000603fffffff] usable I will add the descriptions to the patch. [1] http://lkml.iu.edu/hypermail/linux/kernel/1411.0/02287.html Thanks, -Toshi