From owner-freebsd-arch@FreeBSD.ORG Sat Nov 15 17:04:08 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04600E2B; Sat, 15 Nov 2014 17:04:08 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id B7221DF2; Sat, 15 Nov 2014 17:04:07 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 8CC85A445; Sat, 15 Nov 2014 17:04:06 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 16ECC19F1; Sat, 15 Nov 2014 18:04:04 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Adrian Chadd Subject: Re: suspending threads before devices References: <201203202037.q2KKbNfK037014@svn.freebsd.org> <201203211502.14353.jkim@FreeBSD.org> <4F6AF1CB.80902@FreeBSD.org> <201203220748.49635.jhb@freebsd.org> <20120322141436.GC2358@deviant.kiev.zoral.com.ua> <54666FD5.6080705@FreeBSD.org> <20141115105819.GJ17068@kib.kiev.ua> <54676BA6.7000202@FreeBSD.org> Date: Sat, 15 Nov 2014 18:04:03 +0100 In-Reply-To: (Adrian Chadd's message of "Sat, 15 Nov 2014 08:41:37 -0800") Message-ID: <86ppcocs58.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Konstantin Belousov , Jung-uk Kim , Andriy Gapon , "freebsd-arch@freebsd.org" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2014 17:04:08 -0000 Adrian Chadd writes: > Hm, would just creating a suspend kernel thread make it easier? > Ie, instead of you doing the suspend in the context of the calling > process, just have it signal to a kernel thread, so the userland > thread doing the suspend can also be suspended? My immediate reaction was "the process might want to know that the system actually suspended (and resumed)" but this can be addressed by having it sleep on a condvar which is awoken when either a) suspend fails or b) the system resumes. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no