Print this page
916 False-sharing in TCP hash buckets, plus size increase
        (originally Joyent OS-299 tcp_bindi() hash lock contention affects
        TCP client performance)

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/tcp.h
          +++ new/usr/src/uts/common/inet/tcp.h
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
       23 + * Copyright (c) 2011, Joyent, Inc. All rights reserved.
  23   24   */
  24   25  /* Copyright (c) 1990 Mentat Inc. */
  25   26  
  26   27  #ifndef _INET_TCP_H
  27   28  #define _INET_TCP_H
  28   29  
  29   30  #ifdef  __cplusplus
  30   31  extern "C" {
  31   32  #endif
  32   33  
↓ open down ↓ 456 lines elided ↑ open up ↑
 489  490  #endif
 490  491  
 491  492  extern void     tcp_conn_reclaim(void *);
 492  493  extern void     tcp_free(tcp_t *tcp);
 493  494  extern void     tcp_ddi_g_init(void);
 494  495  extern void     tcp_ddi_g_destroy(void);
 495  496  extern void     *tcp_get_conn(void *arg, tcp_stack_t *);
 496  497  extern mblk_t   *tcp_snmp_get(queue_t *, mblk_t *, boolean_t);
 497  498  extern int      tcp_snmp_set(queue_t *, int, int, uchar_t *, int len);
 498  499  
      500 +/* Pad for the tf_t structure to avoid false cache line sharing. */
      501 +#define TF_CACHEL_PAD   64
      502 +
 499  503  /*
 500  504   * The TCP Fanout structure for bind and acceptor hashes.
 501  505   * The hash tables and their linkage (tcp_*_hash, tcp_ptp*hn) are
 502  506   * protected by the per-bucket tf_lock.  Each tcp_t
 503  507   * inserted in the list points back at this lock using tcp_*_lockp.
 504  508   *
 505  509   * The bind and acceptor hash queues are lists of tcp_t.
 506  510   */
 507  511  /* listener hash and acceptor hash queue head */
 508  512  typedef struct tf_s {
 509  513          tcp_t           *tf_tcp;
 510  514          kmutex_t        tf_lock;
      515 +        unsigned char   tf_pad[TF_CACHEL_PAD -
      516 +            (sizeof (tcp_t *) + sizeof (kmutex_t))];
 511  517  } tf_t;
 512  518  
 513  519  
 514  520  /* Also used in ipclassifier.c */
 515  521  extern struct kmem_cache  *tcp_sack_info_cache;
 516  522  
 517  523  #endif  /* (defined(_KERNEL) || defined(_KMEMUSER)) */
 518  524  
 519  525  /* Contract private interface between TCP and Clustering. */
 520  526  
↓ open down ↓ 56 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX