From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 22 16:22:38 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4241E10656C1; Fri, 22 Jan 2010 16:22:38 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from lakerest.net (unknown [IPv6:2001:240:585:2:213:d4ff:fef3:2d8d]) by mx1.freebsd.org (Postfix) with ESMTP id C5BC78FC14; Fri, 22 Jan 2010 16:22:37 +0000 (UTC) Received: from [32.177.153.43] ([32.177.153.43]) (authenticated bits=0) by lakerest.net (8.14.3/8.14.3) with ESMTP id o0MGMSnu095275 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Fri, 22 Jan 2010 11:22:35 -0500 (EST) (envelope-from rrs@lakerest.net) Message-Id: From: Randall Stewart To: Ivan Voras In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Date: Fri, 22 Jan 2010 08:22:21 -0800 References: <9bbcef731001220527u5bbec479n59143b6631c6e2d8@mail.gmail.com> <20100122151035.GX77705@hoeg.nl> <905EFCFB-7362-4F54-B9E7-69C0B4699A37@lakerest.net> X-Mailer: Apple Mail (2.936) Cc: freebsd-hackers@freebsd.org Subject: Re: Greetings... a patch I would like your comments on... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 16:22:38 -0000 On Jan 22, 2010, at 8:04 AM, Ivan Voras wrote: > On 01/22/10 16:55, Randall Stewart wrote: > >>> If I read the comment at filt_umtxattach() correctly, in the best >>> case >>> you would need an extension to the kevent structure to add more >>> fields >>> like data & udata (for passing values back and forth between >>> userland >>> and kernel). I agree with this - it would be very convenient for >>> some >>> future purposes (like file modification notification) if the kernel >>> filter could both accept and return a struct of data from/to the >>> userland. >> >> Yeah, more arguments inside the kevent would allow me to add the >> COND_CV_WAIT* where a lock and condition are passed >> in as well... But I was hesitant to add more than was already there >> since doing >> so would cause ABI ripples that I did not want to face. > > Yes, this should be done carefully; just adding more "data" and > "udata" fields will postpone the problem to when someone else needs > one more field to make his idea working - a memory blob should > probably be the way to go. > >> I plan on committing this to head if I don't get strong "you idiot >> you >> did it wrong" comments ;-) > > Hmmm, something just occured to me: why did you name the event / > filter "EVFILT_KQUEUE"? Why not something like "EVFILT_UMTX" or > "EVFLT_COND"? Yep.. has I am just sitting down to write my "super crusher" test case I realize .. what was I smoking when I said EVFILT_KQUEUE.. thats got to change.. I think maybe EVFILT_UMTX_COND is best.. UMTX might let you think you could send in a lock or something else.. > > You said you didn't make the actual connection to the userland > pthead_* API yet - how did you test it? Actually I am using just raw umtx itself. For just quick testing a _thr_umtx_wake((u_long *)addr, count); Works.. Or one can even dig in and do the actual syscall.. _umtx_op().. but that requires a lot more arguments ;-) I need to think on integrating it into pthread*.. but we actully have at work our own mutex stuff for apps that is in user space and is a bit faster (quite a bit)... and it uses the umtx stuff directly ;-) R > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org > " > ------------------------------ Randall Stewart 803-317-4952 (cell) 803-345-0391(direct)