Age | Commit message (Collapse) | Author | Files | Lines |
|
Keep track of lock owner name and replace lock_depth counter
with a per-cpu list of locks held by the cpu.
This allows us to print the actual locks held in case we hit
the (in)famous message about opal_pollers being run with a
lock held.
It also allows us to warn (and drop them) if locks are still
held when returning to the OS or completing a scheduled job.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
[stewart: fix unit tests]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
We shouldn't delete the list element after list_pop, it's already
been deleted.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Comments in the run-mem_region test imply that it uses skiboot's own
malloc for the malloc implementation, but this isn't true; a malloc
inside the mem_region code itself will use the glibc malloc.
This change implements the intention of the test, and uses skiboot
malloc for the file-under-test. real_malloc() is available for actual
glibc mallocs.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Currently, this test doesn't do locking during region changes or
allocations. This change adds the appropriate locking.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This change adds asserts to the mem_region calls that should have the
per-region lock held.
To keep the tests working, they need the lock_held_by_me() function. The
run-mem_region.c test has a bogus implementation of this, as it doesn't
do any locking at the moment. This will be addressed in a later change.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Currently, we have a single lock for the entire mem_region system; this
protects both the global region list, and the allocations from each
region.
This means we can't allocate memory while traversing the global region
list, as any malloc/realloc/free will try to acquire the mem_region lock
again.
This change separates the locking into different functions. We keep the
mem_region_lock to protect the regions list, and introduce a per-region
lock to protect allocations from the regions' free_lists.
Then we remove the open-coded invocations of mem_alloc, where we'd
avoided malloc() due to the above locking issue.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This better states the intention of what it should return.
I was bit unsure when fixing mem_size(), so hopefully this
makes future me (or other people) less unsure as to the
intended return value of this function.
No functional changes, just rename.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Acked-by: Rusty Russell <rusty@au1.ibm.com>
|
|
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|