fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe * CDDL HEADER START
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe * The contents of this file are subject to the terms of the
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe * Common Development and Distribution License (the "License").
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe * You may not use this file except in compliance with the License.
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe * See the License for the specific language governing permissions
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe * and limitations under the License.
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe * When distributing Covered Code, include this CDDL HEADER in each
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe * If applicable, add the following below this CDDL HEADER, with the
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe * fields enclosed by brackets "[]" replaced with your own identifying
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe * information: Portions Copyright [yyyy] [name of copyright owner]
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe * CDDL HEADER END
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe * Use is subject to license terms.
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe * CMT PG class
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxeextern "C" {
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe * CMT related dispatcher policies
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe * CMT pg structure
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe struct group *cmt_siblings; /* CMT PGs to balance with */
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe struct group *cmt_children; /* Active children CMT PGs */
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe pg_cmt_policy_t cmt_policy; /* Dispatcher policies to use */
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe uint32_t cmt_utilization; /* Group's utilization */
6890d023cce317bfcb74d7e43a813d060ebd2e47Eric Saxe struct bitset cmt_cpus_actv_set; /* bitset of active CPUs */
b885580b43755ee4ea1e280b85428893d2ba9291Alexander Kolbasov kstat_t *cmt_kstat; /* cmt kstats exported */
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe * CMT lgroup structure
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe group_t cl_pgs; /* Top level group of active CMT PGs */
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe int cl_npgs; /* # of top level PGs in the lgroup */
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe lgrp_handle_t cl_hand; /* lgroup's platform handle */
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe * Change the number of running threads on the pg
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe#define PG_NRUN_UPDATE(cp, n) (pg_cmt_load((cp), (n)))
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe * Indicate that the given logical CPU is (or isn't) currently utilized
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe#define CMT_CPU_UTILIZED(cp) (pg_cmt_load((cp), 1))
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe#define CMT_CPU_NOT_UTILIZED(cp) (pg_cmt_load((cp), -1))
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe * CMT PG's capacity
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe * Currently, this is defined to be the number of active
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe * logical CPUs in the group.
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe * This will be used in conjunction with the utilization, which is defined
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe * to be the number of threads actively running on CPUs in the group.
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe#define CMT_CAPACITY(pg) (GROUP_SIZE(&((pg_cmt_t *)pg)->cmt_cpus_actv))
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe * CMT platform interfaces
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe * CMT dispatcher policy
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe * Power Aware Dispatcher Interfaces
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe#endif /* !_KERNEL && !_KMEMUSER */
fb2f18f820d90b001aea4fb27dd654bc1263c440esaxe#endif /* _CMT_H */