From owner-p4-projects@FreeBSD.ORG Mon Jul 12 18:47:53 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D18661065677; Mon, 12 Jul 2010 18:47:52 +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 9617C1065673 for ; Mon, 12 Jul 2010 18:47:52 +0000 (UTC) (envelope-from trasz@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 846AA8FC0C for ; Mon, 12 Jul 2010 18:47:52 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o6CIlqFU082461 for ; Mon, 12 Jul 2010 18:47:52 GMT (envelope-from trasz@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o6CIlq6A082459 for perforce@freebsd.org; Mon, 12 Jul 2010 18:47:52 GMT (envelope-from trasz@freebsd.org) Date: Mon, 12 Jul 2010 18:47:52 GMT Message-Id: <201007121847.o6CIlq6A082459@repoman.freebsd.org> X-Authentication-Warning: repoman.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 180842 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: Mon, 12 Jul 2010 18:47:53 -0000 http://p4web.freebsd.org/@@180842?ac=10 Change 180842 by trasz@trasz_victim on 2010/07/12 18:47:26 Update comments and remove workaround for some long forgotten problem. Affected files ... .. //depot/projects/soc2009/trasz_limits/sys/kern/kern_hrl.c#86 edit Differences ... ==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_hrl.c#86 (text+ko) ==== @@ -214,7 +214,6 @@ case HRL_SUBJECT_TYPE_LOGINCLASS: available = rule->hr_amount - cred->cr_loginclass->lc_container.c_resources[resource]; - available = INT64_MAX; /* XXX */ break; case HRL_SUBJECT_TYPE_JAIL: available = rule->hr_amount - @@ -275,18 +274,8 @@ mtx_lock(&hrl_lock); /* - * It seems we've hit a limit. Figure out what to do. There may - * be more than one matching limit; go through all of them. Denial - * should be done last, after logging and sending signals. - * - * Note that it is possible to get here, and still not trigger - * any limit, because some of the resource got freed on another - * CPU after computing contents of the 'available' array. - */ - /* - * XXX: We should sort the rules somewhat, so that 'log' and 'sig' - * rules come before before 'deny', to spare iterations over - * the p_container.c_rule_links. + * There may be more than one matching rule; go through all of them. + * Denial should be done last, after logging and sending signals. */ LIST_FOREACH(link, &p->p_container.c_rule_links, hrl_next) { rule = link->hrl_rule;