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=-4.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT autolearn=unavailable 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 3220DC04EBF for ; Wed, 5 Dec 2018 14:35:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F222F20850 for ; Wed, 5 Dec 2018 14:35:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QKhkhpvM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F222F20850 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LOnRbr+C78oaSt2WQYiKSvJcRlDhPjdxhe67qEuL9ew=; b=QKhkhpvMbAkfCz E03kf1PKIaN2ww8YUK7RnL79oe+nWQXltNlT264nS3J6pm6+ob1Aw5NJTRBXe+aqIuR1fDPXBp1/t zZ5tKV9QRWF3fHHmMleT7iRPJ16Db+YknvVTLqxL/jPlc7NwBleCGfJZbAwUJBekjxVYiw6Ge6vZx MLYvHPk6ZbHAsuMXTFA95TPzVUEAt3xp6wFwm16ceumM9hw2CioZnPY/FmPeVcDZOXELWj9laWGfm rM6c1P5IbK9Lqi1zwGwGvXdHBUMgp/BxQ5x4BhA2nGCT1ATdcDY+R4EVerENt0zRq2D6arS62G+jW JiU9fI60T73kmGBsc31g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gUYGn-0003iS-G6; Wed, 05 Dec 2018 14:35:21 +0000 Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gUYGc-0003YG-8t; Wed, 05 Dec 2018 14:35:10 +0000 Date: Wed, 5 Dec 2018 06:35:10 -0800 From: Matthew Wilcox To: David Hildenbrand Subject: Re: [PATCH RFC 7/7] mm: better document PG_reserved Message-ID: <20181205143510.GA17232@bombadil.infradead.org> References: <20181205122851.5891-1-david@redhat.com> <20181205122851.5891-8-david@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20181205122851.5891-8-david@redhat.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-s390@vger.kernel.org, Michal Hocko , yi.z.zhang@linux.intel.com, Stephen Rothwell , Alexander Duyck , Dan Williams , linux-kernel@vger.kernel.org, Pavel Tatashin , linux-mm@kvack.org, linux-m68k@lists.linux-m68k.org, linux-mediatek@lists.infradead.org, Miles Chen , Anthony Yznaga , linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Andrew Morton , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org On Wed, Dec 05, 2018 at 01:28:51PM +0100, David Hildenbrand wrote: > I don't see a reason why we have to document "Some of them might not even > exist". If there is a user, we should document it. E.g. for balloon > drivers we now use PG_offline to indicate that a page might currently > not be backed by memory in the hypervisor. And that is independent from > PG_reserved. I think you're confused by the meaning of "some of them might not even exist". What this means is that there might not be memory there; maybe writes to that memory will be discarded, or maybe they'll cause a machine check. Maybe reads will return ~0, or 0, or cause a machine check. We just don't know what's there, and we shouldn't try touching the memory. > +++ b/include/linux/page-flags.h > @@ -17,8 +17,22 @@ > /* > * 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: > + * - Kernel image (including vDSO) and similar (e.g. BIOS, initrd) > + * - Pages allocated early during boot (bootmem, memblock) > + * - Zero pages > + * - Pages that have been associated with a zone but are not available for > + * the page allocator (e.g. excluded via online_page_callback()) > + * - Pages to exclude from the hibernation image (e.g. loaded kexec images) > + * - MMIO pages (communicate with a device, special caching strategy needed) > + * - MCA pages on ia64 (pages with memory errors) > + * - Device memory (e.g. PMEM, DAX, HMM) > + * 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). Consequently, PG_reserved for a page mapped into > + * user space can indicate the zero page, the vDSO, MMIO pages or device memory. So maybe just add one more option to the list. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv