From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 23:21:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9982A624; Sun, 27 Jan 2013 23:21:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5A113BD6; Sun, 27 Jan 2013 23:21:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RNLqpJ028203; Sun, 27 Jan 2013 23:21:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RNLqKG028201; Sun, 27 Jan 2013 23:21:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272321.r0RNLqKG028201@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 23:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246015 - in stable/8/sys/sparc64: include sparc64 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 23:21:52 -0000 Author: marius Date: Sun Jan 27 23:21:51 2013 New Revision: 246015 URL: http://svnweb.freebsd.org/changeset/base/246015 Log: MFC: r245850 Revert the part of r239864 (MFC'ed to stable/8 in r241690) which removed obtaining the SMP mutex around reading registers from other CPUs. As it turns out, the hardware doesn't really like concurrent IPI'ing causing adverse effects. Also the thought deadlock when using this spin lock here and the targeted CPU(s) are also holding or in case of nested locks can't actually happen. This is due to the fact that on sparc64, spinlock_enter() only raises the PIL but doesn't disable interrupts completely. Thus direct cross calls as used for the register reading (and all other MD IPI needs) still will be executed by the targeted CPU(s) in that case. Modified: stable/8/sys/sparc64/include/smp.h stable/8/sys/sparc64/sparc64/tick.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/sparc64/ (props changed) Modified: stable/8/sys/sparc64/include/smp.h ============================================================================== --- stable/8/sys/sparc64/include/smp.h Sun Jan 27 23:21:47 2013 (r246014) +++ stable/8/sys/sparc64/include/smp.h Sun Jan 27 23:21:51 2013 (r246015) @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -195,6 +196,7 @@ ipi_rd(u_int cpu, void *func, u_long *va return (NULL); sched_pin(); ira = &ipi_rd_args; + mtx_lock_spin(&smp_ipi_mtx); ira->ira_mask = 1 << cpu; ira->ira_val = val; cpu_ipi_single(cpu, 0, (u_long)func, (u_long)ira); @@ -282,18 +284,6 @@ ipi_wait(void *cookie) } } -static __inline void -ipi_wait_unlocked(void *cookie) -{ - volatile cpumask_t *mask; - - if ((mask = cookie) != NULL) { - while (*mask != 0) - ; - sched_unpin(); - } -} - #endif /* _MACHINE_PMAP_H_ && _SYS_MUTEX_H_ */ #endif /* !LOCORE */ @@ -352,12 +342,6 @@ ipi_wait(void *cookie __unused) } static __inline void -ipi_wait_unlocked(void *cookie __unused) -{ - -} - -static __inline void tl_ipi_cheetah_dcache_page_inval(void) { Modified: stable/8/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/8/sys/sparc64/sparc64/tick.c Sun Jan 27 23:21:47 2013 (r246014) +++ stable/8/sys/sparc64/sparc64/tick.c Sun Jan 27 23:21:51 2013 (r246015) @@ -314,7 +314,7 @@ stick_get_timecount_mp(struct timecounte if (curcpu == 0) stick = rdstick(); else - ipi_wait_unlocked(ipi_rd(0, tl_ipi_stick_rd, &stick)); + ipi_wait(ipi_rd(0, tl_ipi_stick_rd, &stick)); sched_unpin(); return (stick); } @@ -328,7 +328,7 @@ tick_get_timecount_mp(struct timecounter if (curcpu == 0) tick = rd(tick); else - ipi_wait_unlocked(ipi_rd(0, tl_ipi_tick_rd, &tick)); + ipi_wait(ipi_rd(0, tl_ipi_tick_rd, &tick)); sched_unpin(); return (tick); }