Merge pull request #100 from arutk/env_exec_ctx_trylock

Enabling per-CPU freelists
This commit is contained in:
Jan Musiał 2019-09-11 11:03:32 +02:00 committed by GitHub
commit 6033ca9f95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 1 deletions

View File

@ -431,6 +431,11 @@ static inline void env_spinlock_lock(env_spinlock *l)
spin_lock(l); spin_lock(l);
} }
static inline int env_spinlock_trylock(env_spinlock *l)
{
return spin_trylock(l) ? 0 : -OCF_ERR_NO_LOCK;
}
static inline void env_spinlock_unlock(env_spinlock *l) static inline void env_spinlock_unlock(env_spinlock *l)
{ {
spin_unlock(l); spin_unlock(l);
@ -616,4 +621,21 @@ static inline uint32_t env_crc32(uint32_t crc, uint8_t const *data, size_t len)
#define ENV_BUG() BUG() #define ENV_BUG() BUG()
#define ENV_BUG_ON(cond) BUG_ON(cond) #define ENV_BUG_ON(cond) BUG_ON(cond)
/* *** EXECUTION COTNEXT *** */
static inline unsigned env_get_execution_context(void)
{
return get_cpu();
}
static inline void env_put_execution_context(unsigned ctx)
{
put_cpu();
}
static inline unsigned env_get_execution_context_count(void)
{
return num_online_cpus();
}
#endif /* __OCF_ENV_H__ */ #endif /* __OCF_ENV_H__ */

2
ocf

@ -1 +1 @@
Subproject commit 43e8905456aa0bd4fdf12c3e8aa374c641684471 Subproject commit 9a46c402b2e8398da7a3ee212faf041b3f01f958