From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750842AbdA0SYn (ORCPT ); Fri, 27 Jan 2017 13:24:43 -0500 Received: from mail-sn1nam02on0091.outbound.protection.outlook.com ([104.47.36.91]:37818 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750730AbdA0SXh (ORCPT ); Fri, 27 Jan 2017 13:23:37 -0500 From: "Kani, Toshimitsu" To: "gregkh@linuxfoundation.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" , "akpm@linux-foundation.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+kuo8lphqr5N1KFLTOwAgAAY2QCAAI2sAIAAttIA Date: Fri, 27 Jan 2017 17:47:49 +0000 Message-ID: <1485542594.2029.30.camel@hpe.com> References: <20170126214415.4509-1-toshi.kani@hpe.com> <20170126214415.4509-3-toshi.kani@hpe.com> <20170126135254.cbd0bdbe3cdc5910c288ad32@linux-foundation.org> <1485472910.2029.28.camel@hpe.com> <20170127074854.GA31443@kroah.com> In-Reply-To: <20170127074854.GA31443@kroah.com> 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: bffe5ff5-bc71-4090-8cee-08d446dc9c1e x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CS1PR84MB0294; x-microsoft-exchange-diagnostics: 1;CS1PR84MB0294;7:VZT43Y3x6BAktl3/Q6aC/hNx5idZr+5H3fxMSg7mohIYXAvDqd2o2e9A7rxC+GwSuPWvG7C0lSTPhsY05iNaIitbErP8T9hHd9MBN/jRRjSamsm7gLc+C3XIm510wbPotM4ivdHmt05+dnO5jD3/8JytQDShyB7ocqf3HKJn+uR6q1v8mrHT95a8I4qn2820ZvQQnU9LiTLi1kcoAzno5PTdNxYEcAjqUUXGYXpMeX2oAxwBME+cdz6p46VeZ4scUJ1xXqtsRQ1f4W2B/kqQO6Pze74MFzLfCWEj1K/F3NtAavuVbeZmvB4dhqjgiI13l2qSlhVH2hSEouBqed1i150wv2HHiuK6sGXTnGVXPFMYBXbaHJ3K9Qg1F/qf9zQ5zQdcTn7er738v/JWF3Ifldg5t30uAedYnWx/d9LL7wbpmlhzxVQ7pB1CgHpK8C3k5HHc7ef5SMTh1yl3j8BphQ== x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(227479698468861); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148);SRVR:CS1PR84MB0294;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0294; x-forefront-prvs: 0200DDA8BE x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(39850400002)(39860400002)(39840400002)(39410400002)(39450400003)(199003)(54534003)(377424004)(24454002)(189002)(3846002)(6116002)(305945005)(8936002)(102836003)(53936002)(50986999)(76176999)(5660300001)(6436002)(6512007)(8676002)(1730700003)(5640700003)(7736002)(101416001)(81166006)(81156014)(3280700002)(54906002)(66066001)(2501003)(54356999)(2906002)(36756003)(4326007)(93886004)(68736007)(103116003)(33646002)(122556002)(106116001)(105586002)(106356001)(86362001)(6916009)(575784001)(6506006)(2950100002)(77096006)(6486002)(110136003)(229853002)(38730400001)(92566002)(2900100001)(189998001)(3660700001)(2351001)(97736004);DIR:OUT;SFP:1102;SCL:1;SRVR:CS1PR84MB0294;H:CS1PR84MB0294.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: MIME-Version: 1.0 X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jan 2017 17:47:49.0658 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR84MB0294 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 v0RIOkdn013186 On Fri, 2017-01-27 at 08:48 +0100, gregkh@linuxfoundation.org wrote: > On Thu, Jan 26, 2017 at 10:26:23PM +0000, Kani, Toshimitsu wrote: > > 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. > > Should it also be backported to the stable kernels to resolve the > issue there? Yes, it should be backported to the stable kernels. The memory block size change was made by commit bdee237c034, which was accepted to 3.9. However, this patch-set depends on (and fixes) the change to test_pages_in_a_zone() made by commit 5f0f2887f4, which was accepted to 4.4. So, in the current form, I'd recommend we backport it up to 4.4. Thanks, -Toshi