From owner-svn-src-head@FreeBSD.ORG Wed Jun 10 12:16:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6EA5B57B; Wed, 10 Jun 2015 12:16:18 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv158.fwdcdn.com (frv158.fwdcdn.com [212.42.77.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1E9B1DCD; Wed, 10 Jun 2015 12:16:17 +0000 (UTC) (envelope-from fidaj@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=8LYFy5Ak+P/YyEsaGV4Jk8/qy4izFQh5f3FA/t2i0Sw=; b=SUf8Fpr05beqf23ZrK9z/RvXLKUmB3ASKWCybk0Xm+xHWyzk2ly6uC9WDzsEfBeFCqlxJaNZ/o0/GMD3952tqhXmqYsbH26cntvKZyvpfB9CJFCMsRuODj+UuMP4x0mdWFsJuiwrxAbLamXv/nF/KAEdj3SEYfBbYreVwdzc9Xk=; Received: from [134.249.91.180] (helo=nonamehost.local) by frv158.fwdcdn.com with esmtpsa ID 1Z2evW-000HfR-El ; Wed, 10 Jun 2015 15:16:14 +0300 Date: Wed, 10 Jun 2015 15:16:13 +0300 From: Ivan Klymenko To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284215 - in head/sys: amd64/linux32 compat/linux compat/svr4 dev/drm2/i915 fs/fdescfs i386/ibcs2 i386/linux kern ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mthca sys vm Message-ID: <20150610151613.1176c1e3@nonamehost.local> In-Reply-To: <201506101048.t5AAmD1O029382@svn.freebsd.org> References: <201506101048.t5AAmD1O029382@svn.freebsd.org> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Authentication-Result: IP=134.249.91.180; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2015 12:16:18 -0000 Wed, 10 Jun 2015 10:48:13 +0000 (UTC) Mateusz Guzik =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=B2: > Author: mjg > Date: Wed Jun 10 10:48:12 2015 > New Revision: 284215 > URL: https://svnweb.freebsd.org/changeset/base/284215 >=20 > Log: > Implement lockless resource limits. > =20 > Use the same scheme implemented to manage credentials. > =20 > Code needing to look at process's credentials (as opposed to > thred's) is provided with *_proc variants of relevant functions. > =20 > Places which possibly had to take the proc lock anyway still use > the proc pointer to access limits. >=20 > Modified: > head/sys/amd64/linux32/linux32_machdep.c > head/sys/compat/linux/linux_misc.c > head/sys/compat/svr4/imgact_svr4.c > head/sys/compat/svr4/svr4_misc.c > head/sys/compat/svr4/svr4_resource.c > head/sys/dev/drm2/i915/i915_gem.c > head/sys/fs/fdescfs/fdesc_vfsops.c > head/sys/i386/ibcs2/ibcs2_misc.c > head/sys/i386/linux/imgact_linux.c > head/sys/i386/linux/linux_machdep.c > head/sys/kern/imgact_aout.c > head/sys/kern/imgact_elf.c > head/sys/kern/imgact_gzip.c > head/sys/kern/kern_descrip.c > head/sys/kern/kern_event.c > head/sys/kern/kern_exec.c > head/sys/kern/kern_fork.c > head/sys/kern/kern_proc.c > head/sys/kern/kern_resource.c > head/sys/kern/kern_sig.c > head/sys/kern/kern_syscalls.c > head/sys/kern/kern_thread.c > head/sys/kern/subr_uio.c > head/sys/kern/sysv_shm.c > head/sys/kern/tty_pts.c > head/sys/kern/uipc_sockbuf.c > head/sys/kern/vfs_vnops.c > head/sys/ofed/drivers/infiniband/core/umem.c > head/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c > head/sys/sys/proc.h > head/sys/sys/resourcevar.h > head/sys/sys/vnode.h > head/sys/vm/swap_pager.c > head/sys/vm/vm_map.c > head/sys/vm/vm_mmap.c > head/sys/vm/vm_pageout.c > head/sys/vm/vm_unix.c >=20 > ... /head/sys/amd64/linux/linux_machdep.c --- linux_machdep.c.orig 2015-06-10 14:57:12.171984000 +0300 +++ linux_machdep.c 2015-06-10 14:57:22.662331000 +0300 @@ -251,7 +251,7 @@ */ PROC_LOCK(p); p->p_vmspace->vm_maxsaddr =3D (char *)USRSTACK - - lim_cur(p, RLIMIT_STACK); + lim_cur_proc(p, RLIMIT_STACK); PROC_UNLOCK(p); } must also change because: ... --- linux_stats.o --- /usr/local/libexec/ccache/world/cc -target x86_64-unknown-freebsd11.0 --sys= root=3D/media/da0s1/obj/usr/src/tmp -B/media/da0s1/obj/usr/src/tmp/usr/bin = -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc = -DHAVE_KERNEL_OPTION_HEADERS -include /media/da0s1/obj/usr/src/sys/mk11/opt= _global.h -I. -I/usr/src/sys -fno-common -g -fno-omit-frame-pointer -mno-om= it-leaf-frame-pointer -I/media/da0s1/obj/usr/src/sys/mk11 -mcmodel=3Dkerne= l -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-ta= bles -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-d= ecls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-a= rith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=3D__freeb= sd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknow= n-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-erro= r-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign = -mno-aes -mno-avx -std=3Diso9899:1999 -c /usr/src/sys/modules/linux64/../= ../compat/linux/linux_stats.c -o linux_stats.o --- linux_machdep.o --- distcc[26181] ERROR: compile /usr/src/sys/modules/linux64/../../amd64/linux= /linux_machdep.c on localhost failed /usr/src/sys/modules/linux64/../../amd64/linux/linux_machdep.c:254:16: erro= r: incompatible pointer types passing 'struct proc *' to parameter of type = 'struct thread *' [-Werror,-Wincompatible-pointer-types] lim_cur(p, RLIMIT_STACK); ^ /usr/src/sys/sys/resourcevar.h:133:32: note: passing argument to parameter = 'td' here rlim_t lim_cur(struct thread *td, int which); ^ 1 error generated. *** [linux_machdep.o] Error code 1 make[4]: stopped in /usr/src/sys/modules/linux64 --- linux_stats.o --- ctfconvert -L VERSION -g linux_stats.o --- linux_file.o --- ctfconvert -L VERSION -g linux_file.o --- linux_misc.o --- ctfconvert -L VERSION -g linux_misc.o 1 error make[4]: stopped in /usr/src/sys/modules/linux64 *** [all_subdir_linux64] Error code 2 make[3]: stopped in /usr/src/sys/modules --- all_subdir_mac_lomac --- ctfconvert -L VERSION -g mac_lomac.o A failure has been detected in another branch of the parallel make make[4]: stopped in /usr/src/sys/modules/mac_lomac *** [all_subdir_mac_lomac] Error code 2 make[3]: stopped in /usr/src/sys/modules 2 errors make[3]: stopped in /usr/src/sys/modules *** [modules-all] Error code 2 make[2]: stopped in /media/da0s1/obj/usr/src/sys/mk11 1 error make[2]: stopped in /media/da0s1/obj/usr/src/sys/mk11 *** [buildkernel] Error code 2 make[1]: stopped in /usr/src 1 error make[1]: stopped in /usr/src *** [buildkernel] Error code 2 make: stopped in /usr/src 1 error make: stopped in /usr/src and something must be changed /usr/local/libexec/ccache/world/cc -target x86_64-unknown-freebsd11.0 --sys= root=3D/media/da0s1/obj/usr/src/tmp -B/media/da0s1/obj/usr/src/tmp/usr/bin = -c -O2 -pipe -fno-strict-aliasing -g -nostdinc -I. -I/usr/src/sys -I/usr/= src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_= global.h -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mcmodel=3Dk= ernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwin= d-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredunda= nt-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpoint= er-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=3D__f= reebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-un= known-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-= error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-s= ign -mno-aes -mno-avx -std=3Diso9899:1999 -Werror /usr/src/sys/kern/kern= _fork.c --- kern_cons.o --- ctfconvert -L VERSION -g kern_cons.o --- kern_descrip.o --- distcc[27122] ERROR: compile /usr/src/sys/kern/kern_descrip.c on localhost = failed /usr/src/sys/kern/kern_descrip.c:338:12: error: use of undeclared identifie= r 'p' PROC_LOCK(p); ^ /usr/src/sys/sys/proc.h:778:33: note: expanded from macro 'PROC_LOCK' #define PROC_LOCK(p) mtx_lock(&(p)->p_mtx) ^ /usr/src/sys/sys/mutex.h:305:38: note: expanded from macro 'mtx_lock' #define mtx_lock(m) mtx_lock_flags((m), 0) ^ /usr/src/sys/sys/mutex.h:366:19: note: expanded from macro 'mtx_lock_flags' mtx_lock_flags_((m), (opts), LOCK_FILE, LOCK_LINE) ^ /usr/src/sys/sys/mutex.h:345:14: note: expanded from macro 'mtx_lock_flags_' __mtx_lock((m), curthread, (opts), (file), (line)) ^ /usr/src/sys/sys/mutex.h:188:25: note: expanded from macro '__mtx_lock' if (!_mtx_obtain_lock((mp), _tid)) \ ^ /usr/src/sys/sys/mutex.h:168:26: note: expanded from macro '_mtx_obtain_loc= k' atomic_cmpset_acq_ptr(&(mp)->mtx_lock, MTX_UNOWNED, (tid)) ^ /usr/src/sys/kern/kern_descrip.c:338:12: error: use of undeclared identifie= r 'p' /usr/src/sys/sys/proc.h:778:33: note: expanded from macro 'PROC_LOCK' #define PROC_LOCK(p) mtx_lock(&(p)->p_mtx) ^ /usr/src/sys/sys/mutex.h:305:38: note: expanded from macro 'mtx_lock' #define mtx_lock(m) mtx_lock_flags((m), 0) ^ /usr/src/sys/sys/mutex.h:366:19: note: expanded from macro 'mtx_lock_flags' mtx_lock_flags_((m), (opts), LOCK_FILE, LOCK_LINE) ^ /usr/src/sys/sys/mutex.h:345:14: note: expanded from macro 'mtx_lock_flags_' __mtx_lock((m), curthread, (opts), (file), (line)) ^ /usr/src/sys/sys/mutex.h:189:20: note: expanded from macro '__mtx_lock' _mtx_lock_sleep((mp), _tid, (opts), (file), (line)); \ ^ /usr/src/sys/sys/mutex.h:142:21: note: expanded from macro '_mtx_lock_sleep' __mtx_lock_sleep(&(m)->mtx_lock, t, o, f, l) ^ /usr/src/sys/kern/kern_descrip.c:338:12: error: use of undeclared identifie= r 'p' /usr/src/sys/sys/proc.h:778:33: note: expanded from macro 'PROC_LOCK' #define PROC_LOCK(p) mtx_lock(&(p)->p_mtx) ^ /usr/src/sys/sys/mutex.h:305:38: note: expanded from macro 'mtx_lock' #define mtx_lock(m) mtx_lock_flags((m), 0) ^ /usr/src/sys/sys/mutex.h:366:19: note: expanded from macro 'mtx_lock_flags' mtx_lock_flags_((m), (opts), LOCK_FILE, LOCK_LINE) ^ /usr/src/sys/sys/mutex.h:345:14: note: expanded from macro 'mtx_lock_flags_' __mtx_lock((m), curthread, (opts), (file), (line)) ^ /usr/src/sys/sys/mutex.h:192:7: note: expanded from macro '__mtx_lock' mp, 0, 0, (file), (line)); \ ^ /usr/src/sys/sys/lockstat.h:190:42: note: expanded from macro 'LOCKSTAT_PRO= FILE_OBTAIN_LOCK_SUCCESS' (*lockstat_probe_func)(id, (uintptr_t)(lp), 0, 0, 0, 0); = \ ^ /usr/src/sys/kern/kern_descrip.c:340:14: error: use of undeclared identifie= r 'p' PROC_UNLOCK(p); ^ /usr/src/sys/sys/proc.h:780:37: note: expanded from macro 'PROC_UNLOCK' #define PROC_UNLOCK(p) mtx_unlock(&(p)->p_mtx) ^ /usr/src/sys/sys/mutex.h:308:42: note: expanded from macro 'mtx_unlock' #define mtx_unlock(m) mtx_unlock_flags((m), 0) ^ /usr/src/sys/sys/mutex.h:368:21: note: expanded from macro 'mtx_unlock_flag= s' mtx_unlock_flags_((m), (opts), LOCK_FILE, LOCK_LINE) ^ /usr/src/sys/sys/mutex.h:347:16: note: expanded from macro 'mtx_unlock_flag= s_' __mtx_unlock((m), curthread, (opts), (file), (line)) ^ /usr/src/sys/sys/mutex.h:233:7: note: expanded from macro '__mtx_unlock' if ((mp)->mtx_recurse =3D=3D 0) = \ ^ /usr/src/sys/kern/kern_descrip.c:340:14: error: use of undeclared identifie= r 'p' /usr/src/sys/sys/proc.h:780:37: note: expanded from macro 'PROC_UNLOCK' #define PROC_UNLOCK(p) mtx_unlock(&(p)->p_mtx) ^ /usr/src/sys/sys/mutex.h:308:42: note: expanded from macro 'mtx_unlock' #define mtx_unlock(m) mtx_unlock_flags((m), 0) ^ /usr/src/sys/sys/mutex.h:368:21: note: expanded from macro 'mtx_unlock_flag= s' mtx_unlock_flags_((m), (opts), LOCK_FILE, LOCK_LINE) ^ /usr/src/sys/sys/mutex.h:347:16: note: expanded from macro 'mtx_unlock_flag= s_' __mtx_unlock((m), curthread, (opts), (file), (line)) ^ /usr/src/sys/sys/mutex.h:235:8: note: expanded from macro '__mtx_unlock' (mp)); \ ^ /usr/src/sys/sys/lockstat.h:198:42: note: expanded from macro 'LOCKSTAT_PRO= FILE_RELEASE_LOCK' (*lockstat_probe_func)(id, (uintptr_t)(lp), 0, 0, 0, 0); = \ ^ /usr/src/sys/kern/kern_descrip.c:340:14: error: use of undeclared identifie= r 'p' /usr/src/sys/sys/proc.h:780:37: note: expanded from macro 'PROC_UNLOCK' #define PROC_UNLOCK(p) mtx_unlock(&(p)->p_mtx) ^ /usr/src/sys/sys/mutex.h:308:42: note: expanded from macro 'mtx_unlock' #define mtx_unlock(m) mtx_unlock_flags((m), 0) ^ /usr/src/sys/sys/mutex.h:368:21: note: expanded from macro 'mtx_unlock_flag= s' mtx_unlock_flags_((m), (opts), LOCK_FILE, LOCK_LINE) ^ /usr/src/sys/sys/mutex.h:347:16: note: expanded from macro 'mtx_unlock_flag= s_' __mtx_unlock((m), curthread, (opts), (file), (line)) ^ /usr/src/sys/sys/mutex.h:236:26: note: expanded from macro '__mtx_unlock' if (!_mtx_release_lock((mp), _tid)) \ ^ /usr/src/sys/sys/mutex.h:172:26: note: expanded from macro '_mtx_release_lo= ck' atomic_cmpset_rel_ptr(&(mp)->mtx_lock, (tid), MTX_UNOWNED) ^ /usr/src/sys/kern/kern_descrip.c:340:14: error: use of undeclared identifie= r 'p' /usr/src/sys/sys/proc.h:780:37: note: expanded from macro 'PROC_UNLOCK' #define PROC_UNLOCK(p) mtx_unlock(&(p)->p_mtx) ^ /usr/src/sys/sys/mutex.h:308:42: note: expanded from macro 'mtx_unlock' #define mtx_unlock(m) mtx_unlock_flags((m), 0) ^ /usr/src/sys/sys/mutex.h:368:21: note: expanded from macro 'mtx_unlock_flag= s' mtx_unlock_flags_((m), (opts), LOCK_FILE, LOCK_LINE) ^ /usr/src/sys/sys/mutex.h:347:16: note: expanded from macro 'mtx_unlock_flag= s_' __mtx_unlock((m), curthread, (opts), (file), (line)) ^ /usr/src/sys/sys/mutex.h:237:22: note: expanded from macro '__mtx_unlock' _mtx_unlock_sleep((mp), (opts), (file), (line)); \ ^ /usr/src/sys/sys/mutex.h:144:23: note: expanded from macro '_mtx_unlock_sle= ep' __mtx_unlock_sleep(&(m)->mtx_lock, o, f, l) ^ 7 errors generated. *** [kern_descrip.o] Error code 1 make[2]: stopped in /media/da0s1/obj/usr/src/sys/mk11 --- kern_exec.o --- ctfconvert -L VERSION -g kern_exec.o --- kern_exit.o --- ctfconvert -L VERSION -g kern_exit.o --- kern_fork.o --- ctfconvert -L VERSION -g kern_fork.o 1 error make[2]: stopped in /media/da0s1/obj/usr/src/sys/mk11 *** [buildkernel] Error code 2 make[1]: stopped in /usr/src 1 error make[1]: stopped in /usr/src *** [buildkernel] Error code 2 make: stopped in /usr/src 1 error make: stopped in /usr/src