From patchwork Mon Dec 9 17:48:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 11279775 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C464314B7 for ; Mon, 9 Dec 2019 17:48:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 846042077B for ; Mon, 9 Dec 2019 17:48:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="B0OaSziR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 846042077B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B89646B27E7; Mon, 9 Dec 2019 12:48:50 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B3A456B27E8; Mon, 9 Dec 2019 12:48:50 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A4EBE6B27E9; Mon, 9 Dec 2019 12:48:50 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0081.hostedemail.com [216.40.44.81]) by kanga.kvack.org (Postfix) with ESMTP id 8CE3F6B27E7 for ; Mon, 9 Dec 2019 12:48:50 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 2CB4A181AEF1F for ; Mon, 9 Dec 2019 17:48:50 +0000 (UTC) X-FDA: 76246338420.06.nail29_6a2262be7c72d X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,david@redhat.com,:linux-kernel@vger.kernel.org::david@redhat.com:adobriyan@gmail.com:akpm@linux-foundation.org:bob.picco@oracle.com:daniel.m.jordan@oracle.com:dan.j.williams@intel.com:mhocko@kernel.org:mhocko@suse.com:n-horiguchi@ah.jp.nec.com:osalvador@suse.de:pasha.tatashin@oracle.com:sfr@canb.auug.org.au:steven.sistare@oracle.com,RULES_HIT:30054,0,RBL:205.139.110.61:@redhat.com:.lbl8.mailshell.net-62.18.0.100 66.10.201.10,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: nail29_6a2262be7c72d X-Filterd-Recvd-Size: 3265 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Mon, 9 Dec 2019 17:48:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575913728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JCwJwup/hRzgIhZKGZMuQ2SMWqtkRFnNSa3fE8jcXRM=; b=B0OaSziRfZnokdoLZxC2izfMAZiWCyla/F/ZcEigmXTg0/aqctEK8SQq9W5lpDzcGsF+YH ov5KGvpGV1AjSpCbfvOVzySMOuv7mao0tHt2aEkv//xV5TPZgtvsASAN37c7hM9abXq2nr EwV7x45DSSdTI/YVMD3gEyOiHr+puq8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-44-J6AlubJ8OhOXKJ4FOeNQtw-1; Mon, 09 Dec 2019 12:48:44 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B114D1005513; Mon, 9 Dec 2019 17:48:42 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-214.ams2.redhat.com [10.36.116.214]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2062F1001B03; Mon, 9 Dec 2019 17:48:36 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Alexey Dobriyan , Andrew Morton , Bob Picco , Daniel Jordan , Dan Williams , Michal Hocko , Michal Hocko , Naoya Horiguchi , Oscar Salvador , Pavel Tatashin , Stephen Rothwell , Steven Sistare Subject: [PATCH v1 0/3] mm: fix max_pfn not falling on section boundary Date: Mon, 9 Dec 2019 18:48:33 +0100 Message-Id: <20191209174836.11063-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: J6AlubJ8OhOXKJ4FOeNQtw-1 X-Mimecast-Spam-Score: 0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Playing with different memory sizes for a x86-64 guest, I discovered that some memmaps (highest section if max_mem does not fall on the section boundary) are marked as being valid and online, but contain garbage. We have to properly initialize these memmaps. Looking at /proc/kpageflags and friends, I found some more issues, partially related to this. David Hildenbrand (3): mm: fix uninitialized memmaps on a partially populated last section fs/proc/page.c: allow inspection of last section and fix end detection mm: initialize memmap of unavailable memory directly fs/proc/page.c | 15 ++++++++++++--- include/linux/mm.h | 6 ------ mm/page_alloc.c | 43 ++++++++++++++++++++++++++++++++----------- 3 files changed, 44 insertions(+), 20 deletions(-)