[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1446640408.4184.18.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Wed, 04 Nov 2015 04:33:28 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Rasmus Villemoes <linux@...musvillemoes.dk>
Cc: Alexander Viro <viro@...iv.linux.org.uk>,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC] vfs: don't bother clearing close_on_exec bit for unused
fds
On Wed, 2015-11-04 at 11:59 +0100, Rasmus Villemoes wrote:
> @@ -667,10 +665,9 @@ void do_close_on_exec(struct files_struct *files)
> fdt = files_fdtable(files);
> if (fd >= fdt->max_fds)
> break;
> - set = fdt->close_on_exec[i];
> + set = fdt->close_on_exec[i] & fdt->open_fds[i];
> if (!set)
> continue;
Many processes have a big hole at the end of fdt->open_fds[], due
to the fact that max_fds is rounded to a power of two.
It makes sense to avoid bringing in cpu caches the close_on_exec[] part.
set = fdt->open_fds[i];
if (!set)
continue;
set &= fdt->close_on_exec[i];
if (!set)
continue;
Not sure if this is a net win due to branch prediction...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists