From owner-svn-src-head@freebsd.org Tue Jul 21 14:39:35 2015 Return-Path: Delivered-To: svn-src-head@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 5B9D09A7470; Tue, 21 Jul 2015 14:39:35 +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 444A91A76; Tue, 21 Jul 2015 14:39:35 +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 t6LEdZUB093931; Tue, 21 Jul 2015 14:39:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LEdZT8093930; Tue, 21 Jul 2015 14:39:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201507211439.t6LEdZT8093930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 21 Jul 2015 14:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285751 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 14:39:35 -0000 Author: kib Date: Tue Jul 21 14:39:34 2015 New Revision: 285751 URL: https://svnweb.freebsd.org/changeset/base/285751 Log: The part of r285680 which removed release semantic for two stores to it_need was wrong [*]. Restore the releases and add a comment explaining why it is needed. Noted by: alc [*] Reviewed by: bde [*] Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_intr.c Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Tue Jul 21 14:36:33 2015 (r285750) +++ head/sys/kern/kern_intr.c Tue Jul 21 14:39:34 2015 (r285751) @@ -829,8 +829,14 @@ ok: * Ensure that the thread will process the handler list * again and remove this handler if it has already passed * it on the list. + * + * The release part of the following store ensures + * that the update of ih_flags is ordered before the + * it_need setting. See the comment before + * atomic_cmpset_acq(&ithd->it_need, ...) operation in + * the ithread_execute_handlers(). */ - ie->ie_thread->it_need = 1; + atomic_store_rel_int(&ie->ie_thread->it_need, 1); } else TAILQ_REMOVE(&ie->ie_handlers, handler, ih_next); thread_unlock(ie->ie_thread->it_thread); @@ -979,8 +985,14 @@ ok: * Ensure that the thread will process the handler list * again and remove this handler if it has already passed * it on the list. + * + * The release part of the following store ensures + * that the update of ih_flags is ordered before the + * it_need setting. See the comment before + * atomic_cmpset_acq(&ithd->it_need, ...) operation in + * the ithread_execute_handlers(). */ - it->it_need = 1; + atomic_store_rel_int(&it->it_need, 1); } else TAILQ_REMOVE(&ie->ie_handlers, handler, ih_next); thread_unlock(it->it_thread);