3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 1986, 2010, Oracle and/or its affiliates. All rights reserved.
  23  */
  24 
  25 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  26 /*        All Rights Reserved   */
  27 
  28 /*
  29  * University Copyright- Copyright (c) 1982, 1986, 1988
  30  * The Regents of the University of California
  31  * All Rights Reserved
  32  *
  33  * University Acknowledgment- Portions of this document are derived from
  34  * software developed by the University of California, Berkeley, and its
  35  * contributors.
  36  */
  37 
  38 #ifndef _VM_PAGE_H
  39 #define _VM_PAGE_H
  40 
  41 #include <vm/seg.h>
  42 
 
 
 657  */
 658 #define SE_EWANTED      0x40000000
 659 #define PAGE_LOCKED(pp)         (((pp)->p_selock & ~SE_EWANTED) != 0)
 660 #define PAGE_SHARED(pp)         (((pp)->p_selock & ~SE_EWANTED) > 0)
 661 #define PAGE_EXCL(pp)           ((pp)->p_selock < 0)
 662 #define PAGE_LOCKED_SE(pp, se)  \
 663         ((se) == SE_EXCL ? PAGE_EXCL(pp) : PAGE_SHARED(pp))
 664 
 665 extern  long page_hashsz;
 666 extern  unsigned int page_hashsz_shift;
 667 extern  page_t **page_hash;
 668 
 669 extern  pad_mutex_t page_llocks[];      /* page logical lock mutex */
 670 extern  kmutex_t freemem_lock;          /* freemem lock */
 671 
 672 extern  pgcnt_t total_pages;            /* total pages in the system */
 673 
 674 /*
 675  * Variables controlling locking of physical memory.
 676  */
 677 extern  pgcnt_t pages_pp_maximum;       /* tuning: lock + claim <= max */
 678 extern  void init_pages_pp_maximum(void);
 679 
 680 struct lgrp;
 681 
 682 /* page_list_{add,sub} flags */
 683 
 684 /* which list */
 685 #define PG_FREE_LIST    0x0001
 686 #define PG_CACHE_LIST   0x0002
 687 
 688 /* where on list */
 689 #define PG_LIST_TAIL    0x0010
 690 #define PG_LIST_HEAD    0x0020
 691 
 692 /* called from */
 693 #define PG_LIST_ISINIT  0x1000
 694 
 695 /*
 696  * Page frame operations.
 697  */
 
 | 
 
 
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 1986, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  24  */
  25 
  26 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  27 /*        All Rights Reserved   */
  28 
  29 /*
  30  * University Copyright- Copyright (c) 1982, 1986, 1988
  31  * The Regents of the University of California
  32  * All Rights Reserved
  33  *
  34  * University Acknowledgment- Portions of this document are derived from
  35  * software developed by the University of California, Berkeley, and its
  36  * contributors.
  37  */
  38 
  39 #ifndef _VM_PAGE_H
  40 #define _VM_PAGE_H
  41 
  42 #include <vm/seg.h>
  43 
 
 
 658  */
 659 #define SE_EWANTED      0x40000000
 660 #define PAGE_LOCKED(pp)         (((pp)->p_selock & ~SE_EWANTED) != 0)
 661 #define PAGE_SHARED(pp)         (((pp)->p_selock & ~SE_EWANTED) > 0)
 662 #define PAGE_EXCL(pp)           ((pp)->p_selock < 0)
 663 #define PAGE_LOCKED_SE(pp, se)  \
 664         ((se) == SE_EXCL ? PAGE_EXCL(pp) : PAGE_SHARED(pp))
 665 
 666 extern  long page_hashsz;
 667 extern  unsigned int page_hashsz_shift;
 668 extern  page_t **page_hash;
 669 
 670 extern  pad_mutex_t page_llocks[];      /* page logical lock mutex */
 671 extern  kmutex_t freemem_lock;          /* freemem lock */
 672 
 673 extern  pgcnt_t total_pages;            /* total pages in the system */
 674 
 675 /*
 676  * Variables controlling locking of physical memory.
 677  */
 678 extern  volatile pgcnt_t pages_pp_maximum; /* tuning: lock + claim <= max */
 679 extern  void init_pages_pp_maximum(void);
 680 
 681 struct lgrp;
 682 
 683 /* page_list_{add,sub} flags */
 684 
 685 /* which list */
 686 #define PG_FREE_LIST    0x0001
 687 #define PG_CACHE_LIST   0x0002
 688 
 689 /* where on list */
 690 #define PG_LIST_TAIL    0x0010
 691 #define PG_LIST_HEAD    0x0020
 692 
 693 /* called from */
 694 #define PG_LIST_ISINIT  0x1000
 695 
 696 /*
 697  * Page frame operations.
 698  */
 
 |