lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 4 Jun 2018 10:57:13 +0200
From:   Miklos Szeredi <miklos@...redi.hu>
To:     Christoph Hellwig <hch@...radead.org>
Cc:     Miklos Szeredi <mszeredi@...hat.com>,
        overlayfs <linux-unionfs@...r.kernel.org>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 05/39] vfs: optionally don't account file in nr_files

On Mon, Jun 4, 2018 at 10:47 AM, Christoph Hellwig <hch@...radead.org> 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ