From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965094AbbKCWpE (ORCPT ); Tue, 3 Nov 2015 17:45:04 -0500 Received: from mail-io0-f173.google.com ([209.85.223.173]:34719 "EHLO mail-io0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752441AbbKCWpD (ORCPT ); Tue, 3 Nov 2015 17:45:03 -0500 MIME-Version: 1.0 In-Reply-To: <1446543679-28849-1-git-send-email-linux@rasmusvillemoes.dk> References: <1446543679-28849-1-git-send-email-linux@rasmusvillemoes.dk> Date: Tue, 3 Nov 2015 14:45:01 -0800 X-Google-Sender-Auth: qav5CQ2bzy71xGiRLDGzzIzuuF8 Message-ID: Subject: Re: [RFC] vfs: don't bother clearing close_on_exec bit for unused fds From: Linus Torvalds To: Rasmus Villemoes Cc: Alexander Viro , linux-fsdevel , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 3, 2015 at 1:41 AM, Rasmus Villemoes wrote: > > I'm sure I've missed something, hence the RFC. But if not, there's > probably also a few memsets which become redundant. And the > __set_close_on_exec part should probably be its own patch... The patch looks fine to me. I'm not sure the __set_close_on_exec part even makes sense, because if you set that bit, it usually really *is* clear before, so testing it beforehand is just pointless. And if somebody really keeps setting the bit, they are doing something stupid anyway.. So I have nothing against the patch, but I do wonder how much it matters. If there isn't a noticeable performance win, I'd almost rather just keep the close-on-exec bitmap up-to-date. Hmm? Linus