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=-13.2 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 9A92DC433B4 for ; Thu, 8 Apr 2021 21:33:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2DDAC610E7 for ; Thu, 8 Apr 2021 21:33:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2DDAC610E7 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 792586B0036; Thu, 8 Apr 2021 17:33:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7425D6B006C; Thu, 8 Apr 2021 17:33:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5BB126B006E; Thu, 8 Apr 2021 17:33:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0055.hostedemail.com [216.40.44.55]) by kanga.kvack.org (Postfix) with ESMTP id 3CA0A6B0036 for ; Thu, 8 Apr 2021 17:33:57 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id EF59898B6 for ; Thu, 8 Apr 2021 21:33:56 +0000 (UTC) X-FDA: 78010502472.23.C1DCC15 Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by imf03.hostedemail.com (Postfix) with ESMTP id 26A16C0007D4 for ; Thu, 8 Apr 2021 21:33:54 +0000 (UTC) Received: by mail-lf1-f46.google.com with SMTP id g8so6338499lfv.12 for ; Thu, 08 Apr 2021 14:33:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/GAe8cx+DQ36uj87QfK1vmv5DX5/MYkySxpHobTWigs=; b=buFszRZOuSOOHiCnsBeGh/08c/C+zmSQGyphU2zQcqRoVaJuOYygfJPPpm4d/nej2M EW2bmaG2cKotYl40dL9/3GqcDhwL25KPO1/EngaDxBaS8cmfDt0DP45PRxuvwd2nj4bB zMwOM96Slk9BYpOHMC7JOSW/EuhFs1OYJsRMW8LZt+wmCt4Sh3+F6sW5imaAzQWzuZ32 0tuahzhSw8N/D5JCkcb1+Y+jeOAv3I01EoGNc+fWoJvFNAwCR803rbIZPUIIuesXeCFd H/hZN+/haSEjydOcEGIjaYOm2utYx9XT8iU0BCRTaiV4QJa6ZWoFX9k303vKToG1u248 LmRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/GAe8cx+DQ36uj87QfK1vmv5DX5/MYkySxpHobTWigs=; b=TELwqWauP9n29a82wfEVTooIT7rKT9o8hJ2vMwtF3zSEBSCfpkqlp2hWvPPUg0Fga4 +W/7xJJrRXIqa3kGkS20OjtqcpboEVL668Z6GTOdL7t2A5g386wV/fHTj8E9ZOzgK969 bNbhi54ugJNd29QQJ5dOssAsLR0bpp4FeFMYGpM6c71obptN9RdRWi1/Q6bHyQJrt0Ds fifuuTdfwawrNnZ7/Q2jl0v8BzXMPjF6ax31hyS7C7SdFJOVsRDFgalLvcnGg1nJAncj AfE9/Tyvnj9lvILbljIKL/rguaEDQUId2Viv0fwqUhxQnj3z9llymxrT3ofDPimoJKQL zzBw== X-Gm-Message-State: AOAM530QKLTH4M3z3Gj5w8rj3oisH2wtJ8FEHk+IR5PfldZQiiSGmd/6 JnyeS77hnwpIKKzD3aDsPE4ARKJOWq4gNttMke9Ahw== X-Google-Smtp-Source: ABdhPJwINlgQ/Bd3f8BKg30apChWFa6cxVJNyiqM/fRLcKw2d6BG3B72xp75asvLGchFbFzl6IcZrDZjLeXJiadZ8ds= X-Received: by 2002:a05:6512:c04:: with SMTP id z4mr8234032lfu.299.1617917634901; Thu, 08 Apr 2021 14:33:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Shakeel Butt Date: Thu, 8 Apr 2021 14:33:43 -0700 Message-ID: Subject: Re: [RFC bpf-next 0/1] bpf: Add page cache iterator To: Daniel Xu Cc: bpf , linux-fsdevel , Linux MM , LKML , Kernel Team , jolsa@kernel.org, Johannes Weiner , Yonghong Song Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: 93jt7aatqatfoxy9xtwfgu19ar1swidt X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 26A16C0007D4 Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf03; identity=mailfrom; envelope-from=""; helo=mail-lf1-f46.google.com; client-ip=209.85.167.46 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617917634-589628 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 Wed, Apr 7, 2021 at 2:47 PM 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 ... > * etc. > So, you need the list of inodes for a filesystem that are in memory. With that list, you can open, map and do mincore on them? I don't know of a way to get that inode list. > 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. > Oh you want to share page cache between different containers/jobs? That would complicate charging.