From patchwork Fri Jul 20 12:34:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10536961 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E04BD6054B for ; Fri, 20 Jul 2018 12:34:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4A7E294DD for ; Fri, 20 Jul 2018 12:34:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C83B9296C2; Fri, 20 Jul 2018 12:34: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=unavailable 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 D100B294DD for ; Fri, 20 Jul 2018 12:34:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B2E4D6B026D; Fri, 20 Jul 2018 08:34:39 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id ADDF56B026E; Fri, 20 Jul 2018 08:34:39 -0400 (EDT) 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 9A7386B0270; Fri, 20 Jul 2018 08:34:39 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk0-f200.google.com (mail-qk0-f200.google.com [209.85.220.200]) by kanga.kvack.org (Postfix) with ESMTP id 6F3176B026E for ; Fri, 20 Jul 2018 08:34:39 -0400 (EDT) Received: by mail-qk0-f200.google.com with SMTP id c27-v6so9275131qkj.3 for ; Fri, 20 Jul 2018 05:34:39 -0700 (PDT) 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:mime-version :content-transfer-encoding; bh=RDqIv2lxzlu+wuc77It9uJCeIY51o8V3B2YfQy5G6n0=; b=lgK8+qt5ZPhrwb2v2R2eOOuyDx551KWLR82iYt3E6zcruuVk/cz3EhBg6ZzzOOOnkh G5ZPFvvBnKL0YMSn67gwRX/1a97FqRYp9SgSj9zlKmgJV1j5nIBgZMiuy/m+U3tUyDHV z4F/58B9Me5ov1cz+Dd9r+eVPjxKvfipDEfYgS8HQQVBHL9k4W4zPvoP2BdWPU/+5+aH wIVSemai1BOK04FXtDGqKc4qsyh1VnAtAUpCl8aB4w+E2Y/8k1sjQ/EJzDJ/NrUfrftd cCm1o6qPkV9Rl8lT+1M4aCgipg7gYwUE/c+RqQZBDr0rAnkO6yiiw0fxxSyp0GU9O8OF IT8Q== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: AOUpUlE6usPLgeZlvGIoi+CB1QouagKwk7fppp28fQTu0afcYbUqo5c9 0EpfH9rPrQ8+zvpcpyy4AjWk9mdBoAzqzOCbXJOPjM3rj5JKBHqd9BmZeVs2KaHdPJB61lb29wF mlcreaFayd471XCF9eiWc1SB+fjPXm7bSum8T1fKzffos3vD9JV2226DbyjXWyLKf6A== X-Received: by 2002:a0c:9351:: with SMTP id e17-v6mr1529705qve.4.1532090079249; Fri, 20 Jul 2018 05:34:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeyWXC2All/ULgdfKD+Vaaa1L056rxWFdqzB8coNF2hGHejvJ65O61L2vmzJvHxSkS9ch4h X-Received: by 2002:a0c:9351:: with SMTP id e17-v6mr1529682qve.4.1532090078730; Fri, 20 Jul 2018 05:34:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532090078; cv=none; d=google.com; s=arc-20160816; b=U/QQ7Q2OeOYm/FTUWaB/l9cU5pOLd8/Vwo5bsClyP3DpFIqOurrbU0T+/tX3jVi11m Pc5auZiT9dpgLRr3OjDS3t0uoCzZYd00iYr2LW/zH7Rv2NW3tPSKLjeBogMKo/iFviBz d0ffqE5wKSq6+OYEVYUAxrNi/EQJ4YBjqCI8LdH/sxJylpwdDeBReXNfqYehrS6Va8sK TE95RzTcAtSS1Dg6A1SVENG82+IF2aH48A2lGOcbR2rhy+xeJCn2YU1n8XWY8mJQlBpQ eQZUURPvBwVqeCkyvtiThQ6ARWy1adQ8fDXS76X36KvnAWq02vzKmRvmxJ1e0ULJZzgd p7+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=RDqIv2lxzlu+wuc77It9uJCeIY51o8V3B2YfQy5G6n0=; b=ReYdw147tND/WNKSLUY97UQQNVMltbQNIGeJ6nusB3C1gYDdjN+E40wRvCn0MvVA+s CgqD+B9BUntyLXyLaYGIWZV9evUIT5YS5Y2Uuh+lm694lYw1tUh/wiaw7EVR7oHSp6P/ cQ/nZL7mXK62RR3tyBWKA6VEUw9pNC0uhwDhUScnQ58RtF+0w41Lj6l2MdEnIueka7tG XCOCix3uZ+hulfj3HB3f23/aS1d45tmcKyHaKWDQm0Hy9PX6Oo6TxNNqPP6SRSezIaC9 hfHasJCxm/69ZvJ122uI3ou09LlVugg5QDz1K9r0WVwDvdEQC7KCsIi1xDTu1Hhc+97/ T5iA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 66.187.233.73 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 (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id e123-v6si1702869qkf.88.2018.07.20.05.34.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Jul 2018 05:34:38 -0700 (PDT) Received-SPF: pass (google.com: domain of david@redhat.com designates 66.187.233.73 as permitted sender) client-ip=66.187.233.73; Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 66.187.233.73 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-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3D66A40704BB; Fri, 20 Jul 2018 12:34:38 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 061CE111AF1D; Fri, 20 Jul 2018 12:34:34 +0000 (UTC) From: David Hildenbrand To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, David Hildenbrand , Andrew Morton , Michal Hocko , Vlastimil Babka , "Kirill A. Shutemov" , Matthew Wilcox , Greg Kroah-Hartman , Huang Ying , Pavel Tatashin , Miles Chen , Dave Young , Baoquan He , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Petr Tesarik Subject: [PATCH v1 1/2] mm: clarify semantics of reserved pages Date: Fri, 20 Jul 2018 14:34:21 +0200 Message-Id: <20180720123422.10127-2-david@redhat.com> In-Reply-To: <20180720123422.10127-1-david@redhat.com> References: <20180720123422.10127-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 20 Jul 2018 12:34:38 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 20 Jul 2018 12:34:38 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' 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 reserved bit once was used to hinder pages from getting swapped. While this still works, the semantics are a little bit stronger nowadays: The page should never be touched by anybody in the system except by the owner. The original comment already gave a hint about that. So especially, these pages should also not be dumped by dumping tools. Let's make that more clear by updating the comment. This will be useful especially in the future in virtual environments where pages marked with the reserved bit might no longer be accessible. Cc: Andrew Morton Cc: Michal Hocko Cc: Vlastimil Babka Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Greg Kroah-Hartman Cc: David Hildenbrand Cc: Huang Ying Cc: Pavel Tatashin Cc: Miles Chen Cc: Dave Young Cc: Baoquan He Cc: "Marc-André Lureau" Cc: Petr Tesarik Signed-off-by: David Hildenbrand Acked-by: Michal Hocko --- include/linux/page-flags.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 901943e4754b..ba81e11a868c 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -17,8 +17,8 @@ /* * 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, which should never be touched (read/ + * write) by anybody except their owner. Some of them might not even exist. * * 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