From owner-p4-projects@FreeBSD.ORG Sat Feb 5 19:31:04 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8D93C10656A7; Sat, 5 Feb 2011 19:31:04 +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 4FD791065673 for ; Sat, 5 Feb 2011 19:31:04 +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 22C6C8FC22 for ; Sat, 5 Feb 2011 19:31:04 +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 p15JV4P8020627 for ; Sat, 5 Feb 2011 19:31:04 GMT (envelope-from trasz@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p15JV4vL020623 for perforce@freebsd.org; Sat, 5 Feb 2011 19:31:04 GMT (envelope-from trasz@freebsd.org) Date: Sat, 5 Feb 2011 19:31:04 GMT Message-Id: <201102051931.p15JV4vL020623@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 188571 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, 05 Feb 2011 19:31:04 -0000 http://p4web.freebsd.org/@@188571?ac=10 Change 188571 by trasz@trasz_victim on 2011/02/05 19:30:11 Improve comments. Affected files ... .. //depot/projects/soc2009/trasz_limits/sys/sys/rctl.h#11 edit Differences ... ==== //depot/projects/soc2009/trasz_limits/sys/sys/rctl.h#11 (text+ko) ==== @@ -51,21 +51,18 @@ #ifdef _KERNEL /* - * 'rctl_rule' describes a single limit configured by the system - * administrator or a temporary limit set using setrlimit(2). - * The difference between 'subject' and 'per' is best described - * by example: to specify that every process of user with uid 1984 - * can consume 1gb of virtual memory, the 'rr_subject_type' would be - * RCTL_SUBJECT_TYPE_USER, 'rctl_subject.rs_uip' would point to - * 'struct uidinfo' for uid 1984, and 'rr_per' would be equal - * RCTL_SUBJECT_TYPE_PROCESS. + * Rules describe an action to be taken when conditions defined + * in the rule are met. There is no global list of rules; instead, + * rules are linked to by the container structures for all the subjects + * they apply to - for example, a rule of type "user" is linked to the + * appropriate struct uidinfo, and to all the processes of that user. * * 'rr_refcount' is equal to the number of rctl_rule_link structures * pointing to the rule. * * This structure must never change after being added, via rctl_rule_link - * structures, to subjects. In order to change a limit, add a new - * rule and remove the previous one. + * structures, to subjects. In order to change a rule, add a new rule + * and remove the previous one. */ struct rctl_rule { int rr_subject_type; @@ -83,6 +80,9 @@ struct task rr_task; }; +/* + * Allowed values for rr_subject_type and rr_per fields. + */ #define RCTL_SUBJECT_TYPE_UNDEFINED -1 #define RCTL_SUBJECT_TYPE_PROCESS 0x0000 #define RCTL_SUBJECT_TYPE_USER 0x0001 @@ -91,9 +91,8 @@ #define RCTL_SUBJECT_TYPE_MAX RCTL_SUBJECT_TYPE_JAIL /* - * 'rr_per' takes the same flags as 'rr_subject_type'. + * Allowed values for rr_action field. */ - #define RCTL_ACTION_UNDEFINED -1 #define RCTL_ACTION_SIGHUP SIGHUP #define RCTL_ACTION_SIGINT SIGINT