From owner-freebsd-stable@FreeBSD.ORG Tue Apr 2 22:43:26 2013 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 66B9DC67 for ; Tue, 2 Apr 2013 22:43:26 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c:c05::233]) by mx1.freebsd.org (Postfix) with ESMTP id 03C2196 for ; Tue, 2 Apr 2013 22:43:25 +0000 (UTC) Received: by mail-wi0-f179.google.com with SMTP id hn17so948495wib.12 for ; Tue, 02 Apr 2013 15:43:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=ibbNoFv0mn9ILtSA3tzdyAo6dcdJEwJlANZTWI66TG0=; b=RQIFs1rdsIKOkSCHxgopHMDA6+hVrykHmGLqoJFkQuvxR5OydFjrbs86XQBv4Uz9ZP XgDBKV9j/IfRj1mIiJ91G6XsZeYwjgsTfdN+Fgjx68nMQqzNeV6mXPFJKF7mRtxyTvYK 8c8vTPssWV/gq0kTg7WcwZIzL5t9KlPpg+0otsGdY09wLEGHHXIU5Oi0GWW1xm0e3/qC R61LfZLsBPAy1IBBYmuaNXwofmqAJ6zpgYEuQMSfGQ29Yo8pJJDfyRH5Maq1Toz2GmCa KnEp/iz+B7ri2z3njclEruETn99SYXU302tQ/V3RKGos691BjE5Y8vFHetDbh1DKF9D7 Qscw== MIME-Version: 1.0 X-Received: by 10.180.89.105 with SMTP id bn9mr426969wib.26.1364942605183; Tue, 02 Apr 2013 15:43:25 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.108.130 with HTTP; Tue, 2 Apr 2013 15:43:25 -0700 (PDT) In-Reply-To: <514E6ED8.9040305@vangyzen.net> References: <514E6ED8.9040305@vangyzen.net> Date: Tue, 2 Apr 2013 15:43:25 -0700 X-Google-Sender-Auth: Qn5YQJpV868rLNpSL548gU62p-8 Message-ID: Subject: Re: [patch] IPMI KCS can drop the lock while servicing a request From: Adrian Chadd To: Eric van Gyzen Content-Type: text/plain; charset=ISO-8859-1 Cc: stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Apr 2013 22:43:26 -0000 On 23 March 2013 20:11, Eric van Gyzen wrote: > At work, we discovered that our application's IPMI thread would often use a > lot of CPU time. The KCS thread uses DELAY to wait for the BMC, so it can > run without sleeping for a "long" time with a slow BMC. It also holds the > ipmi_softc.ipmi_lock during this time. When using adaptive mutexes, an > application thread that wants to operate on the ipmi_pending_requests list > will also spin during this same time. > > We see no reason that the KCS thread needs to hold the lock while servicing > a request. We've been running with the attached patch for a few months, > with no ill effects. Typically holding a lock is to serialise both program state and hardware state. The whole "unlock; do blocking work or sleep; lock" thing needs to be very carefully thought out. Adrian