From patchwork Fri Dec 14 11:10:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10730869 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 0FD5C16B1 for ; Fri, 14 Dec 2018 11:10:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00F9B2D3B7 for ; Fri, 14 Dec 2018 11:10:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9B4A2D411; Fri, 14 Dec 2018 11:10: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 7580B2D3B7 for ; Fri, 14 Dec 2018 11:10:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 39F128E01CB; Fri, 14 Dec 2018 06:10:48 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2D4D98E01C5; Fri, 14 Dec 2018 06:10: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 19E448E01CB; Fri, 14 Dec 2018 06:10:48 -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 D89398E01C5 for ; Fri, 14 Dec 2018 06:10:47 -0500 (EST) Received: by mail-qt1-f198.google.com with SMTP id n95so4576035qte.16 for ; Fri, 14 Dec 2018 03:10:47 -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=ZA9gIjJhwWlEH15WL7cmNvRJFWNUp847tunD9C/hw08d0uY+Y0VymjddLQLHQUm+WL X+3iNMT3q8Du5UsB9CJva4Mk8pZ/HhPerdGWzcjvGmO4mrGSu+JVp7YDyzzMPXb952cF ngB6N9HD/jVOSW9isKKOPbhrdFS5GvZl5WOnWVdRoiEB8pcV9ih9ywaMNSrpRK7tMGHu 4txTzRbha7YFxUjyOXGtWxVukh7KEleHLR7iTNDo5eBJekLq49D7NF+XCQonjJ+q7juH ujsUmCdrXTAgipjjoUBwQHj1i2ffKbhR51Kyd6a+/qmrkP+otke9aOyY6LGappFlDReZ 3scw== 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: AA+aEWZuZkR7M9couFfL8s9lQPqjV5bQEhor/IHGnbT0hliJqsxvyEVv BThUG5oTP6w/ceK95xIZOe7h4PDVYqePOGetAgHgJxVEOcaYOWpEY5bUBEZQPzI/WvD6JzWeZTL l1wvtjakO+5YDTmiId1ppUg7qEZXdO4B1mvEMSPTfWHC9SD8jHF1v+pu0F40PM2gVDg== X-Received: by 2002:a37:848:: with SMTP id 69mr2041513qki.351.1544785847657; Fri, 14 Dec 2018 03:10:47 -0800 (PST) X-Google-Smtp-Source: AFSGD/WYBa8FhVFjAvGZPtAEESB3BIqbt119T+SAYa59gXjF7DFvV3a/r22DJNwmS8kJjCOmp8Fm X-Received: by 2002:a37:848:: with SMTP id 69mr2041489qki.351.1544785847177; Fri, 14 Dec 2018 03:10:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544785847; cv=none; d=google.com; s=arc-20160816; b=DKU1t8USIRcmeE5UHd1GRZ1QFckEApwwD3SP3jPGrBjfS/yu3km5pxdZjxvmZwupg3 Y35B/wzspHuwgPJr4edu0DBsK/M6D/ASK5yz6tyz/Nys9kiQdtdMFAxER+hJhTJVY2OI 9UwljWVNL6g+/yH2uPIm97JyHO/AgDnGEYd6ZcOz2KzgFzTzJmemxa1ci6gGUL7Xu2DP vT9+9c+atHBLbIAMI1U8+J5JSCgkFxyAXPAjfJ/6s1ftSAhjuQBVXUHFL6YCaD8uSmYd nrobR7pGd/CvKC5T5zjo25L3d7ozHKInIEvaGvJct6FTbLh8IX6fglj+u30EcOYzqct1 V3Ww== 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=bfLlxUSCvX5WNHFSr17OtkZJTnPyoLMdUH5siOFm0I6O7wnun3JmpoxbzurC0AqfjI Wcu50J1FKCx+tk4ULAvFRvhzU/0yGlQuoetyRzFRlDpcxpDd/7qU3Y9CwAPj0poGrunT aj0kFZwpGMKB11LchexYVEhORojsi9UMFFr4rfj61zzo2lCcaZdgl+2e+aT/x5Ilm9fT 2FdUb+cB7VM8OFjioq41m5BBMuvzxbD0SbWtxZBAfXfUiuCOahnvVY23zPdGzbSNTlqb /Lhv0GcNK6x/mvtNWO08eGf+ntAeWQB0NjqisQcQMJ740Iv1JEZkVC2IPlm20Rcm7jKU ivVQ== 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 o1si808121qvm.82.2018.12.14.03.10.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 03:10: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-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A3E2307C94C; Fri, 14 Dec 2018 11:10:46 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-139.ams2.redhat.com [10.36.117.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id F3F276836F; Fri, 14 Dec 2018 11:10: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 , David Airlie , Arnd Bergmann , Greg Kroah-Hartman , Andrew Morton , Michal Hocko , Matthew Wilcox Subject: [PATCH v1 1/9] agp: efficeon: no need to set PG_reserved on GATT tables Date: Fri, 14 Dec 2018 12:10:06 +0100 Message-Id: <20181214111014.15672-2-david@redhat.com> In-Reply-To: <20181214111014.15672-1-david@redhat.com> References: <20181214111014.15672-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 14 Dec 2018 11:10: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 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 Fri Dec 14 11:10:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10730871 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 0DF6E15A6 for ; Fri, 14 Dec 2018 11:10:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F27082D3EA for ; Fri, 14 Dec 2018 11:10:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E68982D40A; Fri, 14 Dec 2018 11:10:53 +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 62A492D411 for ; Fri, 14 Dec 2018 11:10:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 411658E01CC; Fri, 14 Dec 2018 06:10:52 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 398468E01C5; Fri, 14 Dec 2018 06:10: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 260308E01CC; Fri, 14 Dec 2018 06:10: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 E48348E01C5 for ; Fri, 14 Dec 2018 06:10:51 -0500 (EST) Received: by mail-qk1-f197.google.com with SMTP id z68so4280507qkb.14 for ; Fri, 14 Dec 2018 03:10: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=wrnTpcztdhkLOx5UlBaal7BO9LpZw/dFswadfw8ZOZI=; b=LxEiLEbO6GlxTatLhrCLNPrkL8e3Sh4CFempRrfC/LQcpVEIT12GmCB3MtBYDcqly9 w8MiSoTcrloTSsJjm5KjtkJeTlw1snvBjhqiXtYbyq/YSfDFA4D/8l1U12PuGYqajXW8 VUm+LYGxeO4FMqaGY4cCeoETncBeiI/cUMnlqzIJT9c/8ENHB5AKwbyVebVXIQgo+BfW t3VzfFOwyXK4BhTsytbEbBv5R3HyoIY8L4iu88p+0LtjVgRLmVRTlcwH6353L92OOZek Sv9qp4a/WAfbt9LolcdCopX1SZBYieJ0bpTN/lJIEa8fb/GLhsi7u+Z1IQRChvRBKVkB ziHw== 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: AA+aEWYd4c9BaqTDB1KNLkT1lg+zvrG7bf2rjCph3wdIzA4kgcvF92qX DBxZkXE7d0ojeN+Cybs2vMBvo8TnnSD8GD4pMxTyRpV6nSl9+5RGx5aZn0UCz9cqksrVvCXuP/d OW4GXdqoNLgWgQXtnG9ch4KD/12BONHUCxnh2A7ED8Y1q93TTlEYSvpecfm3e+k80nQ== X-Received: by 2002:a0c:8286:: with SMTP id i6mr2193813qva.65.1544785851704; Fri, 14 Dec 2018 03:10:51 -0800 (PST) X-Google-Smtp-Source: AFSGD/XSyt6OkPEhiB52DGB8FKTnDgllV7P3CSaIfYyl503udpG7QOdmrIU/UVM4FNrQ0uocESi6 X-Received: by 2002:a0c:8286:: with SMTP id i6mr2193790qva.65.1544785851205; Fri, 14 Dec 2018 03:10:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544785851; cv=none; d=google.com; s=arc-20160816; b=zYA/7GidHe3WHEDy5htG1b0aOw9MEoheAfe+zlV8txAP/TgOF6LZeWkHXxxHp5elsM fi+9f7jelgRFbc9q+NOnLPzOxisSVykqSR6dCx1TtTo7OTm/gmDxdTgbwJe27g3zfkzR unn23KKNw7meawTXY9LFTaWClZJ1RIylDiQFFyO+pqa9Lt7DDE8DjDKQq3ttjsDEgfse 8R+SCIJPypAf3EQ0m8PmkNbIM7jyC0CyxO8uU7Dfo1zeMNDSqp5f/jqSQ+kfJ/rD1zyn f+oOSJtCyqKkfMqH6W1tiCT0176pOXhqeTmUGOdOBam9b8xg/wf2yT/UPkGpXUaKSdwN GvKA== 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=wrnTpcztdhkLOx5UlBaal7BO9LpZw/dFswadfw8ZOZI=; b=j3JzUNUvT2f7Icrmqi3wEEvQSYsR6zw0Gju5nqO91MwfUr8T+XLIwBwTyHSm3RrEjz IbEOUqO5Nnn0IC5OPVIelCPtndHlM1EtFyUoiSMpTlQEIqoLWKT8+TsWKS4XBuTCymfq TxpeaCq+aw05sFRAzkA26IJROSb9seBS+OtpsL8Y8cY/vezY2tQT7+Ricr1WzjTSTwoz b+q6zs5vpDBuVekVfJLFXILQclVtZZqo317/e2NZ60NA3l49Puzhl58AEQ7u7NGHawiP jLnGZaUI8WALCff1ooOJvQz0g/DPLm2ewXGp0LVZRFuo/OZe/4Jv2184jYj2ijU06Cx9 mTZQ== 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 o5si2807662qkh.112.2018.12.14.03.10.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 03:10: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-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 39346DD9C0; Fri, 14 Dec 2018 11:10:50 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-139.ams2.redhat.com [10.36.117.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7DC595DA2A; Fri, 14 Dec 2018 11:10:46 +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 v1 2/9] s390/vdso: don't clear PG_reserved Date: Fri, 14 Dec 2018 12:10:07 +0100 Message-Id: <20181214111014.15672-3-david@redhat.com> In-Reply-To: <20181214111014.15672-1-david@redhat.com> References: <20181214111014.15672-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 14 Dec 2018 11:10:50 +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 ebe748a9f472..9e24d23c26c0 100644 --- a/arch/s390/kernel/vdso.c +++ b/arch/s390/kernel/vdso.c @@ -292,7 +292,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; } @@ -310,7 +309,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 Fri Dec 14 11:10:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10730873 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 60DEE15A6 for ; Fri, 14 Dec 2018 11:10:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50C862D3E1 for ; Fri, 14 Dec 2018 11:10:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44F562D412; Fri, 14 Dec 2018 11:10:58 +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 A25F32D416 for ; Fri, 14 Dec 2018 11:10:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6A6FB8E01CD; Fri, 14 Dec 2018 06:10:56 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 62F5B8E01C5; Fri, 14 Dec 2018 06:10:56 -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 4F8DE8E01CD; Fri, 14 Dec 2018 06:10:56 -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 219AF8E01C5 for ; Fri, 14 Dec 2018 06:10:56 -0500 (EST) Received: by mail-qk1-f197.google.com with SMTP id 92so4268066qkx.19 for ; Fri, 14 Dec 2018 03:10:56 -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=AHOZQxBkJ1h5ptlXCEr+F06XJiW9l91fFbVwclEPXpI=; b=mDYu/YH4kcjD/a+FqvwUoveHpyZayTsEtQ2ounD5cXZq4ZQ9/YRcIFIZ1eOHNFvnYw BoC94RgHvk6p858m6UaF7xyMpLNveFYFdVBVEVr091J5oUaZY00bCpviLjdUvuS7jqYA mx1UH7UtANN3r7T8IaivISKSc/UJibZDO7SWZG6kxk02NbVEq4WWk/6Ipy8vCGO5ZVX2 pwlV3VJjWi8p9p03wTvxRzu87xKWV/P+fycTDAUm/MROhzZg0uBaQ1k4HKlCSAPXeVv6 SXGy0pQpJ4Q7+X1J5VDODKHvfEHnSIyG3agi9XfwiXww4B71jE9GIC9rB6hhLc2t54ce pcsg== 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: AA+aEWaQ4IXr+1o6GI8IgfMcdl/qEV9FAnhYIPuOs82SlviG4pFQgUI5 5WidUEEhJkXwVVv1WF66+rSVG62wa3aKPFNEG4J2mOvx9tECzdDHUfxeOAJDFA4zpU0gUo9JnfL tM8HD4NcQFW7j/RVSE9pcfJoOkIK292gwvI61QhIONxzL6x4z4wWk0Y9lqr1e6eYDYA== X-Received: by 2002:a0c:eb41:: with SMTP id c1mr2275857qvq.211.1544785855908; Fri, 14 Dec 2018 03:10:55 -0800 (PST) X-Google-Smtp-Source: AFSGD/XZTwsY2XzQ4m1O6LGseL4SUdig+3HvCJRjYJpbdUHBwHo7b9JgVVLxmgtJ4C6ph/PLgy/X X-Received: by 2002:a0c:eb41:: with SMTP id c1mr2275805qvq.211.1544785855113; Fri, 14 Dec 2018 03:10:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544785855; cv=none; d=google.com; s=arc-20160816; b=nP38xEGW7qjohB+FeBxEg5qQMfbLHMEmOp8XiZKEj1gGRDJV0W3n7Yi06WSf5gnJ98 3S/XpE647lyp+wT2zpikqx7quAW66b+2lz6zLyU8BnSdD2R+2KzDoaZrIpfZE4O1j+e2 YNBNryy9OtUU1ZsvQ6INyQvm382GcbCM6QkfU7ahdU/O9mGYWtXkkoepRNZNjgIx9HzI CBHcvUHsC7TNwhhFtOqYSngyI1loy9iG9BhGZlgs2MQrhH/QKtamfjd+uCrnOmRnDum5 K5Dy4FwLPoNdUrccGrrYqzPqv7ZDLHM5Qiqg/W89ql2aoW1z0ykkIsYJXEgjhzOSbMoF RD4A== 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=AHOZQxBkJ1h5ptlXCEr+F06XJiW9l91fFbVwclEPXpI=; b=ntItuoMKUJVFXwBDIlGmf3y95d/6SIS8nXcGc2Ycv2Rvbmv1NPpbtXAV6DLtBOQtEU xgxrE2bTB2gPiYnXrZmnjRENXvTcMiYpk2FMVDfKqvUNPgBHyjfWk2wOpHVMI77mJOww a5Jh0MxkmbD3t41ukriX6ns2/PlVa6sptFbTKYv+O0eDpXAS6s5MG9ThNyDodeP/6/iO b8ieJ/ZG61gWcgoh8VBoUcI16DOw9kXgbbOqPMWFY8432MO58m4Khzu2X2b5qLah9/1d +iY0eXQnvRtsL6FVfYB1C1BZGqfvs3Lp1v3GEQebU/JwDzrlBM03q4zDikcF+uVa99jb OKIg== 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 z202si1901938qkz.83.2018.12.14.03.10.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 03:10:55 -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-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1B95C307C94F; Fri, 14 Dec 2018 11:10:54 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-139.ams2.redhat.com [10.36.117.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8BC9E5DA2A; Fri, 14 Dec 2018 11:10: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 , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Christophe Leroy , Kees Cook , Andrew Morton , Michal Hocko , Matthew Wilcox Subject: [PATCH v1 3/9] powerpc/vdso: don't clear PG_reserved Date: Fri, 14 Dec 2018 12:10:08 +0100 Message-Id: <20181214111014.15672-4-david@redhat.com> In-Reply-To: <20181214111014.15672-1-david@redhat.com> References: <20181214111014.15672-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 14 Dec 2018 11:10:54 +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 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 65b3bdb99f0b..d59dc2e9a695 100644 --- a/arch/powerpc/kernel/vdso.c +++ b/arch/powerpc/kernel/vdso.c @@ -795,7 +795,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; } @@ -809,7 +808,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 Fri Dec 14 11:10:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10730875 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 F2C2014E2 for ; Fri, 14 Dec 2018 11:11:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E26B12D40B for ; Fri, 14 Dec 2018 11:11:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D3C172D419; Fri, 14 Dec 2018 11:11:01 +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 113AB2D40B for ; Fri, 14 Dec 2018 11:11:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B3ACB8E01CE; Fri, 14 Dec 2018 06:10:59 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id AC3058E01C5; Fri, 14 Dec 2018 06:10:59 -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 964BB8E01CE; Fri, 14 Dec 2018 06:10:59 -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 6846E8E01C5 for ; Fri, 14 Dec 2018 06:10:59 -0500 (EST) Received: by mail-qk1-f199.google.com with SMTP id c71so1020439qke.18 for ; Fri, 14 Dec 2018 03:10:59 -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=AqzW1HSVyhDQcGvpEOz2LD8wwdgLbZWr85vIN6XMra8PO3HChgdSohLvSdtzXadkmF tHcU1ycoOrwnj++OTxyG3Mv99opmqhdV9t/8rmj0tQFSh3eUyEpbQ8grK01oaJo/DhrD 3cjJF2kHde5co6MKBNjNLOPHvFSTJBk3K1x07MbLpcspdE3CTm7lej4UViXifioibuiS NTWu7PN3A2TxI4dF/gU557KlV16twRC+l3hmx2x2Y7t93vYZOTGpot7Nxqdlu2Lp3AwP O6FSZHZnvzvy20i5u6ApFHLjlYn77MEY+/CmTWrRk2pNAfio46FiOkR+oZ2PuTt/FhzA szFQ== 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: AA+aEWatQP6BMvpqDrnYNzrw2M/HP76ijp/FrsT4hgzuqi+3sUKvQJd/ yy6czdA9eyRLNsufg4B8/xAKKpIUWVh6ffCUrNs78LQzn9J4C60Jse9KwDSLkJxNEvuyNM+4pRb SfSkcilfQeHIRSOJSWSdY55DW4QmiQ7BqDTPrW2i3Gmqszj5xAUXu+OSKLCYNvoxlAA== X-Received: by 2002:ac8:d03:: with SMTP id q3mr2186789qti.387.1544785859198; Fri, 14 Dec 2018 03:10:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/WWMwUS+h9Zhrn6lx/rFwyGL6BvqIW/NlxBjFi4KJcESPtAsIzsCGOPmxl5gZAO+MV3RBCb X-Received: by 2002:ac8:d03:: with SMTP id q3mr2186747qti.387.1544785858505; Fri, 14 Dec 2018 03:10:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544785858; cv=none; d=google.com; s=arc-20160816; b=OJ6eePCk74aTMWpCo0I3nQjntU7MRxOOF5lUS9fSlWz13vm6YsI1z2ZWqA/ItZQIYg Nuhmr3odf4ax20iMlGgaO2Ij2WZr9FOMqCxAUbn7rTw3QuxqAqQn/MsE+tmXGukHAxrZ yAVni7JLm9lm7e8lTAohTJxGgLSXQuKrFWN9ExaHiyoXV9JmdPVSj8OXIAwf49BkKvl1 B+KeoJAsjVFgGBmQ53kiywXbqKO5IxltxqsdfPn2O4C1RhCb3S7oqDHIf6zqob14JrGS wsrd8V9dXAKjyxnRmlrdmT5A3S/woraJX+jlmNrSLklUTnU682F8xnzZ3DuWwivgiZ0w u6jQ== 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=jVUq304ScJcjAhZNymv4+ZaNloxZjw5rENw0LXS1Ctpvrc7yoR9Z/YoVZwV709zNzW Z6qrDV1voNUxhy/o5zvKKVBqIwB1H0L/NL73IfzRZmyL2dow95wW/SUQeCVAIDerH03o 4kSzaRpyK41bzHmiBDxxSO+jGMYXMSzVxhoKNa9nIKcxlLZMP+sr2HiCu+3dOzFfvmrw rVekOOGQ9+/FCZwFcsAxRP/Rn1yHK3zRmyE3M0mwshJ5pXTfvsyLTkdksUNKji0ybPQs EGqGWotyh2KVf8f5kJ1suxE5is8JDZOEq1Gv+vhfiB4FWS6eETzSsoVlRWDS9ju2OFGf 3Q5Q== 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 z2si2669130qtf.343.2018.12.14.03.10.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 03:10:58 -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-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9FF389B302; Fri, 14 Dec 2018 11:10:57 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-139.ams2.redhat.com [10.36.117.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7427617C6F; Fri, 14 Dec 2018 11:10:54 +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 v1 4/9] riscv/vdso: don't clear PG_reserved Date: Fri, 14 Dec 2018 12:10:09 +0100 Message-Id: <20181214111014.15672-5-david@redhat.com> In-Reply-To: <20181214111014.15672-1-david@redhat.com> References: <20181214111014.15672-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 14 Dec 2018 11:10:57 +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 --- 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 Fri Dec 14 11:10:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10730879 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 154B915A6 for ; Fri, 14 Dec 2018 11:11:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 06EA42D404 for ; Fri, 14 Dec 2018 11:11:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04F242D415; Fri, 14 Dec 2018 11:11:05 +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 8600C2D409 for ; Fri, 14 Dec 2018 11:11:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B8ED58E01CF; Fri, 14 Dec 2018 06:11:02 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id AEC428E01C5; Fri, 14 Dec 2018 06:11:02 -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 93E178E01CF; Fri, 14 Dec 2018 06:11:02 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by kanga.kvack.org (Postfix) with ESMTP id 5C4748E01C5 for ; Fri, 14 Dec 2018 06:11:02 -0500 (EST) Received: by mail-qt1-f200.google.com with SMTP id z6so4562233qtj.21 for ; Fri, 14 Dec 2018 03:11:02 -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=mlZFHAQxGT4SpnSdcN+Ex8fUChg9eCboBzkTvTPMkMHmHsZLsjbqaM9ez1udrX31br l1gz0PzSY3Qq9Z5DC3KOdm0wN/l5BMJW1RStmAbRvXViY5B/uOpyyYmvDyCG+EC7jrjO Vzn0u0EnbXT8Vtr9o+hjD2G/gFTZHghBM6sUgbEbjJ/8Ymuz/nBDNpJ+Oencj55vx2XA SDHUcsbi/uakMEqpObLagwowlNmKPRKfeYqFsWwRWZA7ahUUgajWWLUyHBQgKn4ozWx8 RD7Zi+/V/VZiJU9rdfn7ElfNwrFcNhwl3aiKj/8eOSsOdvvTOkJHInhBI4Su9cCCHJzS ax7Q== 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: AA+aEWbInZI/VPO19la5xqeOqDwDDnPfqpx0XeOyb+1oPrRWHOpM3WKO HP6H/4kx4xUoJFxCI9Hg+rbg/+I/4iaCo0SEOl+HcRKPxlcu5WmLZVomZYBDZ3rxLp77DfXIwcN 37S4wJfA7atYAQf1Y4Et3OlV/OPjVobr+RPRi2CXua8rOobde6TiL9MB2kexViXp8CQ== X-Received: by 2002:ae9:e414:: with SMTP id q20mr2029138qkc.205.1544785862157; Fri, 14 Dec 2018 03:11:02 -0800 (PST) X-Google-Smtp-Source: AFSGD/Ucs82zDjglkJHsT69055GdWbvlkuvIrlBTws0pUTuKFwkAAAu9biIWpQvIgb8/inV9NPds X-Received: by 2002:ae9:e414:: with SMTP id q20mr2029116qkc.205.1544785861685; Fri, 14 Dec 2018 03:11:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544785861; cv=none; d=google.com; s=arc-20160816; b=lYYfL3Vwp78aR+0pQJdztGtFbGf7M5NVLU+rjz80pZ8/K6WUys5ibgP5NHCTFq6yDm lro60TnY1cfm2ougVfpMbELmI8z9jRQF1mOuZ9zqyeaeURELxEE1t7vIQUwaBKivo8Z1 /6ABXTrb9px7GS/1psmhiqmfO0Hrp/0tv8dzpa1F6dWZl+zZUaH4oFrnkG2/802yuFBj FQ1/4CJJ9Dzrc2MNwLiy/DpfAbuZDgY4WmRIRHNlHIaubHO/2tyGzvfkhdZ+2y9ffi86 Xr5HpVLp5TLnm6pD1CztfzD2a9HR0D4s89Uzz0W8Lp5UxFqn4rv7QH6yWRk1QWvoUvrZ APiw== 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=D/CRvXoCUg7wo7qdy3My6GhXbPHQsn8GT+bdUqXsox+D8I5tm7MUlopRkVuQjpFB6c hZUcVFz+2Lc/yAezk7euVzRZEMoYQjWciNWmERzlOO3d/raw539NmlpspSGhqDB2HFq4 rz0dZeVsQDeS9sdaLYhdTAYwj/azuwybe1Ky6vRGuSDaNnt/uVp2rTAXy5SmLypM/qaT 2Jv+jSqS1Yte+j5AiqYTC6brbMwHXGlqzBUwEwzX9Nwyj+eMFxGe/IlcBNy/y4SsePZ1 qMergADjvUeLMmeO367wSGxeQ9+wNyhq+0duiitIlNt7brwM6ypuku/8x2UJhpO6LD9U Pucw== 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 k8si2695774qvp.96.2018.12.14.03.11.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 03:11:01 -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-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BF405307DAB7; Fri, 14 Dec 2018 11:11:00 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-139.ams2.redhat.com [10.36.117.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id F37B917C6F; Fri, 14 Dec 2018 11:10:57 +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 v1 5/9] m68k/mm: use __ClearPageReserved() Date: Fri, 14 Dec 2018 12:10:10 +0100 Message-Id: <20181214111014.15672-6-david@redhat.com> In-Reply-To: <20181214111014.15672-1-david@redhat.com> References: <20181214111014.15672-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 14 Dec 2018 11:11:01 +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 --- 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 Fri Dec 14 11:10:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10730881 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 4597214E2 for ; Fri, 14 Dec 2018 11:11:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33E482D367 for ; Fri, 14 Dec 2018 11:11:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 279F72D41E; Fri, 14 Dec 2018 11:11:12 +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 2A1742D367 for ; Fri, 14 Dec 2018 11:11:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 016EE8E01D0; Fri, 14 Dec 2018 06:11:09 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id EE1258E01C5; Fri, 14 Dec 2018 06:11:08 -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 DD2318E01D0; Fri, 14 Dec 2018 06:11:08 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by kanga.kvack.org (Postfix) with ESMTP id AF8E88E01C5 for ; Fri, 14 Dec 2018 06:11:08 -0500 (EST) Received: by mail-qk1-f198.google.com with SMTP id b185so4117520qkc.3 for ; Fri, 14 Dec 2018 03:11:08 -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=Fs7NQs9WD+19LMf+jOr2OMbg2riYxoWCJGDp4xBKeVFBW/O3tHk1j4ymXyH6TUla2N pxGd06OJgGwz81n/rbznOE2huWCEolD8tIHd80GBpqbmKZa73xRZZxxlCGCiekAcBjnA hECx+qVXu3QKN9PhZsqAfxeMD8pPRie/yNIM7nHBuHAmB30u0mCWRUyvbCf+3ORTA7Gc ZIFRQ0CEvsu2bDiyLrsWV/ewYFzQrEVm2/jwSNV0xvRdmOHnv+CZwroFJK8LxbIu83Kd /F74pt5cB9Awve+v7RGzPNA8NTE9VEMhFp/mMcwwuQZT3uHOBDJMGUDyp2Nb/huvPh7q 7QBw== 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: AA+aEWZ4dLJpCtm6QE+rs7UihDTNaKqyMaykRlDV3NPk40HdBL9gH0wc QrkYWnzXDiJew+Xcw+Rucv++krNUN+YqCq/mKPYZlH9I8QoHpma3Fc1aDDWQsrNRPF2vxMCenQV iiepl2IgG/8u+do63sN4y/8hmH7j9ioufK4Llnq9jwbbNMyk8w2d3A54eAUH0rc+AWg== X-Received: by 2002:ac8:1243:: with SMTP id g3mr2283120qtj.139.1544785868450; Fri, 14 Dec 2018 03:11:08 -0800 (PST) X-Google-Smtp-Source: AFSGD/UICVqJSDpqSeajMVIO8mYPXrEEXq531kQZN1zBjPOjOVq0kqwoo3davXmNivjhYLpPWxI9 X-Received: by 2002:ac8:1243:: with SMTP id g3mr2283100qtj.139.1544785868003; Fri, 14 Dec 2018 03:11:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544785867; cv=none; d=google.com; s=arc-20160816; b=v/qa96+EcrMN+r/a/HyhXJByvqD3TtBTEZof89ZkqtO67Ak88fvHMv+QHn7ifEF0SP p+gGPGCMVJvF351ChbfybAnIoK69w38quekvGnt0WbRokHpZ2tCeMcY3Hm1D/E6+hhR9 TbH+8LD+jkIMJnotJZxUvLOYp1brXNDJq0c91iaZBSMN1zI1RMkfVRUJfpdYtCEyxV7p V9+K9tMrOhtJtzsO7xqASQ43cKZS7CxYudtjuNNHaTMODPeiequtBVEa4azc5jplUmOM YPzTtaYbU1YE8OQ5DMrXPYrhjZ25GMGajtHs6s2cROKJ+y6SQZCrvRhwXg5HzCLrLGu1 zg6Q== 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=hvKZIa7DN6/zlIm6+WO1fxOAEnAucW//DV4TVwLbwfnzP49gyXdcgrFduOoQ6OnA+J EsSmMb3/SkPsc3OHmICbbWzL2qFTayAcEEQ0tOuto8CFHjLtvtpQ752z6OsB52C1kgdE btVrYprnM3uHeVWC6loww48rghZVT1tH20XeZHPCMr2upWRmWwNpb1Z93+h01AV7u49U +xH7X9kYMgEJ8/nkbmcE1TOYxnge03ZuPb3Pze+9IZn7xL/x/OIETu128rKVsE/SzSSq +me4Ge3931aGkErrqUMJG0U4DTYspghd8Iqn6OCl4Dh1oKIqLmybJPB/JtPbMicI2NXx A6pQ== 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 v2si1028511qvm.85.2018.12.14.03.11.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 03:11:07 -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-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0365A2D7F3; Fri, 14 Dec 2018 11:11:07 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-139.ams2.redhat.com [10.36.117.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E7E417C6F; Fri, 14 Dec 2018 11:11:00 +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 v1 6/9] arm64: kexec: no need to ClearPageReserved() Date: Fri, 14 Dec 2018 12:10:11 +0100 Message-Id: <20181214111014.15672-7-david@redhat.com> In-Reply-To: <20181214111014.15672-1-david@redhat.com> References: <20181214111014.15672-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 14 Dec 2018 11:11:07 +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: Matthias Brugger --- 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 Fri Dec 14 11:10:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10730885 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 5E7AF15A6 for ; Fri, 14 Dec 2018 11:11:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F1562D40B for ; Fri, 14 Dec 2018 11:11:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D02D2D412; Fri, 14 Dec 2018 11:11:17 +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 DC0A22D419 for ; Fri, 14 Dec 2018 11:11:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DF92A8E01C5; Fri, 14 Dec 2018 06:11:14 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D826A8E01D1; Fri, 14 Dec 2018 06:11:14 -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 C5D228E01C5; Fri, 14 Dec 2018 06:11:14 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by kanga.kvack.org (Postfix) with ESMTP id 93EA48E01C5 for ; Fri, 14 Dec 2018 06:11:14 -0500 (EST) Received: by mail-qk1-f198.google.com with SMTP id 92so4268656qkx.19 for ; Fri, 14 Dec 2018 03:11:14 -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=L/mJUv0wuJYz4inTXlhWRsi+v7HJ7aEbISqzOX8ojrc=; b=KrvVE0pAen0pJ2QTX/vGBEA80SOwHTkj+nawqFL0985EAlD/Vnfo7AhEysTr3m/Qmq ihtle2LR4KqOlD4HqOW6WbccukNJLhlcxuj4wkU/VBovrKtPgppLf5eN5cFVcMhc87yF UhqvD/xVB7CFlhyPXOECDoFPkqAwM+Zbm9gc1x/XIL1sS9IFZ4zu/TsJmVJT1rPibGol nxs4SNZUDoIKY6SygAaQ7Q9UpyqCr0z1ILskHeQAqyxm0uMi4osF+VH6pMFcdXgdg8IA fylNiru2Ug0YqhYhjbKme5jfDAo42K503fEiBanAaruKkJNeFvkcebNMn6CB/O9RLaa8 JjHA== 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: AA+aEWYHuCicWlfMEQW1RnW8bYWjAqxkODp4bhbSqrXDRtEV0w5I6Z7L NeLeyIdcpkHCkc9to9ln0dj8zhfXoPUg1PmMBZ3Q/7hhjIBrEyhx2sp+FqG7O+vyeD7wCHjOlGh PGo52ZxDvssIKQkVtT5QQUuC9GwRw1lh48bqbovaI8sj31vFsULwqOBvLqpy3EeXzXw== X-Received: by 2002:a0c:9927:: with SMTP id h36mr2187621qvd.171.1544785874380; Fri, 14 Dec 2018 03:11:14 -0800 (PST) X-Google-Smtp-Source: AFSGD/WjljbzOU8jxsoPtd47rvtb/0BDfKo3AqRCDSZHs4e4Xr+o5JwhoQNDgSFn8Mc9bbeLegc6 X-Received: by 2002:a0c:9927:: with SMTP id h36mr2187587qvd.171.1544785873866; Fri, 14 Dec 2018 03:11:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544785873; cv=none; d=google.com; s=arc-20160816; b=WoxiV6khlwnLUPkEnwhsZ21+aXzeIM/lRrz8OvLbrrIK8ITxMvPRkJGwaISSlOdMGc Cqm5xZLglRMiJH4mEIgG8pAMZSdcrk3aN3wtRn+pdyGl5fm5vE5Po+NtV3Li4lfTaklc SMY+RU9kvZixJy1NVlZJzrnKxYGZWPP0H4nBhdSEIo5f/pSEFH9yNmRZGuOFLd4KxrJ2 2kMr1pQiLJqJfCsvZGEjBC9A9dj18BwhQnnpCvoEFXvFpsBE0aDkuInMLHqIqXW+n2bF X8NOcjPnEy3+qceV/d3IAcLraKoJHGnfgMJjyYcE2f7RElNd5yD5jcZL7trzsguqRzpd jEDw== 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=L/mJUv0wuJYz4inTXlhWRsi+v7HJ7aEbISqzOX8ojrc=; b=AZQ/OyD4E/iPn76VSdxaZvuOseig8o/Zwcxv8QoPdR5eflhtSolAOGN4r9QisO00pU cipGVre456uDG5YgV+cy49xUW+7kZtCImApJDHfrk8XF3DGWnXwiM+yyxdBnpeEt9CSQ 9b9rUCkluZdnoiXBD/4PJZt/Mp9f3dF9itCLfYUKXMoTXx4Qh2R0DKPJlupvyYt/P1mt avyVsGS72JxWJp4Ur7JG6cv9ykswCgVu8n/ZUncyzxqcX98/44Bx2huhRPobTwBAY56V 0u3ITSJ2QmrLuBS2GNSMOgbfnobbE/cdsXYhweN11MKQoYc0ibPbN9CRA2/ONjkODnc2 lbWw== 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 126si894299qkh.155.2018.12.14.03.11.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 03:11:13 -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-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A5AFB8B10A; Fri, 14 Dec 2018 11:11:12 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-139.ams2.redhat.com [10.36.117.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5356017C6F; Fri, 14 Dec 2018 11:11:07 +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 v1 7/9] arm64: kdump: No need to mark crashkernel pages manually PG_reserved Date: Fri, 14 Dec 2018 12:10:12 +0100 Message-Id: <20181214111014.15672-8-david@redhat.com> In-Reply-To: <20181214111014.15672-1-david@redhat.com> References: <20181214111014.15672-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 14 Dec 2018 11:11:13 +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 Signed-off-by: David Hildenbrand --- 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 a8f2e4792ef9..9dcfa809b7ab 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 Fri Dec 14 11:10:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10730887 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 3194314E2 for ; Fri, 14 Dec 2018 11:11:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FE6B2D418 for ; Fri, 14 Dec 2018 11:11:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 147142D424; Fri, 14 Dec 2018 11:11:25 +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 7CF9C2D41E for ; Fri, 14 Dec 2018 11:11:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6F3D98E01D2; Fri, 14 Dec 2018 06:11:23 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 67CFF8E01D1; Fri, 14 Dec 2018 06:11:23 -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 56CF28E01D2; Fri, 14 Dec 2018 06:11:23 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by kanga.kvack.org (Postfix) with ESMTP id 26DE38E01D1 for ; Fri, 14 Dec 2018 06:11:23 -0500 (EST) Received: by mail-qk1-f200.google.com with SMTP id b185so4118020qkc.3 for ; Fri, 14 Dec 2018 03:11:23 -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=JiqJ9c4cz7mLwgXSY/Bkq6+kdyzTyR1dwoyxY85nZso=; b=QKPU40RVMOqOKdNCEdbk/z4LrgTUHTXGUxBAmgiLzO0qhyXfAxkkk9SuGNEd/qjTE7 Tf5ri3cTNNC5/L7ImuJFgPpizrS5ALNlunkBwbcvrbu2hgEvgoJ8G7UZNcYe/ywIIZvy vlEmriDgB+KcWjyCJZC0xit+yuQCH1/86gw77d0gok4XNLQliIQDGCiualy81T7HCGr1 Z18baa8EG8BvMvd6LQU4S1DZVe9Mo4TgduM8SG3NUUJzeRdX83oPBDmRXFKJ3KlJoRbu jifTtSsTCNlc737HskxREh5aJxyXQgcPmxaIF2QNpgnUO34eHxrgu1Yn4Hw/A9QGdQjf 2p7Q== 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: AA+aEWbsUoddMEJQ5oNdCntXTLaFNw5AeEPlZfGONQlxT7eo4kxP12DS BsRSyUESMDT9Em+niBsDFmyjhOh2Vpx7AeEQuQ0s0TpFAlwDMiXam6it8qOrkJenQVYigjh+bsg AIMnRP8i/jhmxxtdzHIaGRxgCY3hK6dbNp/7QDEm6p1UOphzUzq5quqYnHnH/QoBEfQ== X-Received: by 2002:a37:2bcf:: with SMTP id r76mr2020015qkr.218.1544785882858; Fri, 14 Dec 2018 03:11:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/XPvmKKcibYwQSc79BEBMzPmf2ko9OwQuR9HBD+GQWAwREKUiwCRB0SrNYvoQPYc/sPVNTl X-Received: by 2002:a37:2bcf:: with SMTP id r76mr2019993qkr.218.1544785882188; Fri, 14 Dec 2018 03:11:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544785882; cv=none; d=google.com; s=arc-20160816; b=qf0mrKL9/DIyx0n9mzzxW/Fp0PKjS5QWh5UfGlPWbVYPhIu8FX/QsrvK+abCyQVtKJ xONeAOZMQhEqhqK+/CZnPWEue1mAquy4tSLKU3bO6nm5iVFps0tdIrVEgFO2YpMP1Lf/ cGTZuRLjHczrfk2MkDi90d8U+0DPGlmRawoB0SGhxpvOu/XnhOw+3jALNx5SeH8f8mWJ Hn3mDyRZNDeFURwttDxRMzjupu9tHzNYbQzlDeesCPcq+P0H/Avi3JxOcjUxjxeslenr UwYBdUogxFdkesoqg2oI8fu3apx4yqc+hbOWfpEv5IZOem4BitNBc82Y1d3JtDfy6laQ 5sLQ== 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=JiqJ9c4cz7mLwgXSY/Bkq6+kdyzTyR1dwoyxY85nZso=; b=OyIUrcexjjBUJMEqVfN3ROZ6WDEW9V4ZKNXnBjwq/pAewmX2nC3xRTBqFGjjRklbRy pLgi6IvDUdNYbJDLg/GCU99TvdGs4tBuYOq47kBwRYxxq7b/n8a58AnVhuu/HVZtp0Kl n00K8dEuuEFNLxab6ng7OQcpoVUsvpoeYn0wSc7NlFVzbzN9mpEVTYTajV8i+/21quLU IKuIc5Gki1Hy0iliZnCJMI42OFWsj2xxc+Di8aFPqIu0DxsTIY5H6UWDFSd0W5G+FN9Y RsZelSrmNuNBqQpuTdSr3un8chuFtJaJHbPEGISh+COjOCHaBVuCj4Y6B/p0FSn3EITt a8zw== 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 x54si2813206qtx.347.2018.12.14.03.11.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 03:11:22 -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-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 03073307CDFE; Fri, 14 Dec 2018 11:11:21 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-139.ams2.redhat.com [10.36.117.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id F18FD61295; Fri, 14 Dec 2018 11:11:12 +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 v1 8/9] ia64: perfmon: Don't mark buffer pages as PG_reserved Date: Fri, 14 Dec 2018 12:10:13 +0100 Message-Id: <20181214111014.15672-9-david@redhat.com> In-Reply-To: <20181214111014.15672-1-david@redhat.com> References: <20181214111014.15672-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 14 Dec 2018 11:11:21 +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 a9d4dc6c0427..e1b9287dc455 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) { @@ -817,44 +806,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) { @@ -1499,7 +1450,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; @@ -2138,7 +2089,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 @@ -2267,10 +2218,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; @@ -2347,7 +2296,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 Fri Dec 14 11:10:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10730891 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 B791014E2 for ; Fri, 14 Dec 2018 11:11:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A89C22D423 for ; Fri, 14 Dec 2018 11:11:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9CCF92D41D; Fri, 14 Dec 2018 11:11:31 +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 E35EF2D425 for ; Fri, 14 Dec 2018 11:11:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CC1AD8E01D3; Fri, 14 Dec 2018 06:11:29 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C498D8E01D1; Fri, 14 Dec 2018 06:11:29 -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 B11E48E01D3; Fri, 14 Dec 2018 06:11:29 -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 81D1A8E01D1 for ; Fri, 14 Dec 2018 06:11:29 -0500 (EST) Received: by mail-qt1-f198.google.com with SMTP id n50so4636901qtb.9 for ; Fri, 14 Dec 2018 03:11:29 -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=nWpD9N9Op5IxxAm08dl6DsWoy24QNA2ma1Pd8FjhpwY=; b=YBJD2mWCRzWrFc51OVP3XoaoXMTbdN7NQQgaICfOIYTGUCDKnDWeQGjgQM3/1MZy+8 53IY79RhO6fK+Vp8UzMLeS1fWzB7xcbvYIzWMEI1fYuEI1XFBgxpN//s0F7LVJSeKIpg DlQfeYj9RXBQTweMD7nYrxS4mk96lhzzs1tH7FpL3KjPziVaXzHWakmvUwmEPAtTLxI4 xtf6f7AvunBvrl5NH9sxkU1iDzFRJbEw0bQzJMYVi4wcPIXRKJxXNCNXxV0o8bpSiNau CJ6qNZNSszda/rTJ/Y9o6op65hdNTzgAS/DMs7QjUoH0IUZq1TdUpTEglg9N7hAEC3md q3ag== 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: AA+aEWY/XAmMCaQuaC3EXsNSMSPItWzk4mradD+8VpmWU2RIKdWfppMd fyQ9NaLkF0jZk6XNmKi3Grdt58JpzPId9jWcK4tyOBW444iPV/9KkSVOVSYcSI5ub+hhgQyjQFi O/y6rXm694tvFzwxOv9VpP/rRIVR/p5xAzCUHeBbd35xAUjjDf5igicNKIgjhdp5efw== X-Received: by 2002:a37:358d:: with SMTP id c135mr2006154qka.232.1544785889251; Fri, 14 Dec 2018 03:11:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/VbmW2mr/blmaQ6fEcPZDdLw6CKtBcnmEGLcY8RxGfUvpaaE6/uui/Mo9r26kS8+vk6scXs X-Received: by 2002:a37:358d:: with SMTP id c135mr2006111qka.232.1544785888452; Fri, 14 Dec 2018 03:11:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544785888; cv=none; d=google.com; s=arc-20160816; b=tZw31LPVzqspLbDM8XsnXowbQFHRazqSNo6CE6ul7/B667uzyIgCs6zYXjgu4SeTqv 71SMYlPkOKJR7CSA1preEqtEwfuoLK+XoXLwO975pfjeF9t+090gFGaRiMES1q0MRiEn A64xuANY7km+IGTdKj9DnJ4peQv9qSL4OWu2J+a3DCa75lh7joSue5y/NeB/5/Eday9z wVNThTUS1lzuslOHPEFsTpFqkdf98cJIN8TDWc0OJxuTUrx3dR4V1GxZUKX4Jd4ucPWE QUlyDjj0jK/0mfUmXar1HHLA70/sCXkPmuSd8JVF4U2bUgAM+F7HO12cTFuEfau94Pr1 cVOQ== 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=nWpD9N9Op5IxxAm08dl6DsWoy24QNA2ma1Pd8FjhpwY=; b=WsaI3BYd9ruBkl1eGrkufD1wKBlnuCThfK/8YIHFjNQlintGykXNtIa76OpIDzGA+B 7G6B6udWx48l6HUC85uq50j2yVD2RDMrFP2yYZhuIAvA1Wqi51RokSDDuOMTMcVDVFt8 FiWnX64tMZLTfll9dqyQ/kiKEZk/R1L1vP5D1zSON6zSmwBhc6fD5VJNhaqHieWAShiK O2LrlFPzyqELDiPX9pvgAltiu/IxE/UZ5ov5Yje2V97HPdetI6orKcEVohbzznEzlQtN IIE1eO75IKrYgE7zFo4t8rRorNQn44+qvQy6L3QsPRHHNW6X/Z0QOaQZd99oIGzoO7SD 7gcA== 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 9si2851024qkv.15.2018.12.14.03.11.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 03:11:28 -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-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4E53487643; Fri, 14 Dec 2018 11:11:27 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-139.ams2.redhat.com [10.36.117.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 49F465DA2A; Fri, 14 Dec 2018 11:11:21 +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 Subject: [PATCH v1 9/9] mm: better document PG_reserved Date: Fri, 14 Dec 2018 12:10:14 +0100 Message-Id: <20181214111014.15672-10-david@redhat.com> In-Reply-To: <20181214111014.15672-1-david@redhat.com> References: <20181214111014.15672-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 14 Dec 2018 11:11:27 +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 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..9de2e941cbd5 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 their 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 vmmap, 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