From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF4E0ECDE5F for ; Mon, 23 Jul 2018 10:48:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5CB4420875 for ; Mon, 23 Jul 2018 10:48:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5CB4420875 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387849AbeGWLt0 (ORCPT ); Mon, 23 Jul 2018 07:49:26 -0400 Received: from mx2.suse.de ([195.135.220.15]:52450 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387778AbeGWLt0 (ORCPT ); Mon, 23 Jul 2018 07:49:26 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 09380AFED; Mon, 23 Jul 2018 10:48:49 +0000 (UTC) Date: Mon, 23 Jul 2018 12:48:47 +0200 From: Michal Hocko To: David Hildenbrand Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Vlastimil Babka , "Kirill A. Shutemov" , Matthew Wilcox , Greg Kroah-Hartman , Huang Ying , Pavel Tatashin , Miles Chen , Dave Young , Baoquan He , =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , Petr Tesarik Subject: Re: [PATCH v1 1/2] mm: clarify semantics of reserved pages Message-ID: <20180723104847.GB31229@dhcp22.suse.cz> References: <20180720123422.10127-1-david@redhat.com> <20180720123422.10127-2-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180720123422.10127-2-david@redhat.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 20-07-18 14:34:21, David Hildenbrand wrote: > The reserved bit once was used to hinder pages from getting swapped. While > this still works, Does it? There is no single PageReserved check in the reclaim path. I have no idea when we stopped checking but it must be loooong ago. > 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 Anyway Acked-by: Michal Hocko for this change > --- > 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 > -- > 2.17.1 > -- Michal Hocko SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by kanga.kvack.org (Postfix) with ESMTP id DF23A6B0008 for ; Mon, 23 Jul 2018 06:48:52 -0400 (EDT) Received: by mail-pf1-f197.google.com with SMTP id c23-v6so14242pfi.3 for ; Mon, 23 Jul 2018 03:48:52 -0700 (PDT) Received: from mx1.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id d19-v6si9470740pfm.226.2018.07.23.03.48.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jul 2018 03:48:51 -0700 (PDT) Date: Mon, 23 Jul 2018 12:48:47 +0200 From: Michal Hocko Subject: Re: [PATCH v1 1/2] mm: clarify semantics of reserved pages Message-ID: <20180723104847.GB31229@dhcp22.suse.cz> References: <20180720123422.10127-1-david@redhat.com> <20180720123422.10127-2-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180720123422.10127-2-david@redhat.com> Sender: owner-linux-mm@kvack.org List-ID: To: David Hildenbrand Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Vlastimil Babka , "Kirill A. Shutemov" , Matthew Wilcox , Greg Kroah-Hartman , Huang Ying , Pavel Tatashin , Miles Chen , Dave Young , Baoquan He , =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , Petr Tesarik On Fri 20-07-18 14:34:21, David Hildenbrand wrote: > The reserved bit once was used to hinder pages from getting swapped. While > this still works, Does it? There is no single PageReserved check in the reclaim path. I have no idea when we stopped checking but it must be loooong ago. > 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-Andre Lureau" > Cc: Petr Tesarik > Signed-off-by: David Hildenbrand Anyway Acked-by: Michal Hocko for this change > --- > 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 > -- > 2.17.1 > -- Michal Hocko SUSE Labs