Received: by 10.223.148.5 with SMTP id 5csp6430213wrq; Wed, 17 Jan 2018 13:40:33 -0800 (PST) X-Google-Smtp-Source: ACJfBovgS+gmz4T0QJH1gkiKPd7GpSZRISfC8rdT/eFJpkR0/haUdL63GR7VUNvaRa0P9S6XdbVE X-Received: by 10.84.168.196 with SMTP id f62mr20787171plb.106.1516225232936; Wed, 17 Jan 2018 13:40:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516225232; cv=none; d=google.com; s=arc-20160816; b=RmyGNMo+r6J7mW0ZJy1kco65y4OgcydXjXhmfosRI/3yQHHHEOL20xpsJkT76W+YOn FUIw8xnEcYnbTxlwnhdfGhDuezROUZvEEYexk18Ml35L6bSJx6yT54hHYotkBWR67k+e l6uqfbbZ0gkMzpm7kULeYv5Os/22thath2gYL4FfjCxT5k+hhU7mauv0SPf4lx2jIOJs ajmgiLIufVHHPH/mvTasdNi71ASnI8gFiHBVRRSbrU8SHiPciTXA3LdiHsQ0qFhsdd7n kFOcPQiKeIzsu6uigLGJIu4CZko7Inv8fuLVSoz9GzJTm/pkjiaWe3okQxR9glJR8/EU zw7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=xKkRif17G5gXZBpY5TRQcS3KL/GzB7iGLC1oSsDisl4=; b=R9/poPHytFDgNB0nnT3MkpVeoDlYXVqYn5507oPaXG/WPpID2Q2zlAxOMLZWtSlzDd mnuSN+8/VgupMnteNSkXzgRtZS8Z04+b3RdB30hoBTpvSUtgNdfawGWhiSeCphX4pha8 ObjrmK8Fj3Jve/NJXj8MwwoxjS2EfKYU+Y/saqjCKWuuurd3AzuOxRIVMd6BNx4LlaZq 8n0yFVyjybeeC9i3JNcKqD3NjYNGXr7FzRm4+bECFiioJHlwKKx760lz4vxcaT4PXY2e ZIPeqDJIBVqvNHD63JUtwOFf6g+x34yBYgLcjd7Fr0nFcpkM5z5qREiqSSDVx5F/1sBK GPcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=LGk4Lwbr; 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 u69si4557492pgb.10.2018.01.17.13.40.18; Wed, 17 Jan 2018 13:40:32 -0800 (PST) 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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=LGk4Lwbr; 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 S1753211AbeAQVjv (ORCPT + 99 others); Wed, 17 Jan 2018 16:39:51 -0500 Received: from mail-io0-f182.google.com ([209.85.223.182]:40875 "EHLO mail-io0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752250AbeAQVju (ORCPT ); Wed, 17 Jan 2018 16:39:50 -0500 Received: by mail-io0-f182.google.com with SMTP id t22so10304530ioa.7 for ; Wed, 17 Jan 2018 13:39:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=xKkRif17G5gXZBpY5TRQcS3KL/GzB7iGLC1oSsDisl4=; b=LGk4LwbrekqfSfnpMjUILxmvYo0sucweOR8WuqsprRooFNAXwuhV+8kZR7s51Q8bNF /tOUQZdmHDIaqS8xQDXnlAaWSQkfCX+63lCq6fu7wA23JnLTp+s1oZx9RPmc9mWYKpiv QuAxV10mTgtvlPGjARDTMyC9Qe4horQGw+td7NwgIqKAM2lmBXfIg+KNkkf5+vkUYUz2 7+HXx8ME0J/Qbt5hDUbDUx5FfIH3AsKjnavTAnRB89vXio42LZ+Tp+EZ/SZqawiRDuEy tBkdqxNQ0G99SbQAoJ2JH8/aADqEHbtL3IXpgfT+L+Xzc85TD3p2ahDcM5jaah3hy1TE QvEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=xKkRif17G5gXZBpY5TRQcS3KL/GzB7iGLC1oSsDisl4=; b=T7R61IUVZrT0SB//xO3KcaBSaCOKBjiGcoQW9L8HBQn13ZyDcQLJHhS8K6UhY3d9FT 8W3S0I+2GQttgvIXjMWMbZW00smMb4FJTfVZOF7yUCEtirddF0RRzpvpCyhIWuHJI/8g BJ0IOCd0m8e99ccXOO4+pg90Epan/KkBtyDjmEB6HJhTEc4qf84xsZCC67aoOeTQmIYl GOB31/NnTZHANYpV8ZbuBykBCghbCF9GrYtSOeu1tYOUeiuPlHZHAwciT+fSD/8wWvqE NwpLyn47fRonv/wIx6GCMHBH3n2wcF8QYIcgEVo6OPoMQFkK5mZfvgJ4OI+9JFyvT+Mk gwOg== X-Gm-Message-State: AKGB3mLbpuO3288UAVX/jUOWMknKyirx7AdnGK1kOyXIEKP+Sc6TQdaS 5HzRl+O16JN5jVoJ3+x2woB0a4KeFNbucL/dtPU= X-Received: by 10.107.13.12 with SMTP id 12mr45484903ion.174.1516225189319; Wed, 17 Jan 2018 13:39:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.6.147 with HTTP; Wed, 17 Jan 2018 13:39:48 -0800 (PST) In-Reply-To: <201801172008.CHH39543.FFtMHOOVSQJLFO@I-love.SAKURA.ne.jp> References: <201801160115.w0G1FOIG057203@www262.sakura.ne.jp> <201801170233.JDG21842.OFOJMQSHtOFFLV@I-love.SAKURA.ne.jp> <201801172008.CHH39543.FFtMHOOVSQJLFO@I-love.SAKURA.ne.jp> From: Linus Torvalds Date: Wed, 17 Jan 2018 13:39:48 -0800 X-Google-Sender-Auth: 9EhZQuZSCgkgyyaBW8G3uWlwtC8 Message-ID: Subject: Re: [mm 4.15-rc8] Random oopses under memory pressure. To: Tetsuo Handa Cc: "Kirill A. Shutemov" , Andrew Morton , Johannes Weiner , Joonsoo Kim , Mel Gorman , Tony Luck , Vlastimil Babka , Michal Hocko , Dave Hansen , Ingo Molnar , Linux Kernel Mailing List , linux-mm , "the arch/x86 maintainers" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 17, 2018 at 3:08 AM, Tetsuo Handa wrote: > > I needed to bisect between 4.10 and 4.11, and I got plausible culprit. > [...] > git bisect bad b4fb8f66f1ae2e167d06c12d018025a8d4d3ba7e > # first bad commit: [b4fb8f66f1ae2e167d06c12d018025a8d4d3ba7e] mm, page_alloc: Add missing check for memory holes Ok, that is indeed much more likely, and very much matches the whole "this problem only happens with sparsemem" issue. In fact, the whole pfn_valid_within(buddy_pfn) test looks very odd. Maybe the pfn of the buddy is valid, but it's not in the same zone? Then we'd combine the two pages in two different zones into one combined page. Maybe that's why HIGHMEM matters? The low DMA zone is obviously aligned in the whole PAGE_ORDER range. But the highmem zone might not be. I used to know the highmem code, but I've happily forgotten everything. But I think we end up deciding on some random non-aligned number in the 900MB range as being the limit between the regular zone and the HIGHMEM zone. So maybe something like this to test the theory? diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 76c9688b6a0a..f919a5548943 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -756,6 +756,8 @@ static inline void rmv_page_order(struct page *page) static inline int page_is_buddy(struct page *page, struct page *buddy, unsigned int order) { + if (WARN_ON_ONCE(page_zone(page) != page_zone(buddy))) + return 0; if (page_is_guard(buddy) && page_order(buddy) == order) { if (page_zone_id(page) != page_zone_id(buddy)) return 0; I don't know. Does that warning trigger for you? The above is completely untested. It might not compile. If it compiles it might not work. And even if it "works", it might not matter, because perhaps the boundary between regular memory and HIGHMEM is already sufficiently aligned. Comments? Linus