android_kernel_xiaomi_sm8350/security/selinux/ss
Eric Paris 9dc9978084 selinux: introduce schedule points in policydb_destroy()
During the LSPP testing we found that it was possible for
policydb_destroy() to take 10+ seconds of kernel time to complete.
Basically all policydb_destroy() does is walk some (possibly long) lists
and free the memory it finds.  Turning off slab debugging config options
made the problem go away since the actual functions which took most of
the time were (as seen by oprofile)

> 121202   23.9879  .check_poison_obj
> 78247    15.4864  .check_slabp

were caused by that.  So I decided to also add some voluntary schedule
points in that code so config voluntary preempt would be enough to solve
the problem.  Something similar was done in places like
shmem_free_pages() when we have to walk a list of memory and free it.
This was tested by the LSPP group on the hardware which could reproduce
the problem just loading a new policy and was found to not trigger the
softlock detector.  It takes just as much processing time, but the
kernel doesn't spend all that time stuck doing one thing and never
scheduling.

Someday a better way to handle memory might make the time needed in this
function a lot less, but this fixes the current issue as it stands
today.

Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
2007-07-11 22:52:23 -04:00
..
avtab.c Reassign printk levels in selinux kernel code 2007-02-26 14:43:07 -05:00
avtab.h
conditional.c
conditional.h
constraint.h
context.h selinux: Delete mls_copy_context 2007-01-08 17:32:51 -05:00
ebitmap.c NetLabel: convert to an extensibile/sparse category bitmap 2006-12-02 21:31:36 -08:00
ebitmap.h NetLabel: convert to an extensibile/sparse category bitmap 2006-12-02 21:31:36 -08:00
hashtab.c SELinux: ensure keys constant in hashtab_search 2006-11-28 12:04:37 -05:00
hashtab.h SELinux: ensure keys constant in hashtab_search 2006-11-28 12:04:37 -05:00
Makefile
mls_types.h
mls.c selinux: Delete mls_copy_context 2007-01-08 17:32:51 -05:00
mls.h selinux: Delete mls_copy_context 2007-01-08 17:32:51 -05:00
policydb.c selinux: introduce schedule points in policydb_destroy() 2007-07-11 22:52:23 -04:00
policydb.h
services.c selinux: add support for querying object classes and permissions from the running policy 2007-07-11 22:52:15 -04:00
services.h
sidtab.c Reassign printk levels in selinux kernel code 2007-02-26 14:43:07 -05:00
sidtab.h
symtab.c SELinux: ensure keys constant in hashtab_search 2006-11-28 12:04:37 -05:00
symtab.h