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]
Message-ID: <m13aaintb1.fsf@fess.ebiederm.org>
Date:	Tue, 02 Jun 2009 15:51:14 -0700
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Davide Libenzi <davidel@...ilserver.org>
Cc:	Al Viro <viro@...IV.linux.org.uk>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	linux-pci@...r.kernel.org, linux-mm@...ck.org,
	linux-fsdevel@...r.kernel.org, Hugh Dickins <hugh@...itas.com>,
	Tejun Heo <tj@...nel.org>,
	Alexey Dobriyan <adobriyan@...il.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Nick Piggin <npiggin@...e.de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Christoph Hellwig <hch@...radead.org>,
	"Eric W. Biederman" <ebiederm@...well.aristanetworks.com>,
	"Eric W. Biederman" <ebiederm@...stanetworks.com>
Subject: Re: [PATCH 18/23] vfs: Teach epoll to use file_hotplug_lock

Davide Libenzi <davidel@...ilserver.org> writes:

> On Tue, 2 Jun 2009, Eric W. Biederman wrote:
>
>> Davide Libenzi <davidel@...ilserver.org> writes:
>> 
>> > On Mon, 1 Jun 2009, Eric W. Biederman wrote:
>> >
>> >> From: Eric W. Biederman <ebiederm@...well.aristanetworks.com>
>> >> 
>> >> Signed-off-by: Eric W. Biederman <ebiederm@...stanetworks.com>
>> >> ---
>> >>  fs/eventpoll.c |   39 ++++++++++++++++++++++++++++++++-------
>> >>  1 files changed, 32 insertions(+), 7 deletions(-)
>> >
>> > This patchset gives me the willies for the amount of changes and possible 
>> > impact on many subsystems.
>> 
>> It both is and is not that bad.  It is the cost of adding a lock.
>
> We both know that it is not only the cost of a lock, but also the 
> sprinkling over a pretty vast amount of subsystems, of another layer of 
> code.

I am not clear what problem you have.

Is it the sprinkling the code that takes and removes the lock?  Just
the VFS needs to be involved with that.  It is a slightly larger
surface area than doing the work inside the file operations as we
sometimes call the same method from 3-4 different places but it is
definitely a bounded problem.

Is it putting in the handful lines per subsystem to actually use this
functionality?  At that level something generic that is maintained
outside of the subsystem is better than the mess we have with 4-5
different implementations in the subsystems that need it, each having
a different assortment of bugs.

>> I thought of doing something more uniform to user space.  But I observed
>> that the existing epoll punts on the case of a file descriptor being closed
>> and locking to go from a file to the other epoll datastructures is pretty
>> horrid I said forget it and used the existing close behaviour.
>
> Well, you cannot rely on the caller to tidy up the epoll fd by issuing an 
> epoll_ctl(DEL), so you do *need* to "punt" on close in order to not leave 
> lingering crap around. You cannot even hold a reference of the file, since 
> otherwise the epoll hooking will have to trigger not only at ->release() 
> time, but at every close, where you'll have to figure out if this is the 
> last real userspace reference or not. Plus all the issues related to 
> holding permanent extra references to userspace files.
> And since a file can be added in many epoll devices, you need to 
> unregister it from all of them (hence the other datastructures lookup). 
> Better this, on the slow path, with locks acquired only in the epoll usage 
> case, than some other thing and on the fast path, for every file.

Sure, and that is largely and I am preserving those semantics.

Eric
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ