From owner-svn-src-all@FreeBSD.ORG Fri May 2 18:56:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70A1558C; Fri, 2 May 2014 18:56:59 +0000 (UTC) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67B7B1D96; Fri, 2 May 2014 18:56:58 +0000 (UTC) Received: by mail-wi0-f172.google.com with SMTP id hi5so1895197wib.5 for ; Fri, 02 May 2014 11:56:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=UZXZzWj7GAtBo1XfX76GRXpi61DxmlEHB9r3cUbx6j4=; b=vVSTmTPUE+U3uVVO8eK1bPWtN88ASzZN3L2/wKtWZH52Yd/2pGQyAKk1WPFq0Jtwlw +ZQregX693VMq6X9hA0LN51+OHJw5dgjxDfH9uxL0ZljNaFViYN0XmA3RPN7wozE0wVN uQ+NSFCsY3xQ+4K7+fjerlHZSlgQEY+TMa2MP8TTPxaR7wbM02AVYhS55cHHuUkexmj+ FNqbXFy7T6L6IF1OUK0ywUZLArBTLlXYg2WopLudj3n99C/zn+/4Fs6sW23fdpKyN+ZU VofZXoUaSGXIaJJ/bDHPYfRWhoiEaTMKs4q6gaNSfDp+VY6C/97Zx6x1Ij9Om9tVdW7L O3TA== X-Received: by 10.180.94.37 with SMTP id cz5mr4251286wib.19.1399057016435; Fri, 02 May 2014 11:56:56 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id q2sm6551055wix.5.2014.05.02.11.56.54 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 02 May 2014 11:56:55 -0700 (PDT) Date: Fri, 2 May 2014 20:56:52 +0200 From: Mateusz Guzik To: Chagin Dmitry Subject: Re: svn commit: r255672 - in head/sys: amd64/linux32 compat/linux conf i386/linux kern modules/linux sys Message-ID: <20140502185652.GA28158@dft-labs.eu> References: <201309181756.r8IHu4qV052882@svn.freebsd.org> <20130918184648.GA31748@dft-labs.eu> <20140502183705.GA10245@dchagin.static.corbina.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20140502183705.GA10245@dchagin.static.corbina.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, yuri@rawbw.com, Roman Divacky , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 18:56:59 -0000 On Fri, May 02, 2014 at 10:37:05PM +0400, Chagin Dmitry wrote: > On Wed, Sep 18, 2013 at 08:46:48PM +0200, Mateusz Guzik wrote: > > On Wed, Sep 18, 2013 at 05:56:04PM +0000, Roman Divacky wrote: > > > Author: rdivacky > > > Date: Wed Sep 18 17:56:04 2013 > > > New Revision: 255672 > > > URL: http://svnweb.freebsd.org/changeset/base/255672 > > > > > > Log: > > > Implement epoll support in Linuxulator. This is a tiny wrapper around kqueue > > > to implement epoll subset of functionality. The kqueue user data are 32bit > > > on i386 which is not enough for epoll user data so this patch overrides > > > kqueue fileops to maintain enough space in struct file. > > > > > > Initial patch developed by me in 2007 and then extended and finished > > > by Yuri Victorovich. > > > > > > > > I'm strongly dislike a hacking kqueue file ops. I would prefer more > generic mechanism. > > Maybe we need a emulator file ops in struct file, or a per proc list of > such files. Any ideas? > Not sure what you mean. I don't see any acceptable way around modifying kqueue. kqueue syscall will install fd with kqops in your table, but you don't want that. You want fd with epoll op. What's more, with epoll_create1 you want to be able to set O_CLOEXEC atomically. Thus, you need to either duplicate kqueue initialization code (but why?) or modify it so that it supports both interfaces, which to some extent was done in this patch. -- Mateusz Guzik