diff options
| author | Jani Nikula <jani.nikula@intel.com> | 2025-06-09 12:40:46 +0300 | 
|---|---|---|
| committer | Jani Nikula <jani.nikula@intel.com> | 2025-06-09 12:40:46 +0300 | 
| commit | 34c55367af96f62e89221444f04487440ebc6487 (patch) | |
| tree | fdb36ba67d7dea09455b55037e26043b7e051ef9 /lib/test_vmalloc.c | |
| parent | 7247efca0dcbc8ac6147db9200ed1549c0662465 (diff) | |
| parent | 19272b37aa4f83ca52bdf9c16d5d81bdd1354494 (diff) | |
| download | linux-34c55367af96f62e89221444f04487440ebc6487.tar.xz | |
Merge drm/drm-next into drm-intel-next
Sync to v6.16-rc1, among other things to get the fixed size GENMASK_U*()
and BIT_U*() macros.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'lib/test_vmalloc.c')
| -rw-r--r-- | lib/test_vmalloc.c | 22 | 
1 files changed, 10 insertions, 12 deletions
diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c index f585949ff696..1b0b59549aaf 100644 --- a/lib/test_vmalloc.c +++ b/lib/test_vmalloc.c @@ -13,9 +13,9 @@  #include <linux/moduleparam.h>  #include <linux/completion.h>  #include <linux/delay.h> -#include <linux/rwsem.h>  #include <linux/mm.h>  #include <linux/rcupdate.h> +#include <linux/srcu.h>  #include <linux/slab.h>  #define __param(type, name, init, msg)		\ @@ -58,10 +58,9 @@ __param(int, run_test_mask, INT_MAX,  );  /* - * Read write semaphore for synchronization of setup - * phase that is done in main thread and workers. + * This is for synchronization of setup phase.   */ -static DECLARE_RWSEM(prepare_for_test_rwsem); +DEFINE_STATIC_SRCU(prepare_for_test_srcu);  /*   * Completion tracking for worker threads. @@ -458,7 +457,7 @@ static int test_func(void *private)  	/*  	 * Block until initialization is done.  	 */ -	down_read(&prepare_for_test_rwsem); +	synchronize_srcu(&prepare_for_test_srcu);  	t->start = get_cycles();  	for (i = 0; i < ARRAY_SIZE(test_case_array); i++) { @@ -487,8 +486,6 @@ static int test_func(void *private)  		t->data[index].time = delta;  	}  	t->stop = get_cycles(); - -	up_read(&prepare_for_test_rwsem);  	test_report_one_done();  	/* @@ -526,7 +523,7 @@ init_test_configuration(void)  static void do_concurrent_test(void)  { -	int i, ret; +	int i, ret, idx;  	/*  	 * Set some basic configurations plus sanity check. @@ -538,7 +535,7 @@ static void do_concurrent_test(void)  	/*  	 * Put on hold all workers.  	 */ -	down_write(&prepare_for_test_rwsem); +	idx = srcu_read_lock(&prepare_for_test_srcu);  	for (i = 0; i < nr_threads; i++) {  		struct test_driver *t = &tdriver[i]; @@ -555,7 +552,7 @@ static void do_concurrent_test(void)  	/*  	 * Now let the workers do their job.  	 */ -	up_write(&prepare_for_test_rwsem); +	srcu_read_unlock(&prepare_for_test_srcu, idx);  	/*  	 * Sleep quiet until all workers are done with 1 second @@ -594,10 +591,11 @@ static void do_concurrent_test(void)  	kvfree(tdriver);  } -static int vmalloc_test_init(void) +static int __init vmalloc_test_init(void)  {  	do_concurrent_test(); -	return -EAGAIN; /* Fail will directly unload the module */ +	/* Fail will directly unload the module */ +	return IS_BUILTIN(CONFIG_TEST_VMALLOC) ? 0:-EAGAIN;  }  module_init(vmalloc_test_init)  | 
