Print this page
NEX-1974 Support for more than 16 groups with AUTH_SYS
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
re #13613 rb4516 Tunables needs volatile keyword

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/conf/param.c
          +++ new/usr/src/uts/common/conf/param.c
↓ open down ↓ 58 lines elided ↑ open up ↑
  59   59  #include <sys/machparam.h>
  60   60  #include <sys/utsname.h>
  61   61  #include <sys/kmem.h>
  62   62  #include <sys/stack.h>
  63   63  #include <sys/modctl.h>
  64   64  #include <sys/fdbuffer.h>
  65   65  #include <sys/cyclic_impl.h>
  66   66  #include <sys/disp.h>
  67   67  #include <sys/tuneable.h>
  68   68  #include <sys/systeminfo.h>
       69 +#include <rpc/auth_sys.h>
  69   70  
  70   71  #include <sys/vmem.h>
  71   72  #include <sys/clock.h>
  72   73  #include <sys/clock_impl.h>
  73   74  #include <sys/serializer.h>
  74   75  
  75   76  /*
  76   77   * The following few lines describe generic things that must be compiled
  77   78   * into the booted executable (unix) rather than genunix or any other
  78   79   * module because they're required by crash dump readers, etc.
↓ open down ↓ 73 lines elided ↑ open up ↑
 152  153   * 8000, 10000, 20000, 25000, 40000, 50000, 100000, 125000, 200000,
 153  154   * 250000, 500000, 1000000.  As of this writing (1996) a clock rate
 154  155   * of more than about 10 kHz seems utterly ridiculous, although
 155  156   * this observation will no doubt seem quaintly amusing one day.
 156  157   */
 157  158  #define HIRES_HZ_DEFAULT        1000
 158  159  
 159  160  int hz = HZ_DEFAULT;
 160  161  int hires_hz = HIRES_HZ_DEFAULT;
 161  162  
 162      -int hires_tick = 0;
      163 +volatile int hires_tick = 0;
 163  164  int cpu_decay_factor = 10;      /* this is no longer tied to clock */
 164  165  int max_hres_adj;       /* maximum adjustment of hrtime per tick */
 165  166  int tick_per_msec;      /* clock ticks per millisecond (zero if hz < 1000) */
 166  167  
 167  168  /*
 168  169   * Milliseconds, Microseconds, and Nanoseconds per clock tick
 169  170   *
 170  171   * Note:
 171  172   *  msec_per_tick is zero if hz > 1000
 172  173   */
↓ open down ↓ 87 lines elided ↑ open up ↑
 260  261          cyclic_mp_init,
 261  262  #if defined(__sparc)
 262  263          siron_mp_init,
 263  264  #endif
 264  265          clock_tick_mp_init,
 265  266          cu_init,
 266  267          callout_mp_init,
 267  268          0
 268  269  };
 269  270  
 270      -int maxusers;           /* kitchen-sink knob for dynamic configuration */
      271 +volatile int maxusers;  /* kitchen-sink knob for dynamic configuration */
 271  272  
 272  273  /*
 273  274   * pidmax -- highest pid value assigned by the system
 274  275   * Settable in /etc/system
 275  276   */
 276      -int pidmax = DEFAULT_MAXPID;
      277 +volatile int pidmax = DEFAULT_MAXPID;
 277  278  
 278  279  /*
 279  280   * jump_pid - if set, this value is where pid numbers should start
 280  281   * after the first few system pids (0-3) are used.  If 0, pids are
 281  282   * chosen in the usual way. This variable can be used to quickly
 282  283   * create large pids (by setting it to 100000, for example). pids
 283  284   * less than this value will never be chosen.
 284  285   */
 285  286  pid_t jump_pid = DEFAULT_JUMPPID;
 286  287  
 287  288  /*
 288  289   * autoup -- used in struct var for dynamic config of the age a delayed-write
 289  290   * buffer must be in seconds before bdflush will write it out.
 290  291   */
 291  292  #define DEFAULT_AUTOUP  30
 292      -int autoup = DEFAULT_AUTOUP;
      293 +volatile int autoup = DEFAULT_AUTOUP;
 293  294  
 294  295  /*
 295  296   * bufhwm -- tuneable variable for struct var for v_bufhwm.
 296  297   * high water mark for buffer cache mem usage in units of K bytes.
 297  298   *
 298  299   * bufhwm_pct -- ditto, but given in % of physmem.
 299  300   */
 300      -int bufhwm = 0;
 301      -int bufhwm_pct = 0;
      301 +volatile int bufhwm = 0;
      302 +volatile int bufhwm_pct = 0;
 302  303  
 303  304  /*
 304  305   * Process table.
 305  306   */
 306  307  int maxpid;
 307      -int max_nprocs;         /* set in param_init() */
 308      -int maxuprc;            /* set in param_init() */
 309      -int reserved_procs;
      308 +volatile int max_nprocs;        /* set in param_init() */
      309 +volatile int maxuprc;           /* set in param_init() */
      310 +volatile int reserved_procs;
 310  311  int nthread = 1;
 311  312  
 312  313  /*
 313  314   * UFS tunables
 314  315   */
 315      -int ufs_ninode;         /* declared here due to backwards compatibility */
 316      -int ndquot;             /* declared here due to backwards compatibility */
      316 +volatile int ufs_ninode; /* declared here due to backwards compatibility */
      317 +volatile int ndquot;     /* declared here due to backwards compatibility */
 317  318  
 318  319  /*
 319  320   * Exec switch table. This is used by the generic exec module
 320  321   * to switch out to the desired executable type, based on the
 321  322   * magic number. The currently supported types are ELF, a.out
 322  323   * (both NMAGIC and ZMAGIC), interpreter (#!) files,
 323  324   * and Java executables.
 324  325   */
 325  326  /*
 326  327   * Magic numbers
↓ open down ↓ 76 lines elided ↑ open up ↑
 403  404  int nexectype = sizeof (execsw) / sizeof (execsw[0]);   /* # of exec types */
 404  405  kmutex_t execsw_lock;   /* Used for allocation of execsw entries */
 405  406  
 406  407  /*
 407  408   * symbols added to make changing proc.max-file-descriptor
 408  409   * simple via /etc/system
 409  410   */
 410  411  #define RLIM_FD_CUR 0x10000
 411  412  #define RLIM_FD_MAX 0x10000
 412  413  
 413      -uint_t rlim_fd_cur = RLIM_FD_CUR;
 414      -uint_t rlim_fd_max = RLIM_FD_MAX;
      414 +volatile uint_t rlim_fd_cur = RLIM_FD_CUR;
      415 +volatile uint_t rlim_fd_max = RLIM_FD_MAX;
 415  416  
 416  417  /*
 417  418   * (Default resource limits were formerly declared here, but are now provided by
 418  419   * the more general resource controls framework.)
 419  420   */
 420  421  
 421  422  /*
 422  423   * STREAMS tunables
 423  424   */
 424      -int     nstrpush = 9;           /* maximum # of modules/drivers on a stream */
 425      -ssize_t strctlsz = 1024;        /* maximum size of user-generated M_PROTO */
 426      -ssize_t strmsgsz = 0x10000;     /* maximum size of user-generated M_DATA */
      425 +volatile int    nstrpush = 9;   /* maximum # of modules/drivers on a stream */
      426 +volatile ssize_t strctlsz = 1024;   /* maximum size of user-generated M_PROTO */
      427 +volatile ssize_t strmsgsz = 0x10000; /* maximum size of user-generated M_DATA */
 427  428                                  /* for `strmsgsz', zero means unlimited */
 428  429  /*
 429  430   * Filesystem tunables
 430  431   */
 431      -int     rstchown = 1;           /* POSIX_CHOWN_RESTRICTED is enabled */
      432 +volatile int    rstchown = 1;   /* POSIX_CHOWN_RESTRICTED is enabled */
 432  433  int     ngroups_max = NGROUPS_MAX_DEFAULT;
 433  434  
 434  435  /*
 435  436   * generic scheduling stuff
 436  437   *
 437  438   * Configurable parameters for RT and TS are in the respective
 438  439   * scheduling class modules.
 439  440   */
 440  441  
 441  442  pri_t maxclsyspri = MAXCLSYSPRI;
↓ open down ↓ 37 lines elided ↑ open up ↑
 479  480  
 480  481  /*
 481  482   * If freemem < t_getpgslow, then start to steal pages from processes.
 482  483   */
 483  484  int tune_t_gpgslo = 25;
 484  485  
 485  486  /*
 486  487   * Rate at which fsflush is run, in seconds.
 487  488   */
 488  489  #define DEFAULT_TUNE_T_FSFLUSHR 1
 489      -int tune_t_fsflushr = DEFAULT_TUNE_T_FSFLUSHR;
      490 +volatile int tune_t_fsflushr = DEFAULT_TUNE_T_FSFLUSHR;
 490  491  
 491  492  /*
 492  493   * The minimum available resident (not swappable) memory to maintain
 493  494   * in order to avoid deadlock.  In pages.
 494  495   */
 495      -int tune_t_minarmem = 25;
      496 +volatile int tune_t_minarmem = 25;
 496  497  
 497  498  /*
 498  499   * The minimum available swappable memory to maintain in order to avoid
 499  500   * deadlock.  In pages.
 500  501   */
 501  502  int tune_t_minasmem = 25;
 502  503  
 503  504  int tune_t_flckrec = 512;       /* max # of active frlocks */
 504  505  
 505  506  /*
 506  507   * Number of currently available pages that cannot be 'locked'
 507  508   * This is set in init_pages_pp_maximum, and must be initialized
 508  509   * to zero here to detect an override in /etc/system
 509  510   */
 510      -pgcnt_t pages_pp_maximum = 0;
      511 +volatile pgcnt_t pages_pp_maximum = 0;
 511  512  
 512  513  int boothowto;                  /* boot flags passed to kernel */
 513  514  struct var v;                   /* System Configuration Information */
 514  515  
 515  516  /*
 516  517   * System Configuration Information
 517  518   */
 518  519  
 519  520  /*
 520  521   * The physical system's host identifier, expressed as a decimal string.
↓ open down ↓ 223 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX