From owner-svn-src-all@freebsd.org Fri Jul 10 08:54:14 2015 Return-Path: Delivered-To: svn-src-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 1996999604F; Fri, 10 Jul 2015 08:54:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 F41031B1D; Fri, 10 Jul 2015 08:54:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6A8sDMa038573; Fri, 10 Jul 2015 08:54:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6A8sDOa038572; Fri, 10 Jul 2015 08:54:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201507100854.t6A8sDOa038572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 10 Jul 2015 08:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285353 - head/sys/kern X-SVN-Group: head 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.20 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: Fri, 10 Jul 2015 08:54:14 -0000 Author: kib Date: Fri Jul 10 08:54:12 2015 New Revision: 285353 URL: https://svnweb.freebsd.org/changeset/base/285353 Log: Change the mb() use in the sched_ult tdq_notify() and sched_idletd() to more C11-ish atomic_thread_fence_seq_cst(). Note that on PowerPC, which currently uses lwsync for mb(), the change actually fixes the missed store/load barrier, intended by r271604 [*]. Reviewed by: alc Noted by: alc [*] Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Fri Jul 10 08:36:22 2015 (r285352) +++ head/sys/kern/sched_ule.c Fri Jul 10 08:54:12 2015 (r285353) @@ -1057,7 +1057,7 @@ tdq_notify(struct tdq *tdq, struct threa * globally visible before we read tdq_cpu_idle. Idle thread * accesses both of them without locks, and the order is important. */ - mb(); + atomic_thread_fence_seq_cst(); if (TD_IS_IDLETHREAD(ctd)) { /* @@ -2667,7 +2667,7 @@ sched_idletd(void *dummy) * before cpu_idle() read tdq_load. The order is important * to avoid race with tdq_notify. */ - mb(); + atomic_thread_fence_seq_cst(); cpu_idle(switchcnt * 4 > sched_idlespinthresh); tdq->tdq_cpu_idle = 0;