summaryrefslogtreecommitdiff
path: root/sys/ddb
diff options
context:
space:
mode:
authorad <ad@NetBSD.org>2009-05-24 21:41:25 +0000
committerad <ad@NetBSD.org>2009-05-24 21:41:25 +0000
commitd991fcb3b6084e8abc162cd006cfe3ad32a3bbf3 (patch)
treea72683aa4722bcaccc1875447f3f65e8cd5a472c /sys/ddb
parent13573078f8c68c3135a250c496868137890c2edd (diff)
More changes to improve kern_descrip.c.
- Avoid atomics in more places. - Remove the per-descriptor mutex, and just use filedesc_t::fd_lock. It was only being used to synchronize close, and in any case we needed to take fd_lock to free the descriptor slot. - Optimize certain paths for the <NDFDFILE case. - Sprinkle more comments and assertions. - Cache more stuff in filedesc_t. - Fix numerous minor bugs spotted along the way. - Restructure how the open files array is maintained, for clarity and so that we can eliminate the membar_consumer() call in fd_getfile(). This is mostly syntactic sugar; the main functional change is that fd_nfiles now lives alongside the open file array. Some measurements with libmicro: - simple file syscalls are like close() are between 1 to 10% faster. - some nice improvements, e.g. poll(1000) which is ~50% faster.
Diffstat (limited to 'sys/ddb')
-rw-r--r--sys/ddb/db_xxx.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/ddb/db_xxx.c b/sys/ddb/db_xxx.c
index 5dc983d8e2d..9ae1427b438 100644
--- a/sys/ddb/db_xxx.c
+++ b/sys/ddb/db_xxx.c
@@ -1,4 +1,4 @@
-/* $NetBSD: db_xxx.c,v 1.60 2009/03/21 13:06:39 ad Exp $ */
+/* $NetBSD: db_xxx.c,v 1.61 2009/05/24 21:41:25 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_xxx.c,v 1.60 2009/03/21 13:06:39 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_xxx.c,v 1.61 2009/05/24 21:41:25 ad Exp $");
#ifdef _KERNEL_OPT
#include "opt_kgdb.h"
@@ -106,6 +106,7 @@ db_show_files_cmd(db_expr_t addr, bool haddr,
file_t *fp;
struct vnode *vn;
bool full = false;
+ fdtab_t *dt;
if (modif[0] == 'f')
full = true;
@@ -113,8 +114,9 @@ db_show_files_cmd(db_expr_t addr, bool haddr,
p = (struct proc *) (uintptr_t) addr;
fdp = p->p_fd;
- for (i = 0; i < fdp->fd_nfiles; i++) {
- if ((ff = fdp->fd_ofiles[i]) == NULL)
+ dt = fdp->fd_dt;
+ for (i = 0; i < dt->dt_nfiles; i++) {
+ if ((ff = dt->dt_ff[i]) == NULL)
continue;
fp = ff->ff_file;