From owner-svn-soc-all@freebsd.org Tue Aug 4 16:38:08 2015 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C9E79B2F95 for ; Tue, 4 Aug 2015 16:38:08 +0000 (UTC) (envelope-from stefano@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DCC4D45 for ; Tue, 4 Aug 2015 16:38:08 +0000 (UTC) (envelope-from stefano@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id t74Gc8fq073506 for ; Tue, 4 Aug 2015 16:38:08 GMT (envelope-from stefano@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id t74Gc7FZ073497 for svn-soc-all@FreeBSD.org; Tue, 4 Aug 2015 16:38:07 GMT (envelope-from stefano@FreeBSD.org) Date: Tue, 4 Aug 2015 16:38:07 GMT Message-Id: <201508041638.t74Gc7FZ073497@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to stefano@FreeBSD.org using -f From: stefano@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r289216 - soc2015/stefano/ptnetmap/stable/10/sys/dev/netmap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2015 16:38:08 -0000 Author: stefano Date: Tue Aug 4 16:38:07 2015 New Revision: 289216 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=289216 Log: [ptnetmap] use thread_suspend_check() instead of kthread_suspend_check() thread_suspend_check() must be used if the kthread is attached to user process Modified: soc2015/stefano/ptnetmap/stable/10/sys/dev/netmap/netmap_freebsd.c Modified: soc2015/stefano/ptnetmap/stable/10/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- soc2015/stefano/ptnetmap/stable/10/sys/dev/netmap/netmap_freebsd.c Tue Aug 4 15:15:06 2015 (r289215) +++ soc2015/stefano/ptnetmap/stable/10/sys/dev/netmap/netmap_freebsd.c Tue Aug 4 16:38:07 2015 (r289216) @@ -972,7 +972,13 @@ thread_unlock(curthread); while (nmk->run) { + /* check if the parent process dies */ + PROC_LOCK(curproc); + thread_suspend_check(0); + PROC_UNLOCK(curproc); +#if 0 kthread_suspend_check(); +#endif new_scheduled = nmk->scheduled; @@ -983,7 +989,7 @@ } else if (nmk->run) { if (ctx->ioevent_file) { /* wait on event with timetout 1 second */ - tsleep_sbt(ctx->ioevent_file, PPAUSE, "nmk_event", SBT_1S, SBT_1MS, C_ABSOLUTE); + tsleep_sbt(ctx->ioevent_file, PPAUSE, "nmk_event", SBT_1S, SBT_1S, C_ABSOLUTE); nmk->scheduled++; } }