From owner-svn-src-projects@FreeBSD.ORG Thu Jul 29 02:11:32 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 320671065678; Thu, 29 Jul 2010 02:11:32 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 071A68FC08; Thu, 29 Jul 2010 02:11:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6T2BVnU099114; Thu, 29 Jul 2010 02:11:31 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6T2BVav099111; Thu, 29 Jul 2010 02:11:31 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201007290211.o6T2BVav099111@svn.freebsd.org> From: Jeff Roberson Date: Thu, 29 Jul 2010 02:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210585 - projects/ofed/head/sys/ofed/include/linux X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2010 02:11:32 -0000 Author: jeff Date: Thu Jul 29 02:11:31 2010 New Revision: 210585 URL: http://svn.freebsd.org/changeset/base/210585 Log: - Fix the completion macros so they don't drop the queue spinlock twice. - Define sched_yield as sched_relinquish - Don't yield while cold. Sponsored by: Isilon Systems, iX Systems, and Panasas. Modified: projects/ofed/head/sys/ofed/include/linux/completion.h projects/ofed/head/sys/ofed/include/linux/sched.h Modified: projects/ofed/head/sys/ofed/include/linux/completion.h ============================================================================== --- projects/ofed/head/sys/ofed/include/linux/completion.h Thu Jul 29 02:10:19 2010 (r210584) +++ projects/ofed/head/sys/ofed/include/linux/completion.h Thu Jul 29 02:11:31 2010 (r210585) @@ -74,10 +74,8 @@ _wait_for_common(struct completion *c, i flags |= SLEEPQ_SLEEP; for (;;) { sleepq_lock(c); - if (c->done) { - sleepq_release(c); + if (c->done) break; - } sleepq_add(c, NULL, "completion", flags, 0); if (flags & SLEEPQ_INTERRUPTIBLE) { if (sleepq_wait_sig(c, 0) != 0) @@ -104,10 +102,8 @@ _wait_for_timeout_common(struct completi flags |= SLEEPQ_SLEEP; for (;;) { sleepq_lock(c); - if (c->done) { - sleepq_release(c); + if (c->done) break; - } sleepq_add(c, NULL, "completion", flags, 0); sleepq_set_timeout(c, end - ticks); if (flags & SLEEPQ_INTERRUPTIBLE) { Modified: projects/ofed/head/sys/ofed/include/linux/sched.h ============================================================================== --- projects/ofed/head/sys/ofed/include/linux/sched.h Thu Jul 29 02:10:19 2010 (r210584) +++ projects/ofed/head/sys/ofed/include/linux/sched.h Thu Jul 29 02:11:31 2010 (r210585) @@ -74,6 +74,8 @@ struct task_struct { do { \ void *c; \ \ + if (cold) \ + break; \ c = curthread; \ sleepq_lock(c); \ if (current->state == TASK_INTERRUPTIBLE || \ @@ -100,6 +102,8 @@ do { \ kick_proc0(); \ } while (0) -#define cond_resched() sched_relinquish(curthread) +#define cond_resched() if (!cold) sched_relinquish(curthread) + +#define sched_yield() sched_relinquish(curthread) #endif /* _LINUX_SCHED_H_ */