Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3349717imm; Mon, 4 Jun 2018 01:57:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJi0ldNhVIJAqcF15oFyt2VdtuZmDjSa/RW8eQE4Z8BlikD1Ua0vNxgSBcTukG7c04aLovR X-Received: by 2002:a17:902:a4:: with SMTP id a33-v6mr20711480pla.346.1528102677511; Mon, 04 Jun 2018 01:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528102677; cv=none; d=google.com; s=arc-20160816; b=eJeyRjQowG4Fu/ZPIBpf0rMOGUt3gjUfgUd13tL5JJJxMkbUwjDoE3zXRioFlwR4It LjSjj30Xym2eMwBCHr8Royj73LQtmuCHhSzHxcVw145pXIGYa/T7Er49E9M1zTJ5xTif f50bB8ng8/dN9kdvzbzxiu1MP3Hby+jXCqP8hADY1eFJv1nDyhpt6oMlUndby2Ey/yj+ A8fzt3kpsWL81LP8UznTkW3aUVRyUMphExzhpzk814vDmytSYP/Sn7mg5BlA/e+DZw3/ NbQodyWUBbtqWyrO4q8jkQkldmg5QoBr8n5jSVj91dNKJv5+4PYsfTuEHy8MFjHqNx5u 8KYA== 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=us+KxjIOeLG5h+/EwpYsXJSD5Mxz+9CyTN0UetkmxlE=; b=XmT6s8hW+WN7M6yVnMTFDQe1s/0hybQ19m6OsUVZIAEUHogdu1EeTxQ6kN7v+b2Xmg 7hgku7WUtqkTIq9J4B5wgE8uDGhthNLUX5WC7L0fJWSmzOctwBBjsuGDeyaKjpOSOjU/ ocp7cPQmMGUkfOluCeeYWch+VlhBSx/3wd9tPunDFGfjurcMFCzdcdSjCf/1DP1VBq51 weICqrUqF87o8h/i9HGEMbtcBoS+BCYj0LXlL6LgYxlrk0iZbbFj1Idpzc6J2oDAcVnF aIDryL6wdBZYIVigdyDxCh4bkiLEvbOjM/v5gLNKAgSFvku0ekyM89H0WV6rsc6xr7Tg wfbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=Ibrt12LT; 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 t186-v6si2200620pgd.41.2018.06.04.01.57.42; Mon, 04 Jun 2018 01:57:57 -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=Ibrt12LT; 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 S1752005AbeFDI5Q (ORCPT + 99 others); Mon, 4 Jun 2018 04:57:16 -0400 Received: from mail-ot0-f196.google.com ([74.125.82.196]:41167 "EHLO mail-ot0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751183AbeFDI5O (ORCPT ); Mon, 4 Jun 2018 04:57:14 -0400 Received: by mail-ot0-f196.google.com with SMTP id t1-v6so36675652oth.8 for ; Mon, 04 Jun 2018 01:57:14 -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=us+KxjIOeLG5h+/EwpYsXJSD5Mxz+9CyTN0UetkmxlE=; b=Ibrt12LTzGXj/8zlU8xms8YMdJ9O3nD8x+FFi2++BV8/VnONElYkkmnJkVo5yO2NiV D6nhdgmIAwdXT8ADfa4E4q+lGbWLFPq5MTniMw01lg6D+aoJioaTjzqQK4M3vgAg3Q4L pyu8Nmtf3NT5QAl4mCtGdLXWc7BC1Lk5O7r+A= 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=us+KxjIOeLG5h+/EwpYsXJSD5Mxz+9CyTN0UetkmxlE=; b=UfFSGUEYSUzDt4OHV1Pq7Jlvx49sIMjqvyHyzCkevnlrtdPFql/4POquo1RugFoJxL LHNaDQ1lzQrD1bPc7nWwGjbz8EYMm2Jl1nDpiFpO2/sQ34okQW7FJQCeWFaCEi88SiIW gTTDs1RkiYjBkOVrM4q3AGcSceVcifjaKKmtWoJ1detXdPTjwM0bVXiXCQjT+wwUEBhp 5eZGLNWzBy61xl82TSd1uBUUhkMfqNsu6EYTqxNqW8Z2tfoTAIMBMMJqFqs8PLJ8zSRv mF6qiPJtPey27guj6Rk2R4gfmAg/jpawle+XcjHlnXD79Md0+y/kan+XyZp3ohfVMmpQ sABg== X-Gm-Message-State: APt69E0KYhFRJTPRuzOTIPazT8wPc2Cd/1tCGLLHeQnMoTT0hvdt/RAg 9H/bBWHKrKF86nGeYGnUgehmJ8yzV83zI8h+CZNjNA== X-Received: by 2002:a9d:1bd6:: with SMTP id v22-v6mr9478525otv.85.1528102633654; Mon, 04 Jun 2018 01:57:13 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:1123:0:0:0:0:0 with HTTP; Mon, 4 Jun 2018 01:57:13 -0700 (PDT) X-Originating-IP: [194.176.227.33] In-Reply-To: <20180604084739.GD11333@infradead.org> References: <20180529144339.16538-1-mszeredi@redhat.com> <20180529144339.16538-6-mszeredi@redhat.com> <20180604084739.GD11333@infradead.org> From: Miklos Szeredi Date: Mon, 4 Jun 2018 10:57:13 +0200 Message-ID: Subject: Re: [PATCH 05/39] vfs: optionally don't account file in nr_files To: Christoph Hellwig Cc: Miklos Szeredi , overlayfs , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org 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 Mon, Jun 4, 2018 at 10:47 AM, Christoph Hellwig wrote: > On Tue, May 29, 2018 at 04:43:05PM +0200, 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. > > But that overhead is exactly what nr_files accounts for, so this looks > bogus to me. According to comment above files_maxfiles_init() one open file uses roughly 1k, which is the total from struct file + pinned dentry + pinned inode. The actual struct file is just a quarter of that. So while overlayfs does currently pin almost 2k per file and, according to that calculation should already be using two nr_file slots, it isn't. And switching to using two slots means current setups might well have regressions due to that. I'm not against switching to two slots, but it's something that would need to come with backward compatibility guarantees (e.g. explicitly enabled with boot option, or whatever) and I don't think it's worth the trouble. Maintaining the two versions of overlayfs (with and without stacked fops) also makes little sense. Thanks, Miklos