From owner-svn-src-all@freebsd.org Fri Apr 8 10:21:44 2016 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 E0590B0796E; Fri, 8 Apr 2016 10:21:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 9F7DB1ADE; Fri, 8 Apr 2016 10:21:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u38ALhRd068965; Fri, 8 Apr 2016 10:21:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u38ALhrq068960; Fri, 8 Apr 2016 10:21:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201604081021.u38ALhrq068960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 8 Apr 2016 10:21:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297701 - head/lib/libthr/thread 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.21 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, 08 Apr 2016 10:21:45 -0000 Author: kib Date: Fri Apr 8 10:21:43 2016 New Revision: 297701 URL: https://svnweb.freebsd.org/changeset/base/297701 Log: Assert that the lock objects put into the off-page, fit into the page. Sponsored by: The FreeBSD Foundation Modified: head/lib/libthr/thread/thr_barrier.c head/lib/libthr/thread/thr_cond.c head/lib/libthr/thread/thr_mutex.c head/lib/libthr/thread/thr_pspinlock.c head/lib/libthr/thread/thr_rwlock.c Modified: head/lib/libthr/thread/thr_barrier.c ============================================================================== --- head/lib/libthr/thread/thr_barrier.c Fri Apr 8 10:00:07 2016 (r297700) +++ head/lib/libthr/thread/thr_barrier.c Fri Apr 8 10:21:43 2016 (r297701) @@ -34,6 +34,9 @@ #include "thr_private.h" +_Static_assert(sizeof(struct pthread_barrier) <= PAGE_SIZE, + "pthread_barrier is too large for off-page"); + __weak_reference(_pthread_barrier_init, pthread_barrier_init); __weak_reference(_pthread_barrier_wait, pthread_barrier_wait); __weak_reference(_pthread_barrier_destroy, pthread_barrier_destroy); Modified: head/lib/libthr/thread/thr_cond.c ============================================================================== --- head/lib/libthr/thread/thr_cond.c Fri Apr 8 10:00:07 2016 (r297700) +++ head/lib/libthr/thread/thr_cond.c Fri Apr 8 10:21:43 2016 (r297701) @@ -40,6 +40,9 @@ #include "thr_private.h" +_Static_assert(sizeof(struct pthread_cond) <= PAGE_SIZE, + "pthread_cond too large"); + /* * Prototypes */ Modified: head/lib/libthr/thread/thr_mutex.c ============================================================================== --- head/lib/libthr/thread/thr_mutex.c Fri Apr 8 10:00:07 2016 (r297700) +++ head/lib/libthr/thread/thr_mutex.c Fri Apr 8 10:21:43 2016 (r297701) @@ -51,6 +51,9 @@ #include "thr_private.h" +_Static_assert(sizeof(struct pthread_mutex) <= PAGE_SIZE, + "pthread_mutex is too large for off-page"); + /* * For adaptive mutexes, how many times to spin doing trylock2 * before entering the kernel to block Modified: head/lib/libthr/thread/thr_pspinlock.c ============================================================================== --- head/lib/libthr/thread/thr_pspinlock.c Fri Apr 8 10:00:07 2016 (r297700) +++ head/lib/libthr/thread/thr_pspinlock.c Fri Apr 8 10:21:43 2016 (r297701) @@ -38,6 +38,9 @@ #include "thr_private.h" +_Static_assert(sizeof(struct pthread_spinlock) <= PAGE_SIZE, + "pthread_spinlock is too large for off-page"); + #define SPIN_COUNT 100000 __weak_reference(_pthread_spin_init, pthread_spin_init); Modified: head/lib/libthr/thread/thr_rwlock.c ============================================================================== --- head/lib/libthr/thread/thr_rwlock.c Fri Apr 8 10:00:07 2016 (r297700) +++ head/lib/libthr/thread/thr_rwlock.c Fri Apr 8 10:21:43 2016 (r297701) @@ -35,6 +35,9 @@ #include "un-namespace.h" #include "thr_private.h" +_Static_assert(sizeof(struct pthread_rwlock) <= PAGE_SIZE, + "pthread_rwlock is too large for off-page"); + __weak_reference(_pthread_rwlock_destroy, pthread_rwlock_destroy); __weak_reference(_pthread_rwlock_init, pthread_rwlock_init); __weak_reference(_pthread_rwlock_rdlock, pthread_rwlock_rdlock);