From: Eric Dumazet <eric.dumazet@gmail.com> To: Changli Gao <xiaosuo@gmail.com> Cc: Alexander Viro <viro@zeniv.linux.org.uk>, Matthew Wilcox <matthew@wil.cx>, Arnd Bergmann <arnd@arndb.de>, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Subject: Re: [PATCH] fs: add FD_CLOFORK and O_CLOFORK Date: Sat, 07 May 2011 07:25:45 +0200 [thread overview] Message-ID: <1304745945.2821.601.camel@edumazet-laptop> (raw) In-Reply-To: <1304743740-3405-1-git-send-email-xiaosuo@gmail.com> Le samedi 07 mai 2011 à 12:49 +0800, Changli Gao a écrit : > If FD_CLOFORK is 1, when a fork occurs, the corresponding file descriptor > will be closed for the child process. IOW, the file descriptor isn't > inheritable. > > FD_CLOFORK is used as IBM does. Is it part of a standard, and what could be the use for such thing ? Why had we wait 2011 to add it in linux ? > > O_CLOFORK is also added to avoid the additional fcntl(2) after open(2). > > Signed-off-by: Changli Gao <xiaosuo@gmail.com> Your implementation has some peformance implication. close_on_exec and close_on_fork bit for a given fd would be on separate cache lines. So you add a cost on threaded programs for open()/close() [ Yes, we apparently clear close_on_exec bit in close()... we could let it untouched and make flush_old_files() aware of that ]
WARNING: multiple messages have this Message-ID (diff)
From: Eric Dumazet <eric.dumazet@gmail.com> To: Changli Gao <xiaosuo@gmail.com> Cc: Alexander Viro <viro@zeniv.linux.org.uk>, Matthew Wilcox <matthew@wil.cx>, Arnd Bergmann <arnd@arndb.de>, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Subject: Re: [PATCH] fs: add FD_CLOFORK and O_CLOFORK Date: Sat, 07 May 2011 07:25:45 +0200 [thread overview] Message-ID: <1304745945.2821.601.camel@edumazet-laptop> (raw) In-Reply-To: <1304743740-3405-1-git-send-email-xiaosuo@gmail.com> Le samedi 07 mai 2011 à 12:49 +0800, Changli Gao a écrit : > If FD_CLOFORK is 1, when a fork occurs, the corresponding file descriptor > will be closed for the child process. IOW, the file descriptor isn't > inheritable. > > FD_CLOFORK is used as IBM does. Is it part of a standard, and what could be the use for such thing ? Why had we wait 2011 to add it in linux ? > > O_CLOFORK is also added to avoid the additional fcntl(2) after open(2). > > Signed-off-by: Changli Gao <xiaosuo@gmail.com> Your implementation has some peformance implication. close_on_exec and close_on_fork bit for a given fd would be on separate cache lines. So you add a cost on threaded programs for open()/close() [ Yes, we apparently clear close_on_exec bit in close()... we could let it untouched and make flush_old_files() aware of that ] -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-05-07 6:18 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-05-07 4:49 [PATCH] fs: add FD_CLOFORK and O_CLOFORK Changli Gao 2011-05-07 5:25 ` Eric Dumazet [this message] 2011-05-07 5:25 ` Eric Dumazet 2011-05-07 10:09 ` Changli Gao 2011-05-07 6:06 ` Eric Dumazet 2011-05-07 6:22 ` Changli Gao 2011-05-07 6:29 ` Eric Dumazet 2011-05-07 10:10 ` Changli Gao 2011-05-07 11:41 ` Geert Uytterhoeven 2011-05-07 12:32 ` Eric Dumazet 2011-05-07 12:32 ` Eric Dumazet
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1304745945.2821.601.camel@edumazet-laptop \ --to=eric.dumazet@gmail.com \ --cc=arnd@arndb.de \ --cc=linux-arch@vger.kernel.org \ --cc=linux-fsdevel@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=matthew@wil.cx \ --cc=viro@zeniv.linux.org.uk \ --cc=xiaosuo@gmail.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.