Module Name:    src
Committed By:   mlelstv
Date:           Sun Oct  6 07:15:34 UTC 2019

Modified Files:
        src/sys/sys: filedesc.h

Log Message:
Use multiple cache lines for fd_dfdfile elements when necessary.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/sys/filedesc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/sys/filedesc.h
diff -u src/sys/sys/filedesc.h:1.64 src/sys/sys/filedesc.h:1.65
--- src/sys/sys/filedesc.h:1.64	Tue Dec 26 08:30:58 2017
+++ src/sys/sys/filedesc.h	Sun Oct  6 07:15:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: filedesc.h,v 1.64 2017/12/26 08:30:58 kamil Exp $	*/
+/*	$NetBSD: filedesc.h,v 1.65 2019/10/06 07:15:34 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -112,6 +112,8 @@ typedef struct fdfile {
 	kcondvar_t	ff_closing;	/* d: notifier for close */
 } fdfile_t;
 
+#define FDFILE_SIZE ((sizeof(fdfile_t)+CACHE_LINE_SIZE-1)/CACHE_LINE_SIZE*CACHE_LINE_SIZE)
+
 /* Reference count */
 #define	FR_CLOSING	(0x80000000)	/* closing: must interlock */
 #define	FR_MASK		(~FR_CLOSING)	/* reference count */
@@ -132,7 +134,7 @@ typedef struct filedesc {
 	 * Built-in fdfile_t records first, since they have strict
 	 * alignment requirements.
 	 */
-	uint8_t		fd_dfdfile[NDFDFILE][CACHE_LINE_SIZE];
+	uint8_t		fd_dfdfile[NDFDFILE][FDFILE_SIZE];
 	/*
 	 * All of the remaining fields are locked by fd_lock.
 	 */

Reply via email to