From owner-freebsd-current@FreeBSD.ORG Mon Jan 14 17:26:11 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 37C2416A420; Mon, 14 Jan 2008 17:26:11 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id A463A13C4D1; Mon, 14 Jan 2008 17:26:10 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.samsco.home (phobos.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.8/8.13.8) with ESMTP id m0EHQ726075405; Mon, 14 Jan 2008 10:26:07 -0700 (MST) (envelope-from scottl@samsco.org) Message-Id: <5DEE3CC6-26AF-4BE7-BC05-BDD98830B86F@samsco.org> From: Scott Long To: John Baldwin In-Reply-To: <200801140920.12890.jhb@freebsd.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Date: Mon, 14 Jan 2008 10:26:07 -0700 References: <478A739F.2030003@FreeBSD.org> <20080114110054.GK17508@fasolt.home.paeps.cx> <200801140920.12890.jhb@freebsd.org> X-Mailer: Apple Mail (2.915) X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (pooker.samsco.org [168.103.85.57]); Mon, 14 Jan 2008 10:26:08 -0700 (MST) X-Spam-Status: No, score=-1.4 required=5.4 tests=ALL_TRUSTED autolearn=failed version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: jls@freebsd.org, freebsd-current@freebsd.org, current@freebsd.org 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:26:11 -0000 On Jan 14, 2008, at 7:20 AM, John Baldwin wrote: > On Monday 14 January 2008 06:00:54 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? > > Does psm(4) interface with any subsystems like tty(4)? The problem is that it interfaces with syscons because of its interaction with the atkbd hardware. I looked at this as well a few years ago, and it's a huge mess to detangle. Syscons, while it works fairly well overall, it a big mess when it comes to internal interfaces; code flows up and down the stack several times for a single operation, so it makes it hard to lock in a sane and safe way. I don't know what the best answer is for it; if what Philip said about his associate is true, I'm impressed. But beyond that, I don't know if it's best to try to do discrete but slow locking on the existing architecture and deal with the inevitable deadlocks that will appear, or if it's better to look at a different console architecture again. Scott