Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Apr 2015 04:34:01 +0200
From:      Mateusz Guzik <mjguzik@gmail.com>
To:        freebsd-arch@freebsd.org
Cc:        Mateusz Guzik <mjg@freebsd.org>
Subject:   [PATCH 0/2] generalised cow per-thread structs
Message-ID:  <1430188443-19413-1-git-send-email-mjguzik@gmail.com>

next in thread | raw e-mail | index | archive | help
From: Mateusz Guzik <mjg@freebsd.org>

struct ucred is managed per thread as follows:
setuid and the like updated the pointer in struct proc
on kernel<->userspace boundary it is checked whether the thread needs
updating

This scheme is useful for other structures as well, so this patch
generalises it by introducing a counter which is compared instead.
This prevents introduction of further comparisons as such structures
are added.

The first patch just adds convenience funcs and adjusts cred handling
to use it.

The second patch implements lockless resource limits.

The bigger goal concerns struct filedesc - the plan is to split it to
fd part and vnode part. The latter is seldomly modified, se could be
accessed locklessly and with further effort can save some refs/unrefs
on vnodes since we will be sure they cannot go away.

Mateusz Guzik (2):
  Generalised support for copy-on-write structures shared by threads.
  Implement lockless resource limits.

 contrib/binutils/ld/emultempl/spu_ovl.o | Bin 1432 -> 0 bytes
 sys/amd64/amd64/trap.c                  |   4 +-
 sys/arm/arm/trap-v6.c                   |   4 +-
 sys/arm/arm/trap.c                      |  11 +++--
 sys/i386/i386/trap.c                    |   4 +-
 sys/kern/imgact_elf.c                   |  13 +++---
 sys/kern/init_main.c                    |   8 ++--
 sys/kern/kern_descrip.c                 |  24 +++++-----
 sys/kern/kern_event.c                   |   6 +--
 sys/kern/kern_exec.c                    |   4 +-
 sys/kern/kern_fork.c                    |   7 ++-
 sys/kern/kern_kthread.c                 |   2 +-
 sys/kern/kern_proc.c                    |   7 +--
 sys/kern/kern_prot.c                    |   5 ++-
 sys/kern/kern_resource.c                |  77 +++++++++++++++++++-------------
 sys/kern/kern_sig.c                     |   2 +-
 sys/kern/kern_syscalls.c                |   3 ++
 sys/kern/kern_thr.c                     |   6 +--
 sys/kern/kern_thread.c                  |  49 ++++++++++++++++++--
 sys/kern/subr_syscall.c                 |   4 +-
 sys/kern/subr_trap.c                    |   4 +-
 sys/kern/subr_uio.c                     |   4 +-
 sys/kern/sysv_shm.c                     |   4 +-
 sys/kern/tty_pts.c                      |   4 +-
 sys/kern/uipc_sockbuf.c                 |   4 +-
 sys/kern/vfs_vnops.c                    |   7 ++-
 sys/powerpc/powerpc/trap.c              |   4 +-
 sys/sparc64/sparc64/trap.c              |   4 +-
 sys/sys/proc.h                          |  14 +++++-
 sys/sys/resourcevar.h                   |   9 ++--
 sys/sys/vnode.h                         |   2 +-
 sys/vm/swap_pager.c                     |   4 +-
 sys/vm/vm_map.c                         |  14 +++---
 sys/vm/vm_mmap.c                        |  34 +++++++-------
 sys/vm/vm_pageout.c                     |   2 +-
 sys/vm/vm_unix.c                        |   8 ++--
 36 files changed, 208 insertions(+), 154 deletions(-)
 delete mode 100644 contrib/binutils/ld/emultempl/spu_ovl.o

-- 
2.3.6




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1430188443-19413-1-git-send-email-mjguzik>