linux/kernel/locking/test-ww_mutex.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Module-based API test facility for ww_mutexes
 */

#include <linux/kernel.h>

#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/kthread.h>
#include <linux/module.h>
#include <linux/prandom.h>
#include <linux/slab.h>
#include <linux/ww_mutex.h>

static DEFINE_WD_CLASS(ww_class);
struct workqueue_struct *wq;

#ifdef CONFIG_DEBUG_WW_MUTEX_SLOWPATH
#define ww_acquire_init_noinject(a, b)
#else
#define ww_acquire_init_noinject
#endif

struct test_mutex {};

#define TEST_MTX_SPIN
#define TEST_MTX_TRY
#define TEST_MTX_CTX
#define __TEST_MTX_LAST

static void test_mutex_work(struct work_struct *work)
{}

static int __test_mutex(unsigned int flags)
{}

static int test_mutex(void)
{}

static int test_aa(bool trylock)
{}

struct test_abba {};

static void test_abba_work(struct work_struct *work)
{}

static int test_abba(bool trylock, bool resolve)
{}

struct test_cycle {};

static void test_cycle_work(struct work_struct *work)
{}

static int __test_cycle(unsigned int nthreads)
{}

static int test_cycle(unsigned int ncpus)
{}

struct stress {};

struct rnd_state rng;
DEFINE_SPINLOCK();

static inline u32 prandom_u32_below(u32 ceil)
{}

static int *get_random_order(int count)
{}

static void dummy_load(struct stress *stress)
{}

static void stress_inorder_work(struct work_struct *work)
{}

struct reorder_lock {};

static void stress_reorder_work(struct work_struct *work)
{}

static void stress_one_work(struct work_struct *work)
{}

#define STRESS_INORDER
#define STRESS_REORDER
#define STRESS_ONE
#define STRESS_ALL

static int stress(int nlocks, int nthreads, unsigned int flags)
{}

static int __init test_ww_mutex_init(void)
{}

static void __exit test_ww_mutex_exit(void)
{}

module_init();
module_exit(test_ww_mutex_exit);

MODULE_LICENSE();
MODULE_AUTHOR();