Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Sep 2019 00:33:16 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r351650 - head/sys/kern
Message-ID:  <201909010033.x810XGa9036904@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Sun Sep  1 00:33:16 2019
New Revision: 351650
URL: https://svnweb.freebsd.org/changeset/base/351650

Log:
  posixshm: switch to OBJT_SWAP in advance of other changes
  
  Future changes to posixshm will start tracking writeable mappings in order
  to support file sealing. Tracking writeable mappings for an OBJT_DEFAULT
  object is complicated as it may be swapped out and converted to an
  OBJT_SWAP. One may generically add this tracking for vm_object, but this is
  difficult to do without increasing memory footprint of vm_object and blowing
  up memory usage by a significant amount.
  
  On the other hand, the swap pager can be expanded to track writeable
  mappings without increasing vm_object size. This change is currently in
  D21456. Switch over to OBJT_SWAP in advance of the other changes to the
  swap pager and posixshm.

Modified:
  head/sys/kern/uipc_shm.c

Modified: head/sys/kern/uipc_shm.c
==============================================================================
--- head/sys/kern/uipc_shm.c	Sat Aug 31 21:28:06 2019	(r351649)
+++ head/sys/kern/uipc_shm.c	Sun Sep  1 00:33:16 2019	(r351650)
@@ -549,7 +549,7 @@ shm_alloc(struct ucred *ucred, mode_t mode)
 	shmfd->shm_uid = ucred->cr_uid;
 	shmfd->shm_gid = ucred->cr_gid;
 	shmfd->shm_mode = mode;
-	shmfd->shm_object = vm_pager_allocate(OBJT_DEFAULT, NULL,
+	shmfd->shm_object = vm_pager_allocate(OBJT_SWAP, NULL,
 	    shmfd->shm_size, VM_PROT_DEFAULT, 0, ucred);
 	KASSERT(shmfd->shm_object != NULL, ("shm_create: vm_pager_allocate"));
 	shmfd->shm_object->pg_color = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909010033.x810XGa9036904>