From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E422C00454 for ; Wed, 11 Dec 2019 16:32:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4DE862073D for ; Wed, 11 Dec 2019 16:32:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="jWJNbYgo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4DE862073D 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 045236B32DC; Wed, 11 Dec 2019 11:32:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 01CD76B32DD; Wed, 11 Dec 2019 11:32:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E9B3C6B32DE; Wed, 11 Dec 2019 11:32:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0149.hostedemail.com [216.40.44.149]) by kanga.kvack.org (Postfix) with ESMTP id D3F4F6B32DC for ; Wed, 11 Dec 2019 11:32:13 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 87F3A181AEF1A for ; Wed, 11 Dec 2019 16:32:13 +0000 (UTC) X-FDA: 76253402946.14.rifle46_87cafb3738260 X-HE-Tag: rifle46_87cafb3738260 X-Filterd-Recvd-Size: 3500 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Wed, 11 Dec 2019 16:32:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576081932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=LKFqnBlvG1fW2JXIJg+dQL5IlchdA2nn0WN6YjbROus=; b=jWJNbYgotK2tw5kv7AU7hZdjoEz9oBCCR+9UVzPD5d+CnloIyIzlWqN6z+vsG2XqsRlJAv p13dZKIdwGS9T+YnEtTauvX368u7vLld4coElT19v6yCC3zBitx4cNHw+veRg5EuQcjjhQ LhNlwPRAWz46xFEj72I8pcJe/vowuo4= 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-83-pAFiM52NPEutsb_TVfBPDg-1; Wed, 11 Dec 2019 11:32:11 -0500 X-MC-Unique: pAFiM52NPEutsb_TVfBPDg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3A74AB0923; Wed, 11 Dec 2019 16:32:08 +0000 (UTC) Received: from t480s.redhat.com (ovpn-117-148.ams2.redhat.com [10.36.117.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62A37605FF; Wed, 11 Dec 2019 16:32:02 +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 v2 0/3] mm: fix max_pfn not falling on section boundary Date: Wed, 11 Dec 2019 17:31:58 +0100 Message-Id: <20191211163201.17179-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Content-Transfer-Encoding: quoted-printable 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. v1 -> v2: - "mm: fix uninitialized memmaps on a partially populated last section" -- Refine patch description (esp. how to reproduce), add tested-by - "fs/proc/page.c: allow inspection of last section and fix end detection= " -- Make it compile for !CONFIG_SPARSE and add a comment to the new helper function 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 | 30 +++++++++++++++++++++++++++--- include/linux/mm.h | 6 ------ mm/page_alloc.c | 43 ++++++++++++++++++++++++++++++++----------- 3 files changed, 59 insertions(+), 20 deletions(-) --=20 2.23.0