From: Stephen Smalley <sds@tycho.nsa.gov>
To: Dave Jones <davej@redhat.com>,
Linux Kernel <linux-kernel@vger.kernel.org>,
pmoore@redhat.com, eparis@redhat.com
Subject: Re: [2/2] conditionally reschedule in hashtab_insert while loading selinux policy.
Date: Thu, 15 May 2014 15:18:35 -0400 [thread overview]
Message-ID: <5375130B.8010303@tycho.nsa.gov> (raw)
In-Reply-To: <20140515190353.GB16816@redhat.com>
On 05/15/2014 03:03 PM, Dave Jones wrote:
> After silencing the sleeping warning in mls_convert_context() I started
> seeing similar traces from hashtab_insert. Do a cond_resched there too.
>
> Signed-off-by: Dave Jones <davej@redhat.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
>
> diff --git a/security/selinux/ss/hashtab.c b/security/selinux/ss/hashtab.c
> index 933e735bb185..2cc496149842 100644
> --- a/security/selinux/ss/hashtab.c
> +++ b/security/selinux/ss/hashtab.c
> @@ -6,6 +6,7 @@
> #include <linux/kernel.h>
> #include <linux/slab.h>
> #include <linux/errno.h>
> +#include <linux/sched.h>
> #include "hashtab.h"
>
> struct hashtab *hashtab_create(u32 (*hash_value)(struct hashtab *h, const void *key),
> @@ -40,6 +41,8 @@ int hashtab_insert(struct hashtab *h, void *key, void *datum)
> u32 hvalue;
> struct hashtab_node *prev, *cur, *newnode;
>
> + cond_resched();
> +
> if (!h || h->nel == HASHTAB_MAX_NODES)
> return -EINVAL;
>
>
next prev parent reply other threads:[~2014-05-15 19:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-15 19:03 [2/2] conditionally reschedule in hashtab_insert while loading selinux policy Dave Jones
2014-05-15 19:18 ` Stephen Smalley [this message]
2014-05-15 21:15 ` Paul Moore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5375130B.8010303@tycho.nsa.gov \
--to=sds@tycho.nsa.gov \
--cc=davej@redhat.com \
--cc=eparis@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pmoore@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox