Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1456544imm; Thu, 19 Jul 2018 01:52:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdNvgroHN8YOA3ya31B4Xmg7ad6uLwINuVfaBqLVC6zXCMn5tLmoNfAeykmJtRWWIy1Nq0b X-Received: by 2002:a63:5f50:: with SMTP id t77-v6mr8634867pgb.300.1531990321463; Thu, 19 Jul 2018 01:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531990321; cv=none; d=google.com; s=arc-20160816; b=XiIK9CqQd0FFuDPytyW86tTBMVxQrypJ7ML1CbCK9xguf53bjcp8paaozlsW7TUDTc MbBDZ8qPrYC8urZ4Rwp5HaqWj2zsjj1yL4+HFjtkGbLFMTsoU7OnNJW6GcdH8kzpatXv 6/OFDZsItP/YHKaM794t3p28QffN1FgjOXRNITyR4Y6vpnOpD/b+JXzhg5SDPYVGhohB 2EdfI3eV4peXBRYc64MSSSo9663JBt1+q/fIb1dBOw7ZzduvsrxiQSnIc/+9+V7vQ1v0 NoKI+sJWUOXhWZH614wBO2E9F8t3YcDgygRhQT+4rDoCV6v2vQIOQ4nBH2piZki8Pqjm 2H4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=nfU7/8mZ+eGxqb06bFfTcDPB3lCODjSFRa2YZiCP82I=; b=Hb4JtiXFCz46PE6jm2J3DGooDbSlZ/utVOzhqkB7to6nKeInXilgHC0zQ0pPKqriDx OHTurO64revoGud9OnyKV3fTU7+J65xUJcuT9MsEFy9HGJlugs7OTHb3OTi6/KU0OgsY H9sNw2lEY2Iba7GTHICql5etugzY483xPBHHOxzVKjezgGFKH6zCyuYDWSMh02KNES/E QiT8wwZbkGJcJi4hGQY6TpVzKI3KeOvZKbLujP+MUzlrLRs7L4qiiEF2bof5M3x4ZOEM vg4Dfqj+6xWvWIJ2XsAgQId3uussqTbjYLlJoJ3VkkubsSQ+7huU4ahd4uFQ3/ZQxT9z RpBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=Z7ziaxwO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x4-v6si4902634pln.487.2018.07.19.01.51.46; Thu, 19 Jul 2018 01:52:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=Z7ziaxwO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731046AbeGSJcH (ORCPT + 99 others); Thu, 19 Jul 2018 05:32:07 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:34540 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726462AbeGSJcH (ORCPT ); Thu, 19 Jul 2018 05:32:07 -0400 Received: by mail-oi0-f68.google.com with SMTP id 13-v6so14146840ois.1 for ; Thu, 19 Jul 2018 01:50:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nfU7/8mZ+eGxqb06bFfTcDPB3lCODjSFRa2YZiCP82I=; b=Z7ziaxwOg5emIKpTT3ykZ4tjs5N9fyA7LGGx1RKm9PZ+gQcEDZoHS8UGpwwhenFFMs tThBrERhFWgjWQemZB0XyUVQ0e/4kJIOuUXg+jjBkd9BLGPPbYqmUoYIrjO/3tEjZFvS wFiMdKZq0OEAauxKfblxf0MjPiLNokY35YSI8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=nfU7/8mZ+eGxqb06bFfTcDPB3lCODjSFRa2YZiCP82I=; b=kypUpApsYeg0fDeVHZtCbojxV0NXVzpl+VjEslbYG2MFUn31qjs6eEA2REbUQraK9v 30iZODnQauAlRkrwgRwyukEJd9gKCfdh35FL67CgZHxo0F2B7S/Ja8chTqFkEdBIU5vD ilnnisUw3ETE5oArGyBbk+LhEUMjTvCT0wqyqdEZ31lnkMFa4KIYZUbftcoX2G3qKzst cG64QOipJPOrEDcO9geZmIMbdeOebXkEJQItfzpYYtHzz3CSVZbMZpr49KO1taG6+iE6 BQ29oalyTwMU4A4wpIw6a3CpDwddPsdYP6rtEKgZ6ZTs/Sz3zBa2vyMS8hYjslEOTxsI uNKg== X-Gm-Message-State: AOUpUlEwxYY3mEOhWGsEhh7AxM08Y3IzFydb72oTDpakDOt/2rPuptB0 kUpDTvAwDYgNxdDNhp8cUATFiPypSDx21sm7/XOxRw== X-Received: by 2002:aca:ce0f:: with SMTP id e15-v6mr10465992oig.13.1531990200360; Thu, 19 Jul 2018 01:50:00 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:113c:0:0:0:0:0 with HTTP; Thu, 19 Jul 2018 01:49:59 -0700 (PDT) X-Originating-IP: [212.96.48.140] In-Reply-To: <18289.1531987758@warthog.procyon.org.uk> References: <20180718154637.31878-1-mszeredi@redhat.com> <18289.1531987758@warthog.procyon.org.uk> From: Miklos Szeredi Date: Thu, 19 Jul 2018 10:49:59 +0200 Message-ID: Subject: Re: [PATCH] vfs: make open_with_fake_path() not contribute to nr_files To: David Howells Cc: Miklos Szeredi , Al Viro , overlayfs , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Christoph Hellwig Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 19, 2018 at 10:09 AM, David Howells wrote: > Miklos Szeredi wrote: > >> Stacking file operations in overlay will store an extra open file for each >> overlay file opened. >> >> The overhead is just that of "struct file" which is about 256bytes, because >> overlay already pins an extra dentry and inode when the file is open, which >> add up to a much larger overhead. >> >> For fear of breaking working setups, don't start accounting the extra file. > > Sounds useful for cachefiles too, though Christoph Hellwig objected strongly > last time I tried this, so you might want to check with him directly. What the cachefiles use case would be? Overlayfs wants the "shadow" file open only as long as the real file is open. Is the cachefiles case the same? For overlays the real cost of pinned memory by open files is already sunk in the layered dentry references. Which means overlayfs is already pinning substantially more memory for an open file than other fs (by about a factor of 2-3, due to pinned lower and/or upper dentries and inodes). If this was a problem in real life, then we'd be already be in trouble. The stacked open file patch only adds the overhead of the actual struct file, which is small compared to the multiple pinned dentry and inode structs. Christoph already commented on a previous version of the patch and I pointed out the above. Thanks, Miklos