From patchwork Mon Jan 14 12:58:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10762319 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F27B614E5 for ; Mon, 14 Jan 2019 12:59:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3A7928837 for ; Mon, 14 Jan 2019 12:59:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D798128880; Mon, 14 Jan 2019 12:59:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6008828837 for ; Mon, 14 Jan 2019 12:59:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 433848E0004; Mon, 14 Jan 2019 07:59:32 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3BC428E0002; Mon, 14 Jan 2019 07:59:32 -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 25D138E0004; Mon, 14 Jan 2019 07:59:32 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by kanga.kvack.org (Postfix) with ESMTP id ED7898E0002 for ; Mon, 14 Jan 2019 07:59:31 -0500 (EST) Received: by mail-qk1-f199.google.com with SMTP id c71so16265066qke.18 for ; Mon, 14 Jan 2019 04:59:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=5f1RX8PgtIxd6340o2+u9UfUNpwJ2JR8T6eBwDHn5iE=; b=WmaYtzLYLAqhrV2Eea2707z6W7/PWvo2v8NxafnAZF3doOV32UgJue/amP8rfeq/I4 Mf0rWse6vUKxpf0uLkfmZXqmXHGZpGg7RJeEnPhyeHC8PdOMxULGqjUeDg98821zDIe8 bGKZG6Fc1nrfKfpIrYu/6aom9ndnIRsMwEUldR1mOTiE3xVZuRlaeBrChUFvDRKUwYxc F8ShusotnYVzRFGCfqzNY3GFrm7JfKJLxt4hjSy44g/xi8YMOQMR20kJuQcn01waCDWk qGrC9gwQSOJ3YM3tK83AaGqjXfd/bVFMJKnKRhWgNNdqHEsEpdeLUetaIHYLUMMBvimr rRNQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: AJcUukck2D49Jwak7y2uKWx/Uzi/R36NV6LENKNhcetcNZWXnAzlMNg4 XcrRa3Oet90ebE8X76TgVza6JgZW3K2HWTc31WlfrfqcQVJGYtEpd/PEhIlhS/yxKQB6U2KjvA1 qfPjZhzAf/VaxgsNxVIc33BU144OdnAK1tkcIUfmMumGHxuZ2MXEGaOa1vFAIuDvFdA== X-Received: by 2002:a37:7206:: with SMTP id n6mr21999747qkc.64.1547470771743; Mon, 14 Jan 2019 04:59:31 -0800 (PST) X-Google-Smtp-Source: ALg8bN5F3nVOJ6LUuii3lNoOYSQcMqa99cW+pNk72TNnq7BCedAk7dHiyuYIEia7Ze3Vs0elNY8r X-Received: by 2002:a37:7206:: with SMTP id n6mr21999724qkc.64.1547470771228; Mon, 14 Jan 2019 04:59:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547470771; cv=none; d=google.com; s=arc-20160816; b=fd/iUtbJ/+qO/AsaEPMYrP1V029Ra7T0JTdYuhPslJjQ25Nb8kwYCGLXSKnVrMWnwJ cQiY4P9fvf6J0Ym9lPiDwCY+cSRybu4qDCF6Q8/FnIc/GQQ99+PAFqEU0iNRoeaWPH46 CKZyMlpWyJDpQGSD1lUL9rHKmjDSVXBGTVcIexVfzvRQhemmF88rd7e2TMWsVWHlaZ1o Bn/mdhKD4SxsU4+/pfBrnYnMeAeBHj77mRMVDXSibrYhDNGT7xAXj3qijyFhbxV/1oS8 MgHDAISbRWa3NYU3qfffwTGsytxSOO/V6UICVI8oHhr2+ry+/in3G27V7/womnO/MTjE fWXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=5f1RX8PgtIxd6340o2+u9UfUNpwJ2JR8T6eBwDHn5iE=; b=bXi/4kSWCK350kFiWK0MIGfSPO6xWunwDt6UB9at61TYw5efafkw1jfzWJH2PTjgXq lzPAkgNRGiGHRza52KvJQDp7J1fisEoSVwaVv+KoJ6Vj6JYwlHke6ILP1aURxZ1l7k3d ktVfIdpQCYY32AVxbPr7TghhdBWN38J2I2vWmrHeLPJdm1dywhfBZZHlwG93nhlXCRcv a6amyb8+YrOaXNStQTcaVkdjmI8yviS52ieirisTajpZV5uec46c4YTaa/uPCvUA4gcV lNpAxLzU4H1CPmLrqRRoPAROoLx9ZcK3kqvAew3p47JD5WTzxzuGiC4JFq14yA6BQ936 4ywg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id 41si16635064qvy.216.2019.01.14.04.59.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 04:59:31 -0800 (PST) Received-SPF: pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 49D2289AC1; Mon, 14 Jan 2019 12:59:30 +0000 (UTC) Received: from t460s.redhat.com (unknown [10.36.118.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id D587E5D76A; Mon, 14 Jan 2019 12:59:23 +0000 (UTC) From: David Hildenbrand To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-mediatek@lists.infradead.org, David Hildenbrand , David Airlie , Arnd Bergmann , Greg Kroah-Hartman , Andrew Morton , Michal Hocko , Matthew Wilcox Subject: [PATCH v2 1/9] agp: efficeon: no need to set PG_reserved on GATT tables Date: Mon, 14 Jan 2019 13:58:55 +0100 Message-Id: <20190114125903.24845-2-david@redhat.com> In-Reply-To: <20190114125903.24845-1-david@redhat.com> References: <20190114125903.24845-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 14 Jan 2019 12:59:30 +0000 (UTC) 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: X-Virus-Scanned: ClamAV using ClamSMTP The l1 GATT page table is kept in a special on-chip page with 64 entries. We allocate the l2 page table pages via get_zeroed_page() and enter them into the table. These l2 pages are modified accordingly when inserting/removing memory via efficeon_insert_memory and efficeon_remove_memory. Apart from that, these pages are not exposed or ioremap'ed. We can stop setting them reserved (propably copied from generic code). Cc: David Airlie Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Andrew Morton Cc: Michal Hocko Cc: Matthew Wilcox Signed-off-by: David Hildenbrand --- drivers/char/agp/efficeon-agp.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/char/agp/efficeon-agp.c b/drivers/char/agp/efficeon-agp.c index 7f88490b5479..c53f0f9ef5b0 100644 --- a/drivers/char/agp/efficeon-agp.c +++ b/drivers/char/agp/efficeon-agp.c @@ -163,7 +163,6 @@ static int efficeon_free_gatt_table(struct agp_bridge_data *bridge) unsigned long page = efficeon_private.l1_table[index]; if (page) { efficeon_private.l1_table[index] = 0; - ClearPageReserved(virt_to_page((char *)page)); free_page(page); freed++; } @@ -219,7 +218,6 @@ static int efficeon_create_gatt_table(struct agp_bridge_data *bridge) efficeon_free_gatt_table(agp_bridge); return -ENOMEM; } - SetPageReserved(virt_to_page((char *)page)); for (offset = 0; offset < PAGE_SIZE; offset += clflush_chunk) clflush((char *)page+offset); From patchwork Mon Jan 14 12:58:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10762325 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E1B501390 for ; Mon, 14 Jan 2019 12:59:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D27B828837 for ; Mon, 14 Jan 2019 12:59:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6A4528875; Mon, 14 Jan 2019 12:59:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52BFA2883C for ; Mon, 14 Jan 2019 12:59:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 063498E0005; Mon, 14 Jan 2019 07:59:36 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id F2BE58E0002; Mon, 14 Jan 2019 07:59:35 -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 DF42C8E0005; Mon, 14 Jan 2019 07:59:35 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by kanga.kvack.org (Postfix) with ESMTP id B19BE8E0002 for ; Mon, 14 Jan 2019 07:59:35 -0500 (EST) Received: by mail-qt1-f198.google.com with SMTP id n95so24333086qte.16 for ; Mon, 14 Jan 2019 04:59:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=sffXrF4Js5th34lnNFzJQ2qZ7FArnPNvu+uVwZIlZxA=; b=mL8XdfGaTlTuEtZQeZw8gOpg+sJe1pLSYGGf9G009FRbnWFjhVpSzMxH0Z3l7Taa2Q Nn+TXAv9kzmVCnjlHBYasK7DCNtofhYLgykRMC3JINbGRB/NNj0A/+NRfb+8hqn8K1+Y GTM7UYqoTGWY0qIET157rP8TL/CNnhvQlcriwK9vMPNFT9hzZYPn4bDyC2FZrazuRQiC LMbha88o9Hlc0amZ47WpIrFusEZm8JN9Okgg2hQ/8fzseHCGyoCZ62GKs93J085J1Anp z7AGUjyEb0+ED1i6sHdwDF/iB+gKsAHOigC8e9EFZUwduFnlBUlDLyukSrjW6uzaw1o1 Lpeg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: AJcUukcRP8Tau/Hwv0PZ/D3+tJbTifSQHU5S3eI1dw8nSCdGmqhf+xxH QI4iVwUTSkXouQBx9QVVCxhVVF6eCbMmD/2hzCc8F2C46pfitn8XeVH4j/txxkn8yC1gjC3Dwr7 C+v9azV95y8fbLqvos6sN83PctgPEDEsgS9evRQO6jHWDm+74nIVU+m5o8UDgpjMOWw== X-Received: by 2002:a37:a904:: with SMTP id s4mr23005007qke.237.1547470775503; Mon, 14 Jan 2019 04:59:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN43gSbyw03vMF7MeE4uA/prAPJFrIkZoABxJpxXQgQR8YXatwjHWWymK5fG7bqM3n0yvY2y X-Received: by 2002:a37:a904:: with SMTP id s4mr23004990qke.237.1547470775027; Mon, 14 Jan 2019 04:59:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547470775; cv=none; d=google.com; s=arc-20160816; b=uBIMySOC21/mcIT4yxxwfX1D281ITzMWHnqyEEPBz83W72MxMXnKvIA39LZQeJdu77 pY+LL85jXCTqDgf8Pf54vvrQEHbRRRjL3I7T9atrTdce0ctomlUt3mzfm02FGGw2iXm6 7OvMC1MZi7JztHR1JOrLvMhQ80y6AdNphP/eieJVnBO1Dv0jTsbSscmrRW0QjclKYxy/ S9xnqte8VEx+KDTbycflnhid0ovlrghrRbrfZX8PJZusnsGSbJ7LJndI/KkkVFCzWV0L cA+7Gz5ZzO2qgdQ0MyrJSr3oPDxrWn5lysmWHICUKYAYUOnSPghvHd90V+iv7IY/XYN7 tuSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=sffXrF4Js5th34lnNFzJQ2qZ7FArnPNvu+uVwZIlZxA=; b=1EsiGatWUrNe+3K+egPYn62Kc3gGUQVYcfhc99WzK+YeuOIZ/jKLawuBlrzWp+cRIj jFK/ukvMeGPCHcWIwGG+P8UBmTDylzksjwk7e/6vF5B2zsHzmE+AbYIg4VZfs+IOPZZh 2sFaZMuicWiNkBYNoQK3mj1qFsV7DooA56MSlLpIOppdm3oNpLXUe7fKcRHFTfoo+/jT 7Rtl9UHTMWqtumMKEDxRQWr41wxg4SlUih+Y+JhBeLN2XSiJ2CiowmFCoqFKmmBvzIIs bR81c7e9/8s0nsfKnc6I1ENy7ORfqgr3s/FkynlFjp1HaBuc/wK0Pg47LS+yWVMumLxk 2aIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id c83si6011369qke.5.2019.01.14.04.59.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 04:59:35 -0800 (PST) Received-SPF: pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 25DA92D7E2; Mon, 14 Jan 2019 12:59:34 +0000 (UTC) Received: from t460s.redhat.com (unknown [10.36.118.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id A75695D73F; Mon, 14 Jan 2019 12:59:30 +0000 (UTC) From: David Hildenbrand To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-mediatek@lists.infradead.org, David Hildenbrand , Martin Schwidefsky , Heiko Carstens , Matthew Wilcox , Mike Rapoport , Michal Hocko , Vasily Gorbik , Kees Cook , Souptick Joarder , Andrew Morton , Michal Hocko Subject: [PATCH v2 2/9] s390/vdso: don't clear PG_reserved Date: Mon, 14 Jan 2019 13:58:56 +0100 Message-Id: <20190114125903.24845-3-david@redhat.com> In-Reply-To: <20190114125903.24845-1-david@redhat.com> References: <20190114125903.24845-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 14 Jan 2019 12:59:34 +0000 (UTC) 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: X-Virus-Scanned: ClamAV using ClamSMTP The VDSO is part of the kernel image and therefore the struct pages are marked as reserved during boot. As we install a special mapping, the actual struct pages will never be exposed to MM via the page tables. We can therefore leave the pages marked as reserved. Suggested-by: Martin Schwidefsky Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: Matthew Wilcox Cc: Mike Rapoport Cc: Michal Hocko Cc: Vasily Gorbik Cc: Kees Cook Cc: Souptick Joarder Cc: Andrew Morton Cc: Michal Hocko Signed-off-by: David Hildenbrand --- arch/s390/kernel/vdso.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c index 4ff354887db4..e7920a68a12e 100644 --- a/arch/s390/kernel/vdso.c +++ b/arch/s390/kernel/vdso.c @@ -291,7 +291,6 @@ static int __init vdso_init(void) BUG_ON(vdso32_pagelist == NULL); for (i = 0; i < vdso32_pages - 1; i++) { struct page *pg = virt_to_page(vdso32_kbase + i*PAGE_SIZE); - ClearPageReserved(pg); get_page(pg); vdso32_pagelist[i] = pg; } @@ -309,7 +308,6 @@ static int __init vdso_init(void) BUG_ON(vdso64_pagelist == NULL); for (i = 0; i < vdso64_pages - 1; i++) { struct page *pg = virt_to_page(vdso64_kbase + i*PAGE_SIZE); - ClearPageReserved(pg); get_page(pg); vdso64_pagelist[i] = pg; } From patchwork Mon Jan 14 12:58:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10762329 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3A14A14E5 for ; Mon, 14 Jan 2019 12:59:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CA4128837 for ; Mon, 14 Jan 2019 12:59:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 207A728880; Mon, 14 Jan 2019 12:59:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CB6628837 for ; Mon, 14 Jan 2019 12:59:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9B1848E0006; Mon, 14 Jan 2019 07:59:39 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 937968E0002; Mon, 14 Jan 2019 07:59:39 -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 7D9DB8E0006; Mon, 14 Jan 2019 07:59:39 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by kanga.kvack.org (Postfix) with ESMTP id 509AF8E0002 for ; Mon, 14 Jan 2019 07:59:39 -0500 (EST) Received: by mail-qk1-f197.google.com with SMTP id s14so16473721qkl.16 for ; Mon, 14 Jan 2019 04:59:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=SiXa6ye3Ol1dnVnnyLYOBt3W1Eh9qMmGNo7U5KksCQ8=; b=KHbefJgUFBkhYPPOVgwyFVG5Hu8VN/N2pyvz74d+mXY1URUslyPbgk4FTX+AXyVINV c0eZ1PaF6/Oya4gkFGLMTkB/pRRxz7+6uBG01G8dl8tjkdrfG0yoZ40bmqWK5OS3N/Jk qYd2htNhExjeo3H/1D2/FMK4aL64j3xLJUZNg8Rl3gS4wyBFeXwglOi/I/WWWkF2WwbP XRdXC7IDwGlh2BJ59LzVBbCJ3OxYVf3Q3qnJSPOqm9Yzj1/gUqq1The7l9WBWLvlRFCG x0EbNIlXXA2TEu3G3mWIZZKi/TM7YPOKoePUoGnIMQMFHlwVKz1LlIaJol8Yybk1csbj 5SoQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: AJcUukf9CP7pSm3IulpuqzjCIMFLa6TKD0JZgSTARdvmdqd1l6jjsqID cLUpxIQuCBlK5KVAY7dWFNXqrAOPIk9pT2iM3vZzKlFoR1ZODSDyfvn2I4DmNDAXdR9724uBHkz k46H3nwSAPa2zRDn/azkGKD2nueX8q7wjlc/yw44HJ74K+80ZNrO/RDEhIhq9jW+uCg== X-Received: by 2002:a37:6442:: with SMTP id y63mr22237839qkb.119.1547470779087; Mon, 14 Jan 2019 04:59:39 -0800 (PST) X-Google-Smtp-Source: ALg8bN7i9SLQsVxSVo/cSryMUPaePyBHotBYyeaqFhB73b0ET4uJnNCUUbl8FbwvhK90qgSlOvca X-Received: by 2002:a37:6442:: with SMTP id y63mr22237812qkb.119.1547470778515; Mon, 14 Jan 2019 04:59:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547470778; cv=none; d=google.com; s=arc-20160816; b=Yz2i8rOW3SQDdYTNkwfPNiKyQCzVrBvTelp5MZFDjkmXh6J/MftaZYuo178fqaZLkQ CLlUzhzEs2oqb3ZuFUbBrX5wQIBMYUCHFtWKYEgiXaUBUOd84GEWcIQcL/MEifgHPBQH dTPj68kcK2NdkdQC31+6Egbe+7QK473WiY1BaNnBAvMqIY7bG6JuSm0IqyrCqx4uaOL7 mL/fTC18rH97VYMh9rx1WEdKzi4V1XaPgSQyo5Rg2A+aA5W7EpjFpkS4fH5s1ixgNkTt 5wXd5D1UjzWUpoUCD8DZgkJLlOjtXd473+A/KsrJ718+KwYqsSiltWOPYtbBTRaB1OBo M/lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=SiXa6ye3Ol1dnVnnyLYOBt3W1Eh9qMmGNo7U5KksCQ8=; b=JzgEVBa0qsX6Q1Fjb0TtFgCBWBd5fck/QLilLY4AUZ8zfjy4FRxeooknb9nXdgmEBi 0/10Ful50ss7nJKGZouXsHQot7SS9WS1B6BarAaOWQEiec+G/uGYVTUX/15sCB8SJbCG GMW2cL29t+XGDI5+rdO9Y90B6wresTv1x/K3saosTKlySNa1VRPo2E2pST3avDlxn8S8 V0sJeNy69hTmi0S/pBhWkTzCN7puwSE+wug6ikATiK6UaQfSqYDxEFeCSDYr6hZaK8tv gFmBRggF8x7hvaV5VDw/Nx278tnHz6lO1bawq29WYabYjjhKO0E0iTF/ULZNymAEHx15 +Zug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id 88si5086130qte.245.2019.01.14.04.59.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 04:59:38 -0800 (PST) Received-SPF: pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A21D681127; Mon, 14 Jan 2019 12:59:37 +0000 (UTC) Received: from t460s.redhat.com (unknown [10.36.118.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id 747895D76A; Mon, 14 Jan 2019 12:59:34 +0000 (UTC) From: David Hildenbrand To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-mediatek@lists.infradead.org, David Hildenbrand , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Christophe Leroy , Kees Cook , Andrew Morton , Michal Hocko , Matthew Wilcox Subject: [PATCH v2 3/9] powerpc/vdso: don't clear PG_reserved Date: Mon, 14 Jan 2019 13:58:57 +0100 Message-Id: <20190114125903.24845-4-david@redhat.com> In-Reply-To: <20190114125903.24845-1-david@redhat.com> References: <20190114125903.24845-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 14 Jan 2019 12:59:37 +0000 (UTC) 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: X-Virus-Scanned: ClamAV using ClamSMTP The VDSO is part of the kernel image and therefore the struct pages are marked as reserved during boot. As we install a special mapping, the actual struct pages will never be exposed to MM via the page tables. We can therefore leave the pages marked as reserved. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Christophe Leroy Cc: Kees Cook Cc: Andrew Morton Cc: Michal Hocko Cc: Matthew Wilcox Acked-by: Michael Ellerman (powerpc) Signed-off-by: David Hildenbrand --- arch/powerpc/kernel/vdso.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c index 7725a9714736..a31b6234fcd7 100644 --- a/arch/powerpc/kernel/vdso.c +++ b/arch/powerpc/kernel/vdso.c @@ -798,7 +798,6 @@ static int __init vdso_init(void) BUG_ON(vdso32_pagelist == NULL); for (i = 0; i < vdso32_pages; i++) { struct page *pg = virt_to_page(vdso32_kbase + i*PAGE_SIZE); - ClearPageReserved(pg); get_page(pg); vdso32_pagelist[i] = pg; } @@ -812,7 +811,6 @@ static int __init vdso_init(void) BUG_ON(vdso64_pagelist == NULL); for (i = 0; i < vdso64_pages; i++) { struct page *pg = virt_to_page(vdso64_kbase + i*PAGE_SIZE); - ClearPageReserved(pg); get_page(pg); vdso64_pagelist[i] = pg; } From patchwork Mon Jan 14 12:58:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10762331 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9C8221390 for ; Mon, 14 Jan 2019 12:59:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E15128837 for ; Mon, 14 Jan 2019 12:59:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 81F572887B; Mon, 14 Jan 2019 12:59:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3D9D28837 for ; Mon, 14 Jan 2019 12:59:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B5DD18E0007; Mon, 14 Jan 2019 07:59:42 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id AE6538E0002; Mon, 14 Jan 2019 07:59:42 -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 98F6F8E0007; Mon, 14 Jan 2019 07:59:42 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by kanga.kvack.org (Postfix) with ESMTP id 6BEB98E0002 for ; Mon, 14 Jan 2019 07:59:42 -0500 (EST) Received: by mail-qk1-f199.google.com with SMTP id z11so16610354qkf.19 for ; Mon, 14 Jan 2019 04:59:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=a5CUHJSLmkC9bV5fGD27h7T4HVmGCIpcry+yGukPypM=; b=WYTkWr+83LxZUjWQsaZrwv69yIkCWTEnD+gC0h2MrSwjN1mg+4N2m1KhxwrvQui/NH vzL1LtEP3LpSOXNwBnbBJS3XQGSZ4ZUYSvta7cwb+Od61F3njOooSVuiTTD1wX3Czbz3 /2MMYVnGIqwOzY6x7tDxyYHgUqlj86fiPV1GbqTQRYzTVM6TLHHUvSqpsO9cFIgLyjgb nio8rEErZoo1iYZl8NSA4peK7AO9ndajL9qyQL3DaKovWZ+zsNDuBOFN6q2d5DDY6vEf iXkSlCGDtm2ReQugzKlmjVE56l0/h0Zkgfm+z5AQzprIPsiouNw0EY+OjyaCFPnL1TC3 HYHA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: AJcUukfDrcZg1vG2ipqicgukhStUlThI4xQPr8cqAT7ccX6KMr22pNxt UMYAh/Lmki1aXf2+T0t8TNYQj87zpLUG18YQRIpm2ZUh3pbqKiFSveFSx4VIm308aY5bUGHL533 tRhOVGRHsfn6dDqyP5RWauIdUK2o85F5/oPimXz5esZVRaeCnj0TTM0mrQPh228VFxg== X-Received: by 2002:a37:cf9b:: with SMTP id v27mr21796735qkl.160.1547470782214; Mon, 14 Jan 2019 04:59:42 -0800 (PST) X-Google-Smtp-Source: ALg8bN5jvZxkOA9cNDBW3Cfvvcbrkia6Mc5bNxI24AmokvbOerCOuKjir2kX1d7jOCQ2Ion6Sfbh X-Received: by 2002:a37:cf9b:: with SMTP id v27mr21796704qkl.160.1547470781648; Mon, 14 Jan 2019 04:59:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547470781; cv=none; d=google.com; s=arc-20160816; b=z+AKxRWO5bsQ/bs9S32NbOLiKlQlnQvfNwmoF4JlTojrvpQ0nOPLBnrlOCGfkwB/nY fp5J38fwOF1HxvdFaCzqJrXFtrUe9XA2yZrtdbqxSkqkkcyLenzZxNtvh+kbPWka3Eml JjXSmozUe8uGYCLzxKDkkMygQPQdmkXNVDtC5P7t3nzjamhhkR4wC/xYCETRF8b4hfYN V1j2+DxxK6eIlTfZdQ5KtKnNw43Z3WyE9Xlm7+I73KXnPIbYa48jZxyU7jWJ1sb13pvF Fivkqz1b4DHQNupBB+JUp/qJzn18TkoXtgnJXoHbMooBHERIkS5slNapMFDEais+XMXh J4pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=a5CUHJSLmkC9bV5fGD27h7T4HVmGCIpcry+yGukPypM=; b=XBCw+DCDMecRn5oYx7eNuLW7YWdGWclTEAbcP5KcdBhrjhWTQouDn2lSaZ+7/39NH3 NOQatf0S3vMlBK9Ai2baU0xGJenTVpEqko1+dBYs8IB9+ucc9VMH8fkKvCIgZQewbRgs t78Zo0rR6Y7SVZfCQzB4mmEvpxxxmA5PfW8jP6XqPsB1RrZHkFRaogVcVmXzfgdKMYGi Lpv05p9XYFeIJqvwbp8MZ6tmwxQABpUZ6kRAvC3twzRBB0/UVzFCemyQmbpKT+t6jqoW VqXVJsoCBDPScP/JAMdrW+qgu6sRfmASCKXzzzFICXXGDkKfwCjJlWsE0ytrahW2UEow VZLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id 37si2453829qvb.136.2019.01.14.04.59.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 04:59:41 -0800 (PST) Received-SPF: pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C16B589AC9; Mon, 14 Jan 2019 12:59:40 +0000 (UTC) Received: from t460s.redhat.com (unknown [10.36.118.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED8FC5D756; Mon, 14 Jan 2019 12:59:37 +0000 (UTC) From: David Hildenbrand To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-mediatek@lists.infradead.org, David Hildenbrand , Palmer Dabbelt , Albert Ou , Tobias Klauser , Andrew Morton , Michal Hocko , Matthew Wilcox Subject: [PATCH v2 4/9] riscv/vdso: don't clear PG_reserved Date: Mon, 14 Jan 2019 13:58:58 +0100 Message-Id: <20190114125903.24845-5-david@redhat.com> In-Reply-To: <20190114125903.24845-1-david@redhat.com> References: <20190114125903.24845-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 14 Jan 2019 12:59:40 +0000 (UTC) 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: X-Virus-Scanned: ClamAV using ClamSMTP The VDSO is part of the kernel image and therefore the struct pages are marked as reserved during boot. As we install a special mapping, the actual struct pages will never be exposed to MM via the page tables. We can therefore leave the pages marked as reserved. Cc: Palmer Dabbelt Cc: Albert Ou Cc: Tobias Klauser Cc: Andrew Morton Cc: Michal Hocko Cc: Matthew Wilcox Acked-by: Palmer Dabbelt Signed-off-by: David Hildenbrand Reviewed-by: Christoph Hellwig --- arch/riscv/kernel/vdso.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/riscv/kernel/vdso.c b/arch/riscv/kernel/vdso.c index 582cb153eb24..0cd044122234 100644 --- a/arch/riscv/kernel/vdso.c +++ b/arch/riscv/kernel/vdso.c @@ -54,7 +54,6 @@ static int __init vdso_init(void) struct page *pg; pg = virt_to_page(vdso_start + (i << PAGE_SHIFT)); - ClearPageReserved(pg); vdso_pagelist[i] = pg; } vdso_pagelist[i] = virt_to_page(vdso_data); From patchwork Mon Jan 14 12:58:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10762333 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E6D891390 for ; Mon, 14 Jan 2019 12:59:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7D9428837 for ; Mon, 14 Jan 2019 12:59:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC0582887B; Mon, 14 Jan 2019 12:59:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 625E828837 for ; Mon, 14 Jan 2019 12:59:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5BB608E0008; Mon, 14 Jan 2019 07:59:45 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 4F51B8E0002; Mon, 14 Jan 2019 07:59:45 -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 3BDA28E0008; Mon, 14 Jan 2019 07:59:45 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by kanga.kvack.org (Postfix) with ESMTP id 103EB8E0002 for ; Mon, 14 Jan 2019 07:59:45 -0500 (EST) Received: by mail-qk1-f199.google.com with SMTP id z126so16488386qka.10 for ; Mon, 14 Jan 2019 04:59:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=uu9Bv6QSbxHHwnbPMecYXxLOyjHYWGYtAnb0Wv3n30o=; b=iVel/Dn1kFqKPyld5fW33UOeNCwDOOWW3aPlb0blgCQ4gl06ZcQZLo8hwDxnVfU9Sm ZSWkGn/T+j71JM6rNqWbW6LJHeAEUPTZXZUI3gxY2HDDvnxz+PrIevg46/xp5eMQzK3g 9F1X3gNB/Pk+INy+kK1lmD3vKMM56ayXJRzqzVIVy2uKid87p3RVDYlwNM6WwdAPxnxt F4yHntF0qvJrup2j8rxdhh1J0dtx/esNVatsj08b8bXiPc1M3+q3KDryeO8XAae2syu/ fvznqj5TRJ7Jp71NoP84zJxZuWA/aXLWoR1+h3mCJtxQ8hVeL4zVWDCgIQNf9bCko9e+ HtHw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: AJcUuke/B2cp0So4zGfWYm/JAcTUxvs4HjIkKDuxD7PtyTU8JX41+Rwm eeHcAveJlK2A4lZxBtBPeJ81Sgp3wcJ9gjujOotPIzGrDR/TTVdYlSRZaiCY+AZCRB7/5DL3GXT dSRiM2XXb9ZQFWROcrDJz42wyz8YArI1VyXPNMlErXGFNJPfXzauSymHecChlCoQCIA== X-Received: by 2002:ac8:26b9:: with SMTP id 54mr23920427qto.301.1547470784863; Mon, 14 Jan 2019 04:59:44 -0800 (PST) X-Google-Smtp-Source: ALg8bN4/DGwv/2u28qvTjnNUyvcFQUrWekYOKgTCsRo2qCbP3TuxcVdPIoCG+9/99lSYDHqFW02m X-Received: by 2002:ac8:26b9:: with SMTP id 54mr23920404qto.301.1547470784393; Mon, 14 Jan 2019 04:59:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547470784; cv=none; d=google.com; s=arc-20160816; b=GsPYlvGC3jqT4Th+HkB/Lsb64H5E4rrabxL+T+HoWJK7DItzA9rrETnNWqjAAOFxGq IS8pIV88tCo4MdkoGg1YssWiML91qIgrg4pXJuYCpHiVsV8ZU3F+/Xa/x4qIF05/abHo LO1Lr1Fp2ZB47lrl92XJFd1h5H2jASSKn+NYWA78kdM9iuSyw4E0h6kG4czTxAP7Wn77 OpCHGO+zwyEL43QTBkGl0epvX2iVO4aGtkB5gQ2Tp9E64LaBTS2PPIO5CdgLiXI6roBI 42HtDCW757QJ8oGSSgacBAuJ1LgzhUpmwIx1y8ppaqxF61EhLXb30DYBliWa3EaTPSvY MJGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=uu9Bv6QSbxHHwnbPMecYXxLOyjHYWGYtAnb0Wv3n30o=; b=OqA+9yIx9jjefrQESykPtSW86bfm+3LQCEAyP8KsrbkKiiKKU7TX/uNgbQz/kQXN5C anCkwBPEg0LcEPM5rtWnbCajeQ93j1eSdQhC8KLCB+g1BaPglIwUF3AvsnYbooe/VB9O QzuX0Tiip0hNWNxRDkN5aQzjxJivtN38kOg7+KnJPP3UcNoV6dSxcqu688cLMLrtcNAw 4yXKExJwmXXqL2Xio6eH7TMEfdH2M58mmBSGGwHZ9RA/FJCSUnlWFJ438W1ezGe2ptpc OJWaqTxzcXB87Mx7ZbXci3bnu39UT4xSGiipXN/giRK1B8fL6e8noknsve727u1nx9at osRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id y58si5770645qta.312.2019.01.14.04.59.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 04:59:44 -0800 (PST) Received-SPF: pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9046480F7D; Mon, 14 Jan 2019 12:59:43 +0000 (UTC) Received: from t460s.redhat.com (unknown [10.36.118.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id 19CA05D73F; Mon, 14 Jan 2019 12:59:40 +0000 (UTC) From: David Hildenbrand To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-mediatek@lists.infradead.org, David Hildenbrand , Geert Uytterhoeven , Andrew Morton , Michal Hocko , Matthew Wilcox Subject: [PATCH v2 5/9] m68k/mm: use __ClearPageReserved() Date: Mon, 14 Jan 2019 13:58:59 +0100 Message-Id: <20190114125903.24845-6-david@redhat.com> In-Reply-To: <20190114125903.24845-1-david@redhat.com> References: <20190114125903.24845-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 14 Jan 2019 12:59:43 +0000 (UTC) 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: X-Virus-Scanned: ClamAV using ClamSMTP The PG_reserved flag is cleared from memory that is part of the kernel image (and therefore marked as PG_reserved). Avoid using PG_reserved directly. Cc: Geert Uytterhoeven Cc: Andrew Morton Cc: Michal Hocko Cc: Matthew Wilcox Signed-off-by: David Hildenbrand Acked-by: Geert Uytterhoeven --- arch/m68k/mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/mm/memory.c b/arch/m68k/mm/memory.c index b86a2e21693b..227c04fe60d2 100644 --- a/arch/m68k/mm/memory.c +++ b/arch/m68k/mm/memory.c @@ -51,7 +51,7 @@ void __init init_pointer_table(unsigned long ptable) pr_debug("init_pointer_table: %lx, %x\n", ptable, PD_MARKBITS(dp)); /* unreserve the page so it's possible to free that page */ - PD_PAGE(dp)->flags &= ~(1 << PG_reserved); + __ClearPageReserved(PD_PAGE(dp)); init_page_count(PD_PAGE(dp)); return; From patchwork Mon Jan 14 12:59:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10762337 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0AA721390 for ; Mon, 14 Jan 2019 12:59:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F08DE2883C for ; Mon, 14 Jan 2019 12:59:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1C7C28885; Mon, 14 Jan 2019 12:59:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 678D92883C for ; Mon, 14 Jan 2019 12:59:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BFC7C8E0009; Mon, 14 Jan 2019 07:59:52 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B81118E0002; Mon, 14 Jan 2019 07:59:52 -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 A237C8E0009; Mon, 14 Jan 2019 07:59:52 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by kanga.kvack.org (Postfix) with ESMTP id 7534A8E0002 for ; Mon, 14 Jan 2019 07:59:52 -0500 (EST) Received: by mail-qk1-f197.google.com with SMTP id s70so16644559qks.4 for ; Mon, 14 Jan 2019 04:59:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=HxJPCFZB3tH21nUHqDn7erS1Lk9q4hsCe3xmXSx/ds4=; b=jyqI7xuNiMHAtNWccuS//B9xwaZWNlURcEPMNXMgIixlCaqmiWjHttY1bFoH7oPobO dL+es8JNBr9YsNCb27+IxS4Efl/GaJUALabiXb1gXI6ujqGccrAU6oRa6lJlb04iH5A3 AgOLQU0MFwCMUHVRjc/9f5AoaI4HiPh2h/xU+SkcHSu87DrGK8v06SIx3hmrnxxaWzzb kncUOODzPwM5raJTG5b+l96XDh4JqIYwsThxIDxLQ4SLZbTvzPL+qm9686VY4hDzFczk mlATuejntdg0bpNoOnjvKnTgmAPeCWZZOmbduNsnd+PpJVUdwl4YRjvtNUOOqrkvuJiR /slA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: AJcUukcmZmngxFSWRcO1cjAbwlYQTEl0Y6NnfLO7ZEa/HjsC4DV3u5Xe 1qWOm431PFrr9YeMuQyaNfUjqri6aeow5qHG/J2uUM7BQevQO1a/XFP8SsJvlCXZY9nGfxS3SOM 9sCuEGmKf7OiOl0B/ZVpG3JcIeHPZR9WhgBVN8clzkz8UWJkOYHRithnm3En90goCfg== X-Received: by 2002:aed:36a9:: with SMTP id f38mr24258760qtb.367.1547470792257; Mon, 14 Jan 2019 04:59:52 -0800 (PST) X-Google-Smtp-Source: ALg8bN6jKQ/J7DFMrAOYPca0OnMcDc6SwRV5j0F3GVOsn9zjvlg8gAj/2pseBB/d0u1bQQEjGpet X-Received: by 2002:aed:36a9:: with SMTP id f38mr24258736qtb.367.1547470791774; Mon, 14 Jan 2019 04:59:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547470791; cv=none; d=google.com; s=arc-20160816; b=p5iNzcPh5aAdIZ4g9WP4Hjkl3DeybxkYM7Eu8AXW96KzOwWNscKoLLBziRYMx6FaxC u6AGG4bvXUC8bZGasMR/9lOCDV4uhAGW97roHcA74ff98QsdCXAq6A46OAPgQ7sArYzm ItJjHcl/I1oRx6AVtlHfqtCnmJzMgDOKyIzwaqsjcHCWPaBh5yJgmY744FlpzTZZ9mmj c7in+jXFDVyMWXerT3VF6ybN79Fep8gUtk3HkodEj+QHaT8c3LW96xOzGU7MENNmpJRE UNbaNP+dPje4ej9dOtiB7HA2vs3bv9nuPvPm5lUDzF0cuMqK5ctaWOUJSNV6muClthrG uWEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=HxJPCFZB3tH21nUHqDn7erS1Lk9q4hsCe3xmXSx/ds4=; b=LmQw2k5Og5my4Zp4gOwq+Ed3FU1Us9r0bNCBlvVCFV6hqenfTYsFfkpFLsZz2vnTaj I/KzhP+g5G6OSAM+MBkUhBaFyx/TH8cx9SdMMXR67nSK7OETYSFD9qjmukIxtK8H3PXC m9uEKkrF0I2x6AT7KXoH6E9NkrXuNrkfQ/jcCi8Sfi8g4VVJNik4YHOm4RPhkaYIucRo YOE/APUErkw5kVvpVKRYChgnm6AV5Cvc5mLjklcBZQ6vKywWCSDf2kjNYeio1fIn5P6P fYxeVe+4OmjSFTSwCjyUSaEB/lxG7ZwarqXTqxcDLTbl8jmCtspNvFZhi3vNIS0mccPc LAaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id c54si3904575qtb.13.2019.01.14.04.59.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 04:59:51 -0800 (PST) Received-SPF: pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BF2BE88E64; Mon, 14 Jan 2019 12:59:50 +0000 (UTC) Received: from t460s.redhat.com (unknown [10.36.118.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD9D75D756; Mon, 14 Jan 2019 12:59:43 +0000 (UTC) From: David Hildenbrand To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-mediatek@lists.infradead.org, David Hildenbrand , Catalin Marinas , Will Deacon , Bhupesh Sharma , James Morse , Marc Zyngier , Dave Kleikamp , Mark Rutland , Andrew Morton , Michal Hocko , Matthew Wilcox Subject: [PATCH v2 6/9] arm64: kexec: no need to ClearPageReserved() Date: Mon, 14 Jan 2019 13:59:00 +0100 Message-Id: <20190114125903.24845-7-david@redhat.com> In-Reply-To: <20190114125903.24845-1-david@redhat.com> References: <20190114125903.24845-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 14 Jan 2019 12:59:51 +0000 (UTC) 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: X-Virus-Scanned: ClamAV using ClamSMTP This will be done by free_reserved_page(). Cc: Catalin Marinas Cc: Will Deacon Cc: Bhupesh Sharma Cc: James Morse Cc: Marc Zyngier Cc: Dave Kleikamp Cc: Mark Rutland Cc: Andrew Morton Cc: Michal Hocko Cc: Matthew Wilcox Acked-by: James Morse Signed-off-by: David Hildenbrand Reviewed-by: Bhupesh Sharma Acked-by: Catalin Marinas --- arch/arm64/kernel/machine_kexec.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index aa9c94113700..6f0587b5e941 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -361,7 +361,6 @@ void crash_free_reserved_phys_range(unsigned long begin, unsigned long end) for (addr = begin; addr < end; addr += PAGE_SIZE) { page = phys_to_page(addr); - ClearPageReserved(page); free_reserved_page(page); } } From patchwork Mon Jan 14 12:59:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10762343 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 171AE6C2 for ; Mon, 14 Jan 2019 13:00:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 094042887B for ; Mon, 14 Jan 2019 13:00:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F170D28885; Mon, 14 Jan 2019 13:00:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89BC92887B for ; Mon, 14 Jan 2019 13:00:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3E64F8E000A; Mon, 14 Jan 2019 08:00:06 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 36A6B8E0002; Mon, 14 Jan 2019 08:00:06 -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 233FE8E000A; Mon, 14 Jan 2019 08:00:06 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by kanga.kvack.org (Postfix) with ESMTP id E5FFC8E0002 for ; Mon, 14 Jan 2019 08:00:05 -0500 (EST) Received: by mail-qt1-f199.google.com with SMTP id n50so24564373qtb.9 for ; Mon, 14 Jan 2019 05:00:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=TfVqJzn58+aN73fiEb8YQ9OGV+gvW4QvjxrwkR+KcuU=; b=dsNm5QQX5esHjCw+WIXqBZwkdsdGUb6f1RD5fE45n3iEYuuiCPjLa1XvBz5dQMiAMT +pSJ9YAJGAhu5WZ06vTikYHx/dmUrhhlFul3v3RDqQUyg6GcudJcYBdXFozNVTmj2ie4 KaRPmsgi3RUJuthbqDVlTriWAT6O5ccr3Eh71UVuGBCoxkyZZ9w7E/Stb2DvajqqVxRv QavKqflef4Rvr/7dP54inPpKNEITuJOCGfz30qR049v0no/kVD3Mr5dC47vjyhOa0YgH lXeI945+6yCEAMs/ePD6Zuruvg2sgElGt8YaRq9q97obeRTot2qGU/5CGzWzz6MIukUl 6kuA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: AJcUukfqKAoBCrpsUBCFGtj2RwQA2njNxd0SJnO2issA80Q/Up/sR02w ifQHFsgIyXzcq47DPjZiv3DNBBBNPgjb00DQpaZ5nrhZNzvmyQ0TtdVYGErR0CMTIEDeHTGNd4g ysu//sbF+oUUPLOqr9EewnHMEvuTKarGp2LxuYCiQwvjudOnAEr7Tia973wnufsbQLw== X-Received: by 2002:a0c:d124:: with SMTP id a33mr23573214qvh.19.1547470805681; Mon, 14 Jan 2019 05:00:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN6fBXAC4TSaQNANGWOU6G53g3l13Y9TQy2G3iatT65KXwtca/NDRZSGgwhGQvbPa7YOQns/ X-Received: by 2002:a0c:d124:: with SMTP id a33mr23573171qvh.19.1547470805150; Mon, 14 Jan 2019 05:00:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547470805; cv=none; d=google.com; s=arc-20160816; b=rwALsqKcJMQKl2e4nFCGrvkKwGs47znlMPWABAcxiPsjB/1IP8UL90dqcw5XLo/u64 BQUU3QJUAPq24CT2SwiEold1C6HJUx6CYOPEdzkNsVSrKS8i0QuJrgDvOxJmaARVu4Ik pd52JJrO8g74SVij/D7vE2ZL324P3R7cdV9zg7fnfeiSnS59NKo4KJGuBM/N9WTWySdU etEoAKsgfqrrIc0F3HTVk4G2DMmaOfWjOEeFJVjxU2BGkq91puKm+oo1M3BE1iG800/y TWd3e9nqqmpzQ5USyKeIDRUH3XM6NN4tAaHAA5tyRbyFM3CcP/E6H265fz3EbyxgpKsN J9LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=TfVqJzn58+aN73fiEb8YQ9OGV+gvW4QvjxrwkR+KcuU=; b=xxitxPFpGJ7w/GqaWnQ563f9D08Sy5uO18MrdxnOn6/c+ggIPVNxsh87mTwLCr22IX Io0/tZqn5DOFw4Qyx8sI9YuhaR6jd19w6IOIJrwZ9+cWUmxaiDYIWUosoASZ1QpXAFHa O7iRYgguK81WEqWye/XKSRWINUZgIv+uS51IcTgGCQiDQVrtrrvTM/0xjFL8LbXDWRZr CQR2x6Bq4I3LHYwaYKR5Xrn19jiGFHAF3baT0ttRMVlMa4sczR0Fds4k4lbcHqp9DEPq 2xKMqbDrwEwMA3x5dRvMCozm65/pvn9/vvkgaeYzI88X0cQkdyet93SoW1S9hAcA1vN+ eYbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id v64si1458846qkh.60.2019.01.14.05.00.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:00:05 -0800 (PST) Received-SPF: pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EBC1BC057F3B; Mon, 14 Jan 2019 13:00:02 +0000 (UTC) Received: from t460s.redhat.com (unknown [10.36.118.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0BDEA5D75F; Mon, 14 Jan 2019 12:59:50 +0000 (UTC) From: David Hildenbrand To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-mediatek@lists.infradead.org, David Hildenbrand , Catalin Marinas , Will Deacon , James Morse , Bhupesh Sharma , Mark Rutland , Dave Kleikamp , Andrew Morton , Mike Rapoport , Michal Hocko , Florian Fainelli , Stefan Agner , Laura Abbott , Greg Hackmann , Johannes Weiner , Kristina Martsenko , CHANDAN VN , AKASHI Takahiro , Logan Gunthorpe Subject: [PATCH v2 7/9] arm64: kdump: No need to mark crashkernel pages manually PG_reserved Date: Mon, 14 Jan 2019 13:59:01 +0100 Message-Id: <20190114125903.24845-8-david@redhat.com> In-Reply-To: <20190114125903.24845-1-david@redhat.com> References: <20190114125903.24845-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 14 Jan 2019 13:00:04 +0000 (UTC) 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: X-Virus-Scanned: ClamAV using ClamSMTP The crashkernel is reserved via memblock_reserve(). memblock_free_all() will call free_low_memory_core_early(), which will go over all reserved memblocks, marking the pages as PG_reserved. So manually marking pages as PG_reserved is not necessary, they are already in the desired state (otherwise they would have been handed over to the buddy as free pages and bad things would happen). Cc: Catalin Marinas Cc: Will Deacon Cc: James Morse Cc: Bhupesh Sharma Cc: David Hildenbrand Cc: Mark Rutland Cc: Dave Kleikamp Cc: Andrew Morton Cc: Mike Rapoport Cc: Michal Hocko Cc: Florian Fainelli Cc: Stefan Agner Cc: Laura Abbott Cc: Greg Hackmann Cc: Johannes Weiner Cc: Kristina Martsenko Cc: CHANDAN VN Cc: AKASHI Takahiro Cc: Logan Gunthorpe Reviewed-by: Matthias Brugger Signed-off-by: David Hildenbrand Reviewed-by: Bhupesh Sharma Acked-by: Catalin Marinas --- arch/arm64/kernel/machine_kexec.c | 2 +- arch/arm64/mm/init.c | 27 --------------------------- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index 6f0587b5e941..66b5d697d943 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -321,7 +321,7 @@ void crash_post_resume(void) * but does not hold any data of loaded kernel image. * * Note that all the pages in crash dump kernel memory have been initially - * marked as Reserved in kexec_reserve_crashkres_pages(). + * marked as Reserved as memory was allocated via memblock_reserve(). * * In hibernation, the pages which are Reserved and yet "nosave" are excluded * from the hibernation iamge. crash_is_nosave() does thich check for crash diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 7205a9085b4d..c38976b70069 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -118,35 +118,10 @@ static void __init reserve_crashkernel(void) crashk_res.start = crash_base; crashk_res.end = crash_base + crash_size - 1; } - -static void __init kexec_reserve_crashkres_pages(void) -{ -#ifdef CONFIG_HIBERNATION - phys_addr_t addr; - struct page *page; - - if (!crashk_res.end) - return; - - /* - * To reduce the size of hibernation image, all the pages are - * marked as Reserved initially. - */ - for (addr = crashk_res.start; addr < (crashk_res.end + 1); - addr += PAGE_SIZE) { - page = phys_to_page(addr); - SetPageReserved(page); - } -#endif -} #else static void __init reserve_crashkernel(void) { } - -static void __init kexec_reserve_crashkres_pages(void) -{ -} #endif /* CONFIG_KEXEC_CORE */ #ifdef CONFIG_CRASH_DUMP @@ -586,8 +561,6 @@ void __init mem_init(void) /* this will put all unused low memory onto the freelists */ memblock_free_all(); - kexec_reserve_crashkres_pages(); - mem_init_print_info(NULL); /* From patchwork Mon Jan 14 12:59:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10762353 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 16C7714E5 for ; Mon, 14 Jan 2019 13:00:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0892C28837 for ; Mon, 14 Jan 2019 13:00:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F08B028BA0; Mon, 14 Jan 2019 13:00:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57D9628837 for ; Mon, 14 Jan 2019 13:00:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 67CAE8E0003; Mon, 14 Jan 2019 08:00:48 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 603258E0002; Mon, 14 Jan 2019 08:00:48 -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 4A4E08E0003; Mon, 14 Jan 2019 08:00:48 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by kanga.kvack.org (Postfix) with ESMTP id 19B048E0002 for ; Mon, 14 Jan 2019 08:00:48 -0500 (EST) Received: by mail-qk1-f197.google.com with SMTP id c71so16268723qke.18 for ; Mon, 14 Jan 2019 05:00:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=nGwjQtOjk4/GamjVyCiINCn7txjzWwZ4MNkuRb8d1J8=; b=OAUrxH2cda2O3afwN7sawy97VHwTxitH68rlfH/XAbomwYp8Is/mNGPOUttwHB9MJg A4NaItNHpk1FRfA4pOYw8WwRlDb4PZ4ylUNFkZPjkC3JmQ3mARVb0+2SxVf5ZfdJMJh0 B/gjhp498922Pmm0uYJPbWqMBTUUI05tNWbJoYEoNUq71ZZHl/qmxCMvTxE3zR+6p9qa IR8UuWaVJKTC1ZTXiTafM14N+UgRoA5zNOEarF7kuUJPr4+EtUNhWvYVwwY4U/JMIUme YBDWTl1lsdaMj5gKQBeUTwgmUl+ArC55Njv4qKLQe8sGcB8gykkiPB9gHukDpfv+jY5Q F+Mg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: AJcUukdPb2S5JQV0FlHWf79zqIG6USw3DOWHQFLXWc4L/ZAVyl2ntteK XZ3kB6cmUO/GvWZcBbRX3sKDz6f+6q4FedUIQOClD7MG2z/d6AF+olJ66xhLo2aFQbqye4uNCmN JW7YxW+OUEwMjx7J7npgugcnIEVOd5RcVyKF44qSoV4r2QJo0fdu2ZuiMtujY92iTDg== X-Received: by 2002:a37:26c1:: with SMTP id m62mr22589367qkm.182.1547470847789; Mon, 14 Jan 2019 05:00:47 -0800 (PST) X-Google-Smtp-Source: ALg8bN7pFMUvB2Nh7D0eb4jxvZ4hMNsxGL5aPs422miepipHPTDg66y4fUQyAr+M0rJ/rEn636rO X-Received: by 2002:a37:26c1:: with SMTP id m62mr22589300qkm.182.1547470847023; Mon, 14 Jan 2019 05:00:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547470847; cv=none; d=google.com; s=arc-20160816; b=IdotB1LHaHc73dunsLFImU6Po/Xmp4ZH5FvqTuce7vl4RtToFWqila0iTLPFH2yqKY HxXmoFkFL9WbagNLaFfvbDT6eo2U6qiMsQl4GcQh1BzsLJ9x+To3ZfigmLMo85/iTc/W 9RbmkeG827/b8vnMqM53Fjy2YUzYAffkCm6T5BC0yMCL4bbPOvcTT0zFc64zY4dxCkH1 Rr+uj/ppvH8hlImO6+fLtb2DKK2jI2rSqJQDk6wIWnd3SUUpWGaBlh3+n+1+WYxNtStw c4ySrTuRf+6RGTkOrezNf+Qry4FVrucRfz/93/0sxcEuV+Z1TToNF4u55zpCxiyEK7XE n0Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=nGwjQtOjk4/GamjVyCiINCn7txjzWwZ4MNkuRb8d1J8=; b=Fsv8agDpYjEzxuoLb+dgSGkL2NDOQgb66l0ENOFA+9uYy2/HLzfemIctD5xIMpiQwH lUzo04wNLnETerZV0JEMnbF80WdA8GpzgxbJOHS2n7PR/bNogFA/xV++VHKmxYI6KIA+ rjdf1tyMTWYHWg4+Fz7TB7HYYlLxMqPHaG7CfUooXBKSigpfAyB2ujXaFNRLTBuPkAwo f3e8lCJ3GCzZrxvLHmv6OS8U9UKUmRGBzO19UB63gc4Saa2dTAC2BD1Gu9q0uN7Boyly OFMzdCkZjUIRUnhai0vbfiAR+Key/6INYcaKa6MvORMacRzToxwuVMohJSdYH7cz72HQ 789g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id 28si8889267qvh.58.2019.01.14.05.00.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:00:47 -0800 (PST) Received-SPF: pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E1E207FD56; Mon, 14 Jan 2019 13:00:44 +0000 (UTC) Received: from t460s.redhat.com (unknown [10.36.118.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id 41B9E5D76A; Mon, 14 Jan 2019 13:00:03 +0000 (UTC) From: David Hildenbrand To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-mediatek@lists.infradead.org, David Hildenbrand , Tony Luck , Fenghua Yu , Oleg Nesterov , Andrew Morton , David Howells , Mike Rapoport , Michal Hocko Subject: [PATCH v2 8/9] ia64: perfmon: Don't mark buffer pages as PG_reserved Date: Mon, 14 Jan 2019 13:59:02 +0100 Message-Id: <20190114125903.24845-9-david@redhat.com> In-Reply-To: <20190114125903.24845-1-david@redhat.com> References: <20190114125903.24845-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 14 Jan 2019 13:00:46 +0000 (UTC) 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: X-Virus-Scanned: ClamAV using ClamSMTP In the old days, remap_pfn_range() required pages to be marked as PG_reserved, so they would e.g. never get swapped out. This was required for special mappings. Nowadays, this is fully handled via the VMA (VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP inside remap_pfn_range() to be precise). PG_reserved is no longer required but only a relict from the past. So only architecture specific MM handling might require it (e.g. to detect them as MMIO pages). As there are no architecture specific checks for PageReserved() apart from MCA handling in ia64code, this can go. Use simple vzalloc()/vfree() instead. Note that before calling vzalloc(), size has already been aligned to PAGE_SIZE, no need to align again. Cc: Tony Luck Cc: Fenghua Yu Cc: Oleg Nesterov Cc: Andrew Morton Cc: David Hildenbrand Cc: David Howells Cc: Mike Rapoport Cc: Michal Hocko Signed-off-by: David Hildenbrand --- arch/ia64/kernel/perfmon.c | 59 +++----------------------------------- 1 file changed, 4 insertions(+), 55 deletions(-) diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 46bff1661836..7a969f4c3534 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c @@ -583,17 +583,6 @@ pfm_put_task(struct task_struct *task) if (task != current) put_task_struct(task); } -static inline void -pfm_reserve_page(unsigned long a) -{ - SetPageReserved(vmalloc_to_page((void *)a)); -} -static inline void -pfm_unreserve_page(unsigned long a) -{ - ClearPageReserved(vmalloc_to_page((void*)a)); -} - static inline unsigned long pfm_protect_ctx_ctxsw(pfm_context_t *x) { @@ -816,44 +805,6 @@ pfm_reset_msgq(pfm_context_t *ctx) DPRINT(("ctx=%p msgq reset\n", ctx)); } -static void * -pfm_rvmalloc(unsigned long size) -{ - void *mem; - unsigned long addr; - - size = PAGE_ALIGN(size); - mem = vzalloc(size); - if (mem) { - //printk("perfmon: CPU%d pfm_rvmalloc(%ld)=%p\n", smp_processor_id(), size, mem); - addr = (unsigned long)mem; - while (size > 0) { - pfm_reserve_page(addr); - addr+=PAGE_SIZE; - size-=PAGE_SIZE; - } - } - return mem; -} - -static void -pfm_rvfree(void *mem, unsigned long size) -{ - unsigned long addr; - - if (mem) { - DPRINT(("freeing physical buffer @%p size=%lu\n", mem, size)); - addr = (unsigned long) mem; - while ((long) size > 0) { - pfm_unreserve_page(addr); - addr+=PAGE_SIZE; - size-=PAGE_SIZE; - } - vfree(mem); - } - return; -} - static pfm_context_t * pfm_context_alloc(int ctx_flags) { @@ -1498,7 +1449,7 @@ pfm_free_smpl_buffer(pfm_context_t *ctx) /* * free the buffer */ - pfm_rvfree(ctx->ctx_smpl_hdr, ctx->ctx_smpl_size); + vfree(ctx->ctx_smpl_hdr); ctx->ctx_smpl_hdr = NULL; ctx->ctx_smpl_size = 0UL; @@ -2137,7 +2088,7 @@ pfm_close(struct inode *inode, struct file *filp) * All memory free operations (especially for vmalloc'ed memory) * MUST be done with interrupts ENABLED. */ - if (smpl_buf_addr) pfm_rvfree(smpl_buf_addr, smpl_buf_size); + vfree(smpl_buf_addr); /* * return the memory used by the context @@ -2266,10 +2217,8 @@ pfm_smpl_buffer_alloc(struct task_struct *task, struct file *filp, pfm_context_t /* * We do the easy to undo allocations first. - * - * pfm_rvmalloc(), clears the buffer, so there is no leak */ - smpl_buf = pfm_rvmalloc(size); + smpl_buf = vzalloc(size); if (smpl_buf == NULL) { DPRINT(("Can't allocate sampling buffer\n")); return -ENOMEM; @@ -2346,7 +2295,7 @@ pfm_smpl_buffer_alloc(struct task_struct *task, struct file *filp, pfm_context_t error: vm_area_free(vma); error_kmem: - pfm_rvfree(smpl_buf, size); + vfree(smpl_buf); return -ENOMEM; } From patchwork Mon Jan 14 12:59:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10762355 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC9176C2 for ; Mon, 14 Jan 2019 13:00:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AEDAB28837 for ; Mon, 14 Jan 2019 13:00:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A228328BA0; Mon, 14 Jan 2019 13:00:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9132628837 for ; Mon, 14 Jan 2019 13:00:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3469D8E0004; Mon, 14 Jan 2019 08:00:52 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2F5108E0002; Mon, 14 Jan 2019 08:00:52 -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 1BC788E0004; Mon, 14 Jan 2019 08:00:52 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by kanga.kvack.org (Postfix) with ESMTP id E55E48E0002 for ; Mon, 14 Jan 2019 08:00:51 -0500 (EST) Received: by mail-qt1-f197.google.com with SMTP id t18so24576877qtj.3 for ; Mon, 14 Jan 2019 05:00:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=1c+rBDFfPMDPNd6QFbO9/WEc/vIQUgZf0k82N4ksyf4=; b=k3IU9Zd+AnyPEQBk85sPCtxIeM7U0PIEEKdc4gJYGZvZyEiBiC07tTHB1F6bViY7/8 3e/SUDernQ88wgnJC8uEuPrwfOZqH2LhTbsLH+O5iY+1y5s9ysPSdhNQRJaD5Gy3RYiD 7XAeY5fEQSVFABd8LNwvdHyAUzbHD4OIOGgxSgrrA+Ebb7mTrTfpHjIMKMG1u2ZwKVNm rCJ6Qtpq1MTHfZB7W1A7MeFFxw9+lKkux6K7t9ptt5gL6Lv5vYIk8Kyd7yo6yBvhDrKp ZqjXuQws9wfcIHv+rVEMSr0Y5Xo6mHuvU57i+5JdpbPLC0v0jTZi7Bo+Zu7onGUTKM0P tijg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: AJcUukcHXIFMMpWsJIBp7Kzzfnx1Y8BNZX+73rdOwg7FNRzFj6Kco8AL vof63uIuSk8YhNAK5MRX6Kms2UCt5D31RWuADtovDl/e8/bAVmov1yAL6JiPW1i2ly2su+fSPxP diYP8aKWBfIICptrutC9W1XCIfHBIkoeixImh+MeOR7JUcUD59dIsVrsyfwng48cKsQ== X-Received: by 2002:a37:a741:: with SMTP id q62mr9678572qke.327.1547470851554; Mon, 14 Jan 2019 05:00:51 -0800 (PST) X-Google-Smtp-Source: ALg8bN5MbC9e5xfSoXTW6+KaOO3dWdgLR0HA57EZAqDi++7as39uWqhXAWJn6Z0XKwF1jgjP4fSR X-Received: by 2002:a37:a741:: with SMTP id q62mr9678512qke.327.1547470850755; Mon, 14 Jan 2019 05:00:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547470850; cv=none; d=google.com; s=arc-20160816; b=G7o3uTBzyfpt7qtEm71Rf/34JccIi51J0SO9euCGNA2M8cilhjfPAbb77rcl1Aa4oN lSJLxstpdmdf0ZoQoODCKdMnIK42cvPdAbBP0kFBPjGGxFZ8t/G1cmMeTIldCUEUxqWG XQrSp//OwuitA9n31juGY3WX4VItwUn/i3p1PPh4UZG8W/9wa6qREXCAJKmohqQPEQsM 4sg4LXM637HgWDX3pqhZh13fwaNe2o421xhX8beKUF+7V922gyQ7QrTueDK98kOvoKje zo2DfdZNnUPHLZPnuuehZa7oy/l/OooDwCMig1RmpXDIBsdYZswPcR2G9BdESFT0Nckg DEuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=1c+rBDFfPMDPNd6QFbO9/WEc/vIQUgZf0k82N4ksyf4=; b=jR/fjaXpLzFv022REx+mBxp+XValXxJTN3tlZCvIGMX2J2unLZMvXQzg9w05esamcn dfRuPPbgNxMFLyBKb0w5IZZFTJ7JHz1XciR+uQkMLtI5WlHWJwreorQK3yVjAPPQDule gZ0FP4kZ7T7inm1GeJv66yaEuS7MUFapYyn0tIhwe2GBhTDd8PF3boWzdNZpJwqqzLU+ vjNzofoVPnxkNwdVjRip8ahVNp3vh8OzDkoFdeTZRQggf+8dWyiYsUiO2FWEVUmWEJZS XTj/2Z/FRZmDfdR+l3wZnvy4kELCTjNnNpAAGTmW9yxGxg4x0aosCcBmHwuqAeweNNyi Xj6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id x189si1246308qke.171.2019.01.14.05.00.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:00:50 -0800 (PST) Received-SPF: pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D235DA7EF; Mon, 14 Jan 2019 13:00:48 +0000 (UTC) Received: from t460s.redhat.com (unknown [10.36.118.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0990F5D784; Mon, 14 Jan 2019 13:00:44 +0000 (UTC) From: David Hildenbrand To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-mediatek@lists.infradead.org, David Hildenbrand , Andrew Morton , Stephen Rothwell , Pavel Tatashin , Michal Hocko , Alexander Duyck , Matthew Wilcox , Anthony Yznaga , Miles Chen , yi.z.zhang@linux.intel.com, Dan Williams , Randy Dunlap Subject: [PATCH v2 9/9] mm: better document PG_reserved Date: Mon, 14 Jan 2019 13:59:03 +0100 Message-Id: <20190114125903.24845-10-david@redhat.com> In-Reply-To: <20190114125903.24845-1-david@redhat.com> References: <20190114125903.24845-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 14 Jan 2019 13:00:49 +0000 (UTC) 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: X-Virus-Scanned: ClamAV using ClamSMTP The usage of PG_reserved and how PG_reserved pages are to be treated is buried deep down in different parts of the kernel. Let's shine some light onto these details by documenting current users and expected behavior. Especially, clarify on the "Some of them might not even exist" case. These are physical memory gaps that will never be dumped as they are not marked as IORESOURCE_SYSRAM. PG_reserved does in general not hinder anybody from dumping or swapping. In some cases, these pages will not be stored in the hibernation image. Cc: Andrew Morton Cc: Stephen Rothwell Cc: Pavel Tatashin Cc: Michal Hocko Cc: Alexander Duyck Cc: Matthew Wilcox Cc: Anthony Yznaga Cc: Miles Chen Cc: yi.z.zhang@linux.intel.com Cc: Dan Williams Cc: Randy Dunlap Signed-off-by: David Hildenbrand --- include/linux/page-flags.h | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 808b4183e30d..9f8712a4b1a5 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -17,8 +17,37 @@ /* * Various page->flags bits: * - * PG_reserved is set for special pages, which can never be swapped out. Some - * of them might not even exist... + * PG_reserved is set for special pages. The "struct page" of such a page + * should in general not be touched (e.g. set dirty) except by its owner. + * Pages marked as PG_reserved include: + * - Pages part of the kernel image (including vDSO) and similar (e.g. BIOS, + * initrd, HW tables) + * - Pages reserved or allocated early during boot (before the page allocator + * was initialized). This includes (depending on the architecture) the + * initial vmemmap, initial page tables, crashkernel, elfcorehdr, and much + * much more. Once (if ever) freed, PG_reserved is cleared and they will + * be given to the page allocator. + * - Pages falling into physical memory gaps - not IORESOURCE_SYSRAM. Trying + * to read/write these pages might end badly. Don't touch! + * - The zero page(s) + * - Pages not added to the page allocator when onlining a section because + * they were excluded via the online_page_callback() or because they are + * PG_hwpoison. + * - Pages allocated in the context of kexec/kdump (loaded kernel image, + * control pages, vmcoreinfo) + * - MMIO/DMA pages. Some architectures don't allow to ioremap pages that are + * not marked PG_reserved (as they might be in use by somebody else who does + * not respect the caching strategy). + * - Pages part of an offline section (struct pages of offline sections should + * not be trusted as they will be initialized when first onlined). + * - MCA pages on ia64 + * - Pages holding CPU notes for POWER Firmware Assisted Dump + * - Device memory (e.g. PMEM, DAX, HMM) + * Some PG_reserved pages will be excluded from the hibernation image. + * PG_reserved does in general not hinder anybody from dumping or swapping + * and is no longer required for remap_pfn_range(). ioremap might require it. + * Consequently, PG_reserved for a page mapped into user space can indicate + * the zero page, the vDSO, MMIO pages or device memory. * * The PG_private bitflag is set on pagecache pages if they contain filesystem * specific data (which is normally at page->private). It can be used by