From owner-p4-projects@FreeBSD.ORG Sat Jan 15 12:50:59 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DBEB110656A3; Sat, 15 Jan 2011 12:50:58 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A04991065697 for ; Sat, 15 Jan 2011 12:50:58 +0000 (UTC) (envelope-from trasz@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 8D8378FC1E for ; Sat, 15 Jan 2011 12:50:58 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p0FCowWO022783 for ; Sat, 15 Jan 2011 12:50:58 GMT (envelope-from trasz@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p0FCowKr022780 for perforce@freebsd.org; Sat, 15 Jan 2011 12:50:58 GMT (envelope-from trasz@freebsd.org) Date: Sat, 15 Jan 2011 12:50:58 GMT Message-Id: <201101151250.p0FCowKr022780@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to trasz@freebsd.org using -f From: Edward Tomasz Napierala To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 187838 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jan 2011 12:50:59 -0000 http://p4web.freebsd.org/@@187838?ac=10 Change 187838 by trasz@trasz_victim on 2011/01/15 12:50:18 Use FEATURE(). Affected files ... .. //depot/projects/soc2009/trasz_limits/sys/kern/kern_container.c#52 edit .. //depot/projects/soc2009/trasz_limits/sys/kern/kern_rctl.c#8 edit .. //depot/projects/soc2009/trasz_limits/usr.bin/userstat/userstat.sh#7 edit Differences ... ==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_container.c#52 (text+ko) ==== @@ -62,6 +62,8 @@ #ifdef CONTAINERS +FEATURE(containers, "Resource Containers"); + static struct mtx container_lock; MTX_SYSINIT(container_lock, &container_lock, "container lock", MTX_DEF); ==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_rctl.c#8 (text+ko) ==== @@ -63,13 +63,15 @@ #error "The RCTL option requires the CONTAINERS option" #endif +FEATURE(rctl, "Resource Limits"); + #define HRF_DEFAULT 0 #define HRF_DONT_INHERIT 1 #define HRF_DONT_ACCUMULATE 2 /* Default buffer size for rctl_get_rules(2). */ #define RCTL_DEFAULT_BUFSIZE 4096 -#define RCTL_LOG_BUFSIZE 128 +#define RCTL_LOG_BUFSIZE 128 /* * 'rctl_rule_link' connects a rule with every container it's related to. ==== //depot/projects/soc2009/trasz_limits/usr.bin/userstat/userstat.sh#7 (text+ko) ==== @@ -49,6 +49,12 @@ [ "$wait" ">" 0 ] || wait="0" [ "$count" ">" 0 ] || count="0" +sysctl kern.features.rctl > /dev/null 2>&1 +if [ $? -ne 0 ]; then + echo "no RCTL support in the kernel" 2>&1 + exit 1 +fi + n=0 while :; do if [ "`basename $0`" = "jailstat" ]; then