Server IP : 127.0.0.2 / Your IP : 18.221.227.158 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /lib/modules/4.4.0-1085-aws/build/include/linux/ |
Upload File : |
/* * Specialised local-global spinlock. Can only be declared as global variables * to avoid overhead and keep things simple (and we don't want to start using * these inside dynamically allocated structures). * * "local/global locks" (lglocks) can be used to: * * - Provide fast exclusive access to per-CPU data, with exclusive access to * another CPU's data allowed but possibly subject to contention, and to * provide very slow exclusive access to all per-CPU data. * - Or to provide very fast and scalable read serialisation, and to provide * very slow exclusive serialisation of data (not necessarily per-CPU data). * * Brlocks are also implemented as a short-hand notation for the latter use * case. * * Copyright 2009, 2010, Nick Piggin, Novell Inc. */ #ifndef __LINUX_LGLOCK_H #define __LINUX_LGLOCK_H #include <linux/spinlock.h> #include <linux/lockdep.h> #include <linux/percpu.h> #include <linux/cpu.h> #include <linux/notifier.h> #ifdef CONFIG_SMP #ifdef CONFIG_DEBUG_LOCK_ALLOC #define LOCKDEP_INIT_MAP lockdep_init_map #else #define LOCKDEP_INIT_MAP(a, b, c, d) #endif struct lglock { arch_spinlock_t __percpu *lock; #ifdef CONFIG_DEBUG_LOCK_ALLOC struct lock_class_key lock_key; struct lockdep_map lock_dep_map; #endif }; #define DEFINE_LGLOCK(name) \ static DEFINE_PER_CPU(arch_spinlock_t, name ## _lock) \ = __ARCH_SPIN_LOCK_UNLOCKED; \ struct lglock name = { .lock = &name ## _lock } #define DEFINE_STATIC_LGLOCK(name) \ static DEFINE_PER_CPU(arch_spinlock_t, name ## _lock) \ = __ARCH_SPIN_LOCK_UNLOCKED; \ static struct lglock name = { .lock = &name ## _lock } void lg_lock_init(struct lglock *lg, char *name); void lg_local_lock(struct lglock *lg); void lg_local_unlock(struct lglock *lg); void lg_local_lock_cpu(struct lglock *lg, int cpu); void lg_local_unlock_cpu(struct lglock *lg, int cpu); void lg_double_lock(struct lglock *lg, int cpu1, int cpu2); void lg_double_unlock(struct lglock *lg, int cpu1, int cpu2); void lg_global_lock(struct lglock *lg); void lg_global_unlock(struct lglock *lg); #else /* When !CONFIG_SMP, map lglock to spinlock */ #define lglock spinlock #define DEFINE_LGLOCK(name) DEFINE_SPINLOCK(name) #define DEFINE_STATIC_LGLOCK(name) static DEFINE_SPINLOCK(name) #define lg_lock_init(lg, name) spin_lock_init(lg) #define lg_local_lock spin_lock #define lg_local_unlock spin_unlock #define lg_local_lock_cpu(lg, cpu) spin_lock(lg) #define lg_local_unlock_cpu(lg, cpu) spin_unlock(lg) #define lg_global_lock spin_lock #define lg_global_unlock spin_unlock #endif #endif