Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966038AbXFGTwW (ORCPT ); Thu, 7 Jun 2007 15:52:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S965425AbXFGTwK (ORCPT ); Thu, 7 Jun 2007 15:52:10 -0400 Received: from mx2.mail.elte.hu ([157.181.151.9]:47748 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965475AbXFGTwJ (ORCPT ); Thu, 7 Jun 2007 15:52:09 -0400 Date: Thu, 7 Jun 2007 21:51:51 +0200 From: Ingo Molnar To: Stephen Smalley Cc: linux-kernel@vger.kernel.org, Andrew Morton , James Carter , Paul Moore , James Morris Subject: Re: [bug] very high non-preempt latency in context_struct_compute_av() Message-ID: <20070607195151.GA30899@elte.hu> References: <20070604112745.GA26350@elte.hu> <1181244850.11979.66.camel@moss-spartans.epoch.ncsc.mil> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1181244850.11979.66.camel@moss-spartans.epoch.ncsc.mil> User-Agent: Mutt/1.5.14 (2007-02-12) X-ELTE-VirusStatus: clean X-ELTE-SpamScore: -2.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-2.0 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.1.7 -2.0 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1378 Lines: 35 * Stephen Smalley wrote: > Can you try the patch below to see whether it helps? > > In security_get_user_sids, move the transition permission checks > outside of the section holding the policy rdlock, and use the AVC to > perform the checks, calling cond_resched after each one. These > changes should allow preemption between the individual checks and > enable caching of the results. It may however increase the overall > time spent in the function in some cases, particularly in the cache > miss case. > > The long term fix will be to take much of this logic to userspace by > exporting additional state via selinuxfs, and ultimately deprecating > and eliminating this interface from the kernel. > > Signed-off-by: Stephen Smalley i have just tried your patch and it completely solves the issue! Without the patch, a simple script that keeps logging in on a box: while :; do ssh testbox true; done would cause glxgears to get into a very jerky motion due to the latencies. With the patch it's 100%, totally smooth! Thanks! Tested-by: Ingo Molnar Ingo - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/