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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 EDD8CC433DB for ; Fri, 12 Mar 2021 23:01:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 04E0E64F6C for ; Fri, 12 Mar 2021 23:01:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 04E0E64F6C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4773E6B006C; Fri, 12 Mar 2021 18:01:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3FFAF6B006E; Fri, 12 Mar 2021 18:01:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A0C36B0070; Fri, 12 Mar 2021 18:01:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0244.hostedemail.com [216.40.44.244]) by kanga.kvack.org (Postfix) with ESMTP id 09E376B006C for ; Fri, 12 Mar 2021 18:01:58 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 9FF2DAF6A for ; Fri, 12 Mar 2021 23:01:57 +0000 (UTC) X-FDA: 77912746674.15.600E909 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf20.hostedemail.com (Postfix) with ESMTP id F3741279DCD for ; Fri, 12 Mar 2021 22:45:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=GZKbr3Ktzl6rDngonKrO9HP2rFVJ7e6YnYE1/31woXo=; b=mFjq8YmHSU+CUfLOZDdQ3twnnu fsOE4kKAd8zvX/kG48qBrkuyJ9s/W2f+un9JSjHdqvohh0uRaCiWdVbrD2Ya/rsWjYFe+PHBD8YKb gk8eWetNINV1VZSi49jBES/GXQMmCcR8aWpvFVnY3XM9qg0Igh/XsO1VW0JCz9r3S5+uuchegb1vw JcxthV9RCs2Kur1qnQQT1DK3vWRXEo1pmGyFO8UY5i8mGV3wn0zpfGpvp7Z+6DB73nzgCFornYppl U91yedj7bgQvD/vGQDuEpV9eWbzqCLOBYoEH2qd2bGE0ji1Z+6FXOVyMck1SvCGRWFvk9IjvMH0us bE7PkJvA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lKqXK-00C1GV-0v; Fri, 12 Mar 2021 22:45:39 +0000 Date: Fri, 12 Mar 2021 22:45:37 +0000 From: Matthew Wilcox To: Peter Weber Cc: linux-mm@kvack.org Subject: Re: Is anonymous memory part of the page cache on Linux? Message-ID: <20210312224537.GF2577561@casper.infradead.org> References: <20210312151540.GC2577561@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: q7cos63cyhacje1sq8qreadydbir4ogy X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: F3741279DCD Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf20; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615589145-978933 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: On Fri, Mar 12, 2021 at 04:41:55PM +0100, Peter Weber wrote: > Thank you Matthew! > > > Am 2021-03-12 16:15, schrieb Matthew Wilcox: > > The wikipedia diagram is wrong. Anonymous memory is not handled by the > > page cache. > > Is it roughly right to say, that the virtual memory uses page tables to > handle anonymous memory? I tend to deal with page cache and not anonymous memory, so I'm not sure exactly how someone who's an expert would phrase it. Anonymous pages are "handled" in a number of different ways -- they can be found on LRU lists and they can be found through the page tables. It's all a bit ad-hoc as far as I can tell ;-) > > Anonymous pages enter the storage stack via swap; they are > > found in the page tables, sent to the swap cache and then written to > > swap devices or swap files. Filesystems may get involved at that point, > > but not always. > > And the page cache doesn't handle anonymous memory - even when it is > swapped? Right. There's a swap cache, but that's not the same thing as the page cache. > > There are other weird things in the wikipedia diagram, like Direct I/O > > being seemingly detached from applications, and not appearing to pass > > through the VFS. > > I'm not an expert. Maybe I should add at least note about that on Wikipedia? Maybe!