[PATCH 19/22] SELinux: Use shared NoopDDA to utilize code cache better

Pauli ext-pauli.nieminen at nokia.com
Wed Dec 29 11:27:31 PST 2010


From: Pauli Nieminen <ext-pauli.nieminen at nokia.com>

Calling function that is in code cache is order of magnitude faster. In
arm non-cached simple function takes about 1us while cached function
takes max 200ns.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
---
 Xext/xselinux_hooks.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/Xext/xselinux_hooks.c b/Xext/xselinux_hooks.c
index 560e1e9..7962cb1 100644
--- a/Xext/xselinux_hooks.c
+++ b/Xext/xselinux_hooks.c
@@ -804,11 +804,6 @@ SELinuxResourceState(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 static int netlink_fd;
 
 static void
-SELinuxBlockHandler(void *data, struct timeval **tv, void *read_mask)
-{
-}
-
-static void
 SELinuxWakeupHandler(void *data, int err, void *read_mask)
 {
     if (FD_ISSET(netlink_fd, (fd_set *)read_mask))
@@ -838,7 +833,7 @@ SELinuxFlaskReset(void)
     /* Tear down SELinux stuff */
     audit_close(audit_fd);
     avc_netlink_release_fd();
-    RemoveBlockAndWakeupHandlers(SELinuxBlockHandler, SELinuxWakeupHandler,
+    RemoveBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, SELinuxWakeupHandler,
                                  NULL);
     RemoveGeneralSocket(netlink_fd);
 
@@ -908,7 +903,7 @@ SELinuxFlaskInit(void)
 
     netlink_fd = avc_netlink_acquire_fd();
     AddGeneralSocket(netlink_fd);
-    RegisterBlockAndWakeupHandlers(SELinuxBlockHandler, SELinuxWakeupHandler,
+    RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, SELinuxWakeupHandler,
                                    NULL);
 
     /* Register callbacks */
-- 
1.7.0.4



More information about the xorg-devel mailing list