From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 17 22:06:40 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EDA9E16A4B3 for ; Wed, 17 Sep 2003 22:06:40 -0700 (PDT) Received: from nospam.dyndns.dk (B769c.pppool.de [213.7.118.156]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7085E43FDF for ; Wed, 17 Sep 2003 22:03:56 -0700 (PDT) (envelope-from bounce@NOSPAM.dyndns.dk) Received: from Mail.NOSPAM.DynDNS.dK (ipv6.NetScum.dyndns.dk [2002:d507:769c:0:220:afff:fed4:dbcb]) (8.11.6/8.11.6-SPAMMERS-DeLiGHt) with ESMTP id h8I4tBS58277 verified NO) for ; Thu, 18 Sep 2003 06:55:19 +0200 (CEST) (envelope-from bounce@NOSPAM.dyndns.dk) Received: (from beer@localhost) by Mail.NOSPAM.DynDNS.dK (8.11.6/FNORD) id h8I4tBK58276; Thu, 18 Sep 2003 06:55:11 +0200 (CEST) (envelope-from bounce@NOSPAM.dyndns.dk) Date: Thu, 18 Sep 2003 06:55:11 +0200 (CEST) Message-Id: <200309180455.h8I4tBK58276@Mail.NOSPAM.DynDNS.dK> X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: beer set sender to bounce@NOSPAM.dyndns.dk using -f X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: Processed from queue /tmp X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: Processed by beer with -C /etc/mail/sendmail.cf-LOCAL From: Barry Bouwsma References: <200309152127.h8FLRrv71220@Mail.NOSPAM.DynDNS.dK> <3F66DFED.C3FA43EE@mindspring.com> To: FreeBSD List of Hackers Subject: Re: Machine wedges solid after one serial-port source-line addition... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2003 05:06:41 -0000 [Ooops, looks like I sent out two mails to this list with the wrong address, so most of your anti-spam filters probably bitbucketed them where they belong. Fixed, I hope, with an IPv6-only address. But just reply to the list and drop me, I'll catch up from the archives... ] Terry Lambert wrote: > > Would anyone care to explain why the following simple patch could be > > enough to wedge my machine solid? (My original hack-patches without > You are calling printf() from a fast interrupt handler. I had a feeling it might be something like that. In truth, I had experienced a repeatable machine hang *without* the printf() that either happened immediately or after some hours -- I can't remember which now -- and tried to simplify my code down to something simpler using printf()... > If you need to communicate information to a console log (or > wherever), then you should enqueue the information on the > status change, and wake up some thread to do the actual Well, I only wanted the printf() to verify that that part of the code was being hit as expected, for debugging. My original code was calling wakeup(). You see, what I'm attempting to do, without knowing what I'm doing, is to implement the TIOCMIWAIT ioctl that apparently exists in Linux, to notify a userland program that there's been a status change on one or more of the modem status lines, and eliminate the need to poll the status line in question, cutting that program's cost to run by a factor of about 20 in the testing I did before the machine would wedge. I did all this offline, with no examples to follow, but now I have something to look at and see if I have the general idea. So I should probably shut up and study it. So, since a printf() is right out, is it safe for me (as a non- programmer, so forgive my ignorance of the basics) to simply use little more than a wakeup() in its place? Or does that, or the tsleep() corresponding, need some sort of careful handling to avoid the lockups I've experienced? Thanks, Barry Bouwsma