Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Jul 2018 22:48:18 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r336232 - head/sys/kern
Message-ID:  <201807122248.w6CMmI0O035683@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Thu Jul 12 22:48:18 2018
New Revision: 336232
URL: https://svnweb.freebsd.org/changeset/base/336232

Log:
  fd: stop passing M_ZERO to uma_zalloc
  
  The optimisation seen with malloc cannot be used here as zone sizes are
  now known at compilation. Thus bzero by hand to get the optimisation
  instead.

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Thu Jul 12 22:35:52 2018	(r336231)
+++ head/sys/kern/kern_descrip.c	Thu Jul 12 22:48:18 2018	(r336232)
@@ -1865,7 +1865,8 @@ falloc_noinstall(struct thread *td, struct file **resu
 		}
 		return (ENFILE);
 	}
-	fp = uma_zalloc(file_zone, M_WAITOK | M_ZERO);
+	fp = uma_zalloc(file_zone, M_WAITOK);
+	bzero(fp, sizeof(*fp));
 	refcount_init(&fp->f_count, 1);
 	fp->f_cred = crhold(td->td_ucred);
 	fp->f_ops = &badfileops;



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