Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp471536imm; Fri, 31 Aug 2018 05:29:56 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbOCESZbIY7oI8xusMt0Bzbtvd5NhLg1sNg2RttQt4Vaum++FlqnWNP7OHDjLgtNqgV2+Dj X-Received: by 2002:a17:902:7b87:: with SMTP id w7-v6mr15060798pll.142.1535718596268; Fri, 31 Aug 2018 05:29:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535718596; cv=none; d=google.com; s=arc-20160816; b=V4aufR1blwAsRhrQIvDz4MAZWgkMy/ineu827HO5uJk9BoPHgollA+LOEcuYNtrL9c PeZ7OfuvQh/YUQZhvHh/0uPnuRzKPBRMgpFDdq1T4aZwPQY5mZvh/C7nDA8/a5nyBF4R FKXRVhIbmiO+BF1RBi4T/mznfK9XM01VxPf8MPraCRIha2UzdUxvE5djYNMbNSdMV391 gKZxalDC1g/XnBCw0wfbTJ9oKcA6gpKeet81C109ZTcaGBaT56HUOhR6HZNyiNwr7Qws UbWB/loY3498Qq3Fz1GuutqDMKNabMivr5ax4a4QPzESyLstC3o5iE5P+ruVMGdWueel YxOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :arc-authentication-results; bh=nb0sSpJawUV5K6BUvKBAn3n65py4ir9SU4ZhAxs7UI0=; b=UqoPA7tqVK67hDpfEX6KaCgwDubinGhsMVyVSxlASEa5G7Mufcy4oeYbX8xsGSbYAS 6Rxwh2q171tndlV4REsQxck/DygWr7Bp0Pd/L40cGpGT32dC2IbmCSrdPc8kbiMBqNCm uhYI0afgfNCze2UBNXH3hZDP4bROHasjyGv832kiiXApsyXMGEXao7AzMH8f8J4IgAfz 1l4UBERlZ3QPKnbueFIQkt/754EkLur/nqwyjbon817nwX5d5E7QzmZ1dP39vcTYMBll RRMgAbGgvTuudH92ksrYNSH6Os/J64QseMuLWSEy1WlcZdXOxg1zRJpHcQML/5lqp90d 1Y8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 81-v6si9690501pgd.57.2018.08.31.05.29.40; Fri, 31 Aug 2018 05:29:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728265AbeHaQfv (ORCPT + 99 others); Fri, 31 Aug 2018 12:35:51 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:33037 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727268AbeHaQfu (ORCPT ); Fri, 31 Aug 2018 12:35:50 -0400 Received: by mail-wr1-f67.google.com with SMTP id v90-v6so11071844wrc.0; Fri, 31 Aug 2018 05:28:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=nb0sSpJawUV5K6BUvKBAn3n65py4ir9SU4ZhAxs7UI0=; b=OnMeZRKi03hx2lSWl9XelXlonN+HG6psiIhm/+kg2ssTbbT0FqPOJs4PiIP1a1VsW1 tEwWdN01roRqzSTjGp7+LIn+FswOkigjICv2nYapVKD592ukVx9dO3aRCMx4sETCsykF 65WMzrHAWV4WebDqmNH6c2wcC0KVXVnEf2RdptMkFRUR0syeWUwwfotuRhVx+7j2/pyM ErUGpMpdpRgj/E5rNER181JfvN5laldTw/RsDSg2AFkpOX2msJj4M4stbhyHH54z1Yfs ujhmdL/gW6tP7ZtQixFY9Iv+Fo1f/TJeRsX39n5ddbK5ee8V89eTadaRBufh2X517OkR Q30w== X-Gm-Message-State: APzg51A+InKJC1zplD4hbsti+G6rvyyCgRg0KD+L6ZRUXQa1Pp+vH7Xz /iWC7e2pYJ4nI2JNDMra53c= X-Received: by 2002:adf:bacf:: with SMTP id w15-v6mr11318590wrg.203.1535718511937; Fri, 31 Aug 2018 05:28:31 -0700 (PDT) Received: from ?IPv6:2a01:4240:2e27:ad85:aaaa::70f? ([2a01:4240:2e27:ad85:aaaa::70f]) by smtp.gmail.com with ESMTPSA id h206-v6sm1447658wmf.25.2018.08.31.05.28.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 05:28:31 -0700 (PDT) Subject: Re: [PATCH v1] mm: relax deferred struct page requirements To: Pasha Tatashin Cc: "mhocko@kernel.org" , Steven Sistare , Daniel Jordan , "benh@kernel.crashing.org" , "paulus@samba.org" , Andrew Morton , "kirill.shutemov@linux.intel.com" , Reza Arbab , "schwidefsky@de.ibm.com" , Heiko Carstens , "x86@kernel.org" , LKML , "tglx@linutronix.de" , "linuxppc-dev@lists.ozlabs.org" , Linux Memory Management List , "linux-s390@vger.kernel.org" , "mgorman@techsingularity.net" References: <20171117014601.31606-1-pasha.tatashin@oracle.com> <20171121072416.v77vu4osm2s4o5sq@dhcp22.suse.cz> <83d035f1-40b4-bed8-6113-f4c5a0c4d22f@suse.cz> <7aee9274-9e8e-4a40-a9e5-3c9ef28511b7@microsoft.com> <87516e50-a17c-6c80-e9b5-ba68eda9ce33@microsoft.com> <597f3f35-6aad-6ca1-ba03-b93444b1cb5f@suse.cz> <0acf1c74-1bd3-e425-f92b-5d084ff954a4@suse.cz> <5070bde7-d20e-a464-a566-e97a13264b94@microsoft.com> From: Jiri Slaby Openpgp: preference=signencrypt Autocrypt: addr=jslaby@suse.cz; prefer-encrypt=mutual; keydata= xsFNBE6S54YBEACzzjLwDUbU5elY4GTg/NdotjA0jyyJtYI86wdKraekbNE0bC4zV+ryvH4j rrcDwGs6tFVrAHvdHeIdI07s1iIx5R/ndcHwt4fvI8CL5PzPmn5J+h0WERR5rFprRh6axhOk rSD5CwQl19fm4AJCS6A9GJtOoiLpWn2/IbogPc71jQVrupZYYx51rAaHZ0D2KYK/uhfc6neJ i0WqPlbtIlIrpvWxckucNu6ZwXjFY0f3qIRg3Vqh5QxPkojGsq9tXVFVLEkSVz6FoqCHrUTx wr+aw6qqQVgvT/McQtsI0S66uIkQjzPUrgAEtWUv76rM4ekqL9stHyvTGw0Fjsualwb0Gwdx ReTZzMgheAyoy/umIOKrSEpWouVoBt5FFSZUyjuDdlPPYyPav+hpI6ggmCTld3u2hyiHji2H cDpcLM2LMhlHBipu80s9anNeZhCANDhbC5E+NZmuwgzHBcan8WC7xsPXPaiZSIm7TKaVoOcL 9tE5aN3jQmIlrT7ZUX52Ff/hSdx/JKDP3YMNtt4B0cH6ejIjtqTd+Ge8sSttsnNM0CQUkXps w98jwz+Lxw/bKMr3NSnnFpUZaxwji3BC9vYyxKMAwNelBCHEgS/OAa3EJoTfuYOK6wT6nadm YqYjwYbZE5V/SwzMbpWu7Jwlvuwyfo5mh7w5iMfnZE+vHFwp/wARAQABzSBKaXJpIFNsYWJ5 IDxqaXJpc2xhYnlAZ21haWwuY29tPsLBewQTAQIAJQIbAwYLCQgHAwIGFQgCCQoLBBYCAwEC HgECF4AFAk6S6P4CGQEACgkQvSWxBAa0cEl1Sg//UMXp//d4lP57onXMC2y8gafT1ap/xuss IvXR+3jSdJCHRaUFTPY2hN0ahCAyBQq8puUa6zaXco5jIzsVjLGVfO/s9qmvBTKw9aP6eTU7 77RLssLlQYhRzh7vap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52.9.1 MIME-Version: 1.0 In-Reply-To: <5070bde7-d20e-a464-a566-e97a13264b94@microsoft.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/31/2018, 02:10 PM, Pasha Tatashin wrote: > Thanks Jiri, I am now able to reproduce it with your new config. > > I have tried yesterday to enable sparsemem and deferred_struct_init on > x86_32, and that kernel booted fine, there must be something else in > your config that helps to trigger this problem. I am studying it now. > > [ 0.051245] Initializing CPU#0 > [ 0.051682] Initializing HighMem for node 0 (000367fe:0007ffe0) > [ 0.067499] BUG: unable to handle kernel NULL pointer dereference at > 00000028 > [ 0.068452] *pdpt = 0000000000000000 *pde = f000ff53f000ff53 > [ 0.069105] Oops: 0000 [#1] PREEMPT SMP PTI > [ 0.069595] CPU: 0 PID: 0 Comm: swapper Not tainted > 4.19.0-rc1-pae_pt_jiri #1 > [ 0.070382] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), > BIOS 1.11.0-20171110_100015-anatol 04/01/2014 > [ 0.071545] EIP: free_unref_page_prepare.part.70+0x2c/0x50 > [ 0.072178] Code: 19 e9 ff 89 d1 55 c1 ea 11 c1 e9 07 8b 14 d5 44 52 > fd d6 81 e1 fc 03 00 00 89 e5 56 53 89 cb be 1d 00 00 00 c1 eb 05 83 e1 > 1f <8b> 14 9a 29 ce 89 f1 d3 ea 83 e2 07 89 50 10 b8 01 00 00 00 5b 5e > [ 0.074296] EAX: f4cfa000 EBX: 0000000a ECX: 00000010 EDX: 00000000 > [ 0.075005] ESI: 0000001d EDI: 0007ffe0 EBP: d6d41ed0 ESP: d6d41ec8 > [ 0.075714] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00210002 > [ 0.076508] CR0: 80050033 CR2: 00000028 CR3: 16f20000 CR4: 000406b0 > [ 0.077242] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000 > [ 0.077934] DR6: fffe0ff0 DR7: 00000400 > [ 0.078380] Call Trace: > [ 0.078670] free_unref_page+0x3a/0x90 > [ 0.079136] __free_pages+0x25/0x30 > [ 0.079533] free_highmem_page+0x1e/0x50 > [ 0.079978] add_highpages_with_active_regions+0xd1/0x11f > [ 0.080592] set_highmem_pages_init+0x67/0x7d > [ 0.081076] mem_init+0x30/0x1fc page_to_pfn(pfn_to_page(pfn)) != pfn with my .config on pfns >= 0x60000: [ 0.157667] add_highpages_with_active_regions: pfn=5fffb pg=f55f9f4c pfn(pg(pfn)=5fffb sec=2 [ 0.159231] add_highpages_with_active_regions: pfn=5fffc pg=f55f9f70 pfn(pg(pfn)=5fffc sec=2 [ 0.161020] add_highpages_with_active_regions: pfn=5fffd pg=f55f9f94 pfn(pg(pfn)=5fffd sec=2 [ 0.163149] add_highpages_with_active_regions: pfn=5fffe pg=f55f9fb8 pfn(pg(pfn)=5fffe sec=2 [ 0.165204] add_highpages_with_active_regions: pfn=5ffff pg=f55f9fdc pfn(pg(pfn)=5ffff sec=2 [ 0.167216] add_highpages_with_active_regions: pfn=60000 pg=f4cfa000 pfn(pg(pfn)=c716a800 sec=3 So add_highpages_with_active_regions passes down page to free_highmem_page and later, free_unref_page does page_to_pfn(page) and __get_pfnblock_flags_mask operates on this modified pfn leading to crash – __pfn_to_section(pfn)->pageblock_flags is NULL! Note that __pfn_to_section(pfn)->pageblock_flags on the original pfn returns a valid bitmap. thanks, -- js suse labs