Received: by 10.223.185.116 with SMTP id b49csp7621795wrg; Thu, 1 Mar 2018 08:21:25 -0800 (PST) X-Google-Smtp-Source: AG47ELu0qJRn1F++BozONIjZsjOhVo07SGJSjzHSgmROQGbsew1whA4fjg2hLRHG/PEDv6li//4l X-Received: by 10.101.80.132 with SMTP id r4mr1977313pgp.185.1519921284962; Thu, 01 Mar 2018 08:21:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519921284; cv=none; d=google.com; s=arc-20160816; b=GjAMTASzVZIYZcSkiO7HHUNwlTnBlUPre9RPPUSoPXd5Kvq4YT0INIJbBwNiQdpeS7 xAKVNVKvKlEckJurLsQpLFrpzvhrna7C6PLMSTz6c9zceIXygtwIdyX0nQDEzSNAw0yn jYMzya4a3YYJoOd56aSLejieWd1n3dS3o9ZSdyYbA7Wp/lGMnA0WWzQV3iot+phSjvv5 9Crgvmldd/SvAsXJcecXCo3NhhwTFTDthV1tUqSinZbuiKQsvtGbZ/0ijli8s4csteo/ kwZkdGm6z1rmAFENNrkzbRGluukA9HQPbii3DRNgmRR1HfGHeOszY9DrCq3oSvdoR/So GyPQ== 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:arc-authentication-results; bh=AT/1u9/miHB82rFJb3gq79g0Vx20UtJ1g7F1pI3tvBk=; b=lAbWnSgFT6XEyzlZx8RGl3Jn2xDb2RyPVpr+zyNgbUhSpVZiDgVWPQIfWOfJVFaX0L Cf6Os0DRKJNS8XRD2b2QWS+J2iRy/xPSMaVpkAo8uSNtDOyzIN575eGV88of5DgFMP1s RdowkOWJ+A0RwI9MX2qsf0VoAnemF4G9djoGC1JRO0G3PraIfBalT6e89nR/3AUXB0w6 RTOtf0wAWe0O8iuWuNTGsL8qOyDeGf01P5ZOiEpf/V/ttwsr4lgn1Sy5GAePH1XMs/C3 j6Ngsk36EzbkGXPHBu+o0sYk+VMpT/yhVHUJZTe0HXFBVeCh9j3Dd4L8gKGRbJA8WC3H X6/Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a6-v6si3256325pll.495.2018.03.01.08.21.09; Thu, 01 Mar 2018 08:21:24 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032881AbeCAQUI (ORCPT + 99 others); Thu, 1 Mar 2018 11:20:08 -0500 Received: from mail-ot0-f194.google.com ([74.125.82.194]:39269 "EHLO mail-ot0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032862AbeCAQUG (ORCPT ); Thu, 1 Mar 2018 11:20:06 -0500 Received: by mail-ot0-f194.google.com with SMTP id h8so6069456oti.6 for ; Thu, 01 Mar 2018 08:20:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=AT/1u9/miHB82rFJb3gq79g0Vx20UtJ1g7F1pI3tvBk=; b=aINRmi1TFmebrgbSTzSl4JEkmm21guftaF6mOEU9uT7H0EHVkKZkfvKJ6Qi4BL+xOv qUf2RshZfQLg2m+qQ5wH7HER3sAzUjmwe/CcysijLP+JHPPG1pSNGrxYJSGTQLGvp4KZ Y1DF3e3FSSYTL4BI37dNb6xSFkXQWm24o582xsYAGnBPvYMcrcZv+MU96mu3gRjYqKTI 9nvQ7qFIO7GNcAxq7RcWmggcC/DGzEymEHRDoI1Vf3p0vz+4rMOFU2bL7Gp5Y8n+6u0K oxfB+i6+KEPV+VC+51feM7TDy6mNfGDJAO/epBPTR+IB4Qm4zIGDIte1r2a/19xWBCA1 I06A== X-Gm-Message-State: AElRT7HZGRvut5ZltH5n0yxv39KnvBzZ+8SN+IZANwiQBs8QMNpymfn8 Fk4cMhNtbzZF9h8QYRSsy8SEhej62Jdpb//WYME+ZcJ9 X-Received: by 10.157.73.130 with SMTP id g2mr1820452otf.257.1519921205382; Thu, 01 Mar 2018 08:20:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.57.246 with HTTP; Thu, 1 Mar 2018 08:20:04 -0800 (PST) In-Reply-To: <20180301152729.GM15057@dhcp22.suse.cz> References: <1519908465-12328-1-git-send-email-neelx@redhat.com> <20180301131033.GH15057@dhcp22.suse.cz> <20180301152729.GM15057@dhcp22.suse.cz> From: Daniel Vacek Date: Thu, 1 Mar 2018 17:20:04 +0100 Message-ID: Subject: Re: [PATCH] mm/page_alloc: fix memmap_init_zone pageblock alignment To: Michal Hocko Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Vlastimil Babka , Mel Gorman , Pavel Tatashin , Paul Burton , stable@vger.kernel.org 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 Thu, Mar 1, 2018 at 4:27 PM, Michal Hocko wrote: > On Thu 01-03-18 16:09:35, Daniel Vacek wrote: > [...] >> $ grep 7b7ff000 /proc/iomem >> 7b7ff000-7b7fffff : System RAM > [...] >> After commit b92df1de5d28 machine eventually crashes with: >> >> BUG at mm/page_alloc.c:1913 >> >> > VM_BUG_ON(page_zone(start_page) != page_zone(end_page)); > > This is an important information that should be in the changelog. And that's exactly what my seven very first words tried to express in human readable form instead of mechanically pasting the source code. I guess that's a matter of preference. Though I see grepping later can be an issue here. >> >From registers and stack I digged start_page points to >> ffffe31d01ed8000 (note that this is >> page ffffe31d01edffc0 aligned to pageblock) and I can see this in memory dump: >> >> crash> kmem -p 77fff000 78000000 7b5ff000 7b600000 7b7fe000 7b7ff000 >> 7b800000 7ffff000 80000000 >> PAGE PHYSICAL MAPPING INDEX CNT FLAGS >> ffffe31d01e00000 78000000 0 0 0 0 >> ffffe31d01ed7fc0 7b5ff000 0 0 0 0 >> ffffe31d01ed8000 7b600000 0 0 0 0 <<<< note > > Are those ranges covered by the System RAM as well? > >> that nodeid and zonenr are encoded in top bits of page flags which are >> not initialized here, hence the crash :-( >> ffffe31d01edff80 7b7fe000 0 0 0 0 >> ffffe31d01edffc0 7b7ff000 0 0 1 1fffff00000000 >> ffffe31d01ee0000 7b800000 0 0 1 1fffff00000000 >> ffffe31d01ffffc0 7ffff000 0 0 1 1fffff00000000 > > It is still not clear why not to do the alignment in > memblock_next_valid_pfn rather than its caller. As it's the mem init which needs it to be aligned. Other callers may not, possibly? Not that there are any other callers at the moment so it really does not matter where it is placed. The only difference would be the end of the loop with end_pfn vs aligned end_pfn. And it looks like the pure (unaligned) end_pfn would be preferred here. Wanna me send a v2? > -- > Michal Hocko > SUSE Labs