Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp947730pxf; Thu, 8 Apr 2021 17:27:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4vWMWlSZPM+xTmW5wmKxhgXzran8pe71pLValRU+Ot4n4Rqz6UY9mp3Jj2yT8sz7mmOK5 X-Received: by 2002:a17:907:20e9:: with SMTP id rh9mr13805656ejb.523.1617928072155; Thu, 08 Apr 2021 17:27:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617928072; cv=none; d=google.com; s=arc-20160816; b=w8yER3p5+ovYQ98XEpBP5QQM2ikfovXpuTeQ+kvVAzjsTfKTBCGDrvJOE+a9eVHT1X slzvzWvZei2WWzIVa0VZ6cpCjg6JyWf96U7Q4TG/XUtqCLc4iBmi8wGG3uWva0riK7fU 4c0IAM9QY88aW6pVjYSosWR8GSLQ5gJPmIR/eT4PLG99SPnTkYAzzzcYUzJY0KlDUal7 nn05LJHbrTRxRIn5g3+Jub4hhnnuG2ePf2uUsKMbTNXpR6nGwIBud3UOb8PHjiYCejy0 g4NU82ccAaVn8rnmkQ5mdgIsv5Q97kSu+g7LPZyQE4U2JzoU3TaAcQ10lBAY5XjSIP6k ZxKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=DwizxYbUSZgbLHoS13O2SZRiI4keD3ogjhL/PTu6gv8=; b=BhdTr6G7M1ylQygTa6MmRe3Xu/4Qvd+YOsiCT8dwMZa4pkUF7373WIYBfbZmxMri46 Kiyot6JqyZYURVZyHXrfY5OJUuShO8x1MwS+429nbohe1Ov13sK4FZf8ni1UY5gXGSP8 pPrGvBf5hI1aCujX62O25de5VVD42IuCmpHF6fJX1dxbiRcgF/0t6oMIBnENXN8w1SiW GBJw9MoEW2NMCXee4pbrnChQKq7dkfu2QOWA+XQcQ41Cq32W1chnABAcUnN3rDHwfcqc eee9YQ6sdJy7VxYUcUbdc54GJACVCsYMo/Bv4tDoip0Q345fkn3LtuyqRu6wkrK35XQT DY6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm3 header.b=TdyxN4Ba; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=mKLIG4IN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hs2si794606ejc.566.2021.04.08.17.27.29; Thu, 08 Apr 2021 17:27:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm3 header.b=TdyxN4Ba; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=mKLIG4IN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232984AbhDIAYx (ORCPT + 99 others); Thu, 8 Apr 2021 20:24:53 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:39871 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232488AbhDIAYx (ORCPT ); Thu, 8 Apr 2021 20:24:53 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id DE5B35C00B1; Thu, 8 Apr 2021 20:24:40 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 08 Apr 2021 20:24:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=DwizxYbUSZgbLHoS13O2SZRiI4k eD3ogjhL/PTu6gv8=; b=TdyxN4BaM0HA0AYjUbIQlsNrj6enXIVLSfZ3e4k05Fy 8T0pQ7UqL9dpUIUwaf5Dh46cGvfg5tjqtZ8P6wPMeb1bTcvlTO2+X12hX/8E9fWR pyI6KBWHr1CSsS9JYGXsjHG35z5KQxXYCekFP8qvi7HeY2BZ1LohR1s0/IFmcZsB dovPxMul0lPSEsyR+NVeEwAlh88X9i0JM2LkK+ms6GPXL4xE5czff363tn+JqsCT 36wowZM6joLA2dkkH2958Q/jNh7YE+givMDMNzWJ8FVbq7ol/lBUsW3f7bpQ7l9t CXmczAiry/JXC8exc4RNMdk6SsXTQ7uzKEBZsf0Kk4Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=DwizxY bUSZgbLHoS13O2SZRiI4keD3ogjhL/PTu6gv8=; b=mKLIG4INCz2rV0Ot2SXu02 OUT7xlwNKfQhzlG0NgGHBmh5n+WBR51fUg9j/Uxp89FBoZ3IEpAOmnuhd4DT/gZz 6d1TovYyLI/SA2akboyiIPY3qMseU5Vbj/2P09fdHgdLisTYillWKLxhCSFfIg7g XYjdmD+qTl5dZRdjTBOEJ/siBWUpl3woUhIzid86oxeyQuQiuhb6cynOqU1ajYyV gt3l+/a6z2zOXzdW26VJiiWgKlNtPKQNVd7bIS69XBbpFjytScJUdzFsuuMpcUth mdi84YweLOFvrIf6UPz0zK8PDgTIKa/EYVRztaID5pSJpFORkqoItTyWFT4Clupg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudektddgfedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesthdtredttddt vdenucfhrhhomhepffgrnhhivghlucgiuhcuoegugihusegugihuuhhurdighiiiqeenuc ggtffrrghtthgvrhhnpeeuuddvjeefffelgfeuveehfeegfeetfeetueduudfhudfhheev leetveduleehjeenucfkphepudeifedruddugedrudefvddrudenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegugihusegugihuuhhurdighiii X-ME-Proxy: Received: from dlxu-fedora-R90QNFJV (unknown [163.114.132.1]) by mail.messagingengine.com (Postfix) with ESMTPA id 761B724005E; Thu, 8 Apr 2021 20:24:38 -0400 (EDT) Date: Thu, 8 Apr 2021 17:24:36 -0700 From: Daniel Xu To: "Darrick J. Wong" Cc: bpf@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, jolsa@kernel.org, hannes@cmpxchg.org, yhs@fb.com Subject: Re: [RFC bpf-next 0/1] bpf: Add page cache iterator Message-ID: <20210409002436.d4kpn6djrnecv2et@dlxu-fedora-R90QNFJV> References: <20210408231332.GH22094@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210408231332.GH22094@magnolia> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 08, 2021 at 04:13:32PM -0700, Darrick J. Wong wrote: > On Wed, Apr 07, 2021 at 02:46:10PM -0700, Daniel Xu wrote: > > There currently does not exist a way to answer the question: "What is in > > the page cache?". There are various heuristics and counters but nothing > > that can tell you anything like: > > > > * 3M from /home/dxu/foo.txt > > * 5K from ... > > 5K? That's an extraordinary Weird Machine(tm). Just typing random numbers :) > > * etc. > > > > The answer to the question is particularly useful in the stacked > > container world. Stacked containers implies multiple containers are run > > on the same physical host. Memory is precious resource on some (if not > > most) of these systems. On these systems, it's useful to know how much > > duplicated data is in the page cache. Once you know the answer, you can > > do something about it. One possible technique would be bind mount common > > items from the root host into each container. > > Um, are you describing a system that uses BPF to deduplicating the page > cache by using bind mounts? Can the containers scribble on these files > and thereby mess up the other containers? What happens if the container > wants to update itself and clobbers the root host's copy instead? How > do you deal with a software update process failing because the root host > fights back against the container trying to change its files? No, the BPF progs are not intended to modify the pages. This is just for read only observability. > Also, I thought we weren't supposed to share resources across security > boundaries anymore? I can't speak to this, but bpf progs can pretty much be attached to anywhere so this iterator doesn't expose anything new. <...> Thanks, Daniel