From owner-freebsd-current@FreeBSD.ORG Mon Jan 14 17:33:54 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7385E16A419 for ; Mon, 14 Jan 2008 17:33:54 +0000 (UTC) (envelope-from psionic@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.186]) by mx1.freebsd.org (Postfix) with ESMTP id C875F13C461 for ; Mon, 14 Jan 2008 17:33:53 +0000 (UTC) (envelope-from psionic@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so175948nfb.33 for ; Mon, 14 Jan 2008 09:33:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=sRK896SDbWKlZIEawKlR/tkI0uMoA+nDTRACAdr6LLg=; b=nSDMy0pNaMSa6PuJf7ZSRLlwsFZ3kMk4+C0wpOBso8eJR9Ggqvkndcss1QpdQng1wgPnx8LJBLy8zuMoil9YVV9ZDPaNe6xOVJroI2lGBLJ1MJq/szKaLCUU1LEMtp6d3gSn+UcSyuuEWhFWXcRz3B2Wn43RYJ8q+Y9JqLff8Xc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=G/rBl+yKRELOKE17tCgV/CYEvse62A7cpau35jblNCYQ6lDOfr+OCsn8pFi/IFuh2wfUTvvyr6sf5+lme/YJ3xkkqe4WJ8evV6SF3dYDplucuSdifk3fhDGV41F419A2Th20S13xJb9pvT1E+O7cf391gv25NwmKQE41+wamKBE= Received: by 10.78.149.15 with SMTP id w15mr7629932hud.72.1200330280443; Mon, 14 Jan 2008 09:04:40 -0800 (PST) Received: by 10.78.67.9 with HTTP; Mon, 14 Jan 2008 09:04:40 -0800 (PST) Message-ID: <5ad23a300801140904w7da3a952m7d1b6cd45c2326e1@mail.gmail.com> Date: Mon, 14 Jan 2008 09:04:40 -0800 From: "Jordan Sissel" To: "Kris Kennaway" , current@freebsd.org, jls@freebsd.org In-Reply-To: <20080114110054.GK17508@fasolt.home.paeps.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <478A739F.2030003@FreeBSD.org> <20080114110054.GK17508@fasolt.home.paeps.cx> Cc: Subject: Re: mpsafe psm driver needed X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jan 2008 17:33:54 -0000 On Jan 14, 2008 3:00 AM, Philip Paeps wrote: > On 2008-01-13 21:25:03 (+0100), Kris Kennaway wrote: > > I've been looking at some mutex profiling traces from users of 6.x and 7.x > > who are reporting that their mouse pointer sometimes freezes when their > > system is busy. In most of the situations I have looked at this is because > > the psm driver is Giant-locked, and competes with other things like the > > syncer (in 6.x), or sysctl calls (I have a WIP for this that I need to > > revisit). > > > > This is a minor problem from a grand architectural point of view but an > > important one from a usability point of view. I believe these particular > > interactivity problems would be resolved if the psm driver no longer > > required Giant. Is anyone able to work on this? > > I have taken a look at this in the past. It's not a trivial problem. > > There is a lot of what I can only charitably call "legacy code" in psm and it > appears that as soon as you touch any of it, it upsets at least one brand of > KVM "out there". > > One of my mentees has been working on a rewrite for a while, but the project > has not yet been committed to cvs. > > jls: any news on this? > This was on my list of things to fix in psm(4) as part of the rewrite, but I haven't done that yet. Looks like it's become a priority now, so what better time? I must confess I don't have a great deal of experience with the freebsd kernel and its locking system. From what I can tell, the only outside resources psm(4) uses is spltty (which has been deprecated for some time, yes?), atkbdc, and giant. However, in searching the source, I see many instances of mtx_lock(&Giant), but none in psm.c. From looking at the code, it seems like if you pass D_NEEDGIANT in your flags when you call make_dev, some of your methods are implicitly wrapped with mutex locks which use Giant? (Forgive any oversight, it's 9am ;)) Any guidance is welcome regarding the best way to remove the need for giant. I'm happy to take on doing this, since I'm already somewhat familiar with psm(4). -Jordan > - Philip > > -- > Philip Paeps Please don't Cc me, I am > philip@freebsd.org subscribed to the list. > > It is impossible for an optimist to be pleasantly > suprised. > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >