From: Pavel Roschin <roshin@scriptumplus.ru>
To: selinux@tycho.nsa.gov
Subject: avtab dense hash table
Date: Thu, 5 Dec 2013 13:04:31 +0400 [thread overview]
Message-ID: <20131205130431.7fe3c727.roshin@scriptumplus.ru> (raw)
Hello, I have some questions about hash tables in SELinux. As I see, all AV
rules are stored inside hash tables: I found them in kernel source and in
libsepol source. All types, domains, classes and so on also stored inside hash
tables.
Regarding source code of libsepol I see that all hash tables are fixed-size:
maximum avtab size is 2^13 - 8192 buckets. But in RHEL seinfo shows that there
are 250000+ allow rules and 170000+ dontaudit rules. Shouldn't that be a huge
performance kick?
In Linux kernel, avtab has size 2^11 - 2048 buckets for 256000+ av rules. Huge
hash table will be transformed into lists and linear search that should be slow
as hell, shouldn't?
>From kernel source:
#define MAX_AVTAB_HASH_BITS 11
#define MAX_AVTAB_HASH_BUCKETS (1 << MAX_AVTAB_HASH_BITS)
#define MAX_AVTAB_HASH_MASK (MAX_AVTAB_HASH_BUCKETS-1)
What is the reason of such dense hash maps?
--
Best regards,
Pavel Roschin
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next reply other threads:[~2013-12-05 9:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-05 9:04 Pavel Roschin [this message]
2013-12-05 14:15 ` avtab dense hash table Stephen Smalley
2013-12-05 15:49 ` Dominick Grift
2013-12-05 21:16 ` Stephen Smalley
2013-12-05 21:37 ` Dominick Grift
2013-12-06 13:51 ` Stephen Smalley
2013-12-06 14:14 ` Daniel J Walsh
2013-12-06 15:46 ` Dominick Grift
2013-12-06 16:01 ` Daniel J Walsh
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=20131205130431.7fe3c727.roshin@scriptumplus.ru \
--to=roshin@scriptumplus.ru \
--cc=selinux@tycho.nsa.gov \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.