diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-04-24 16:01:10 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-04-24 16:01:10 +0300 |
commit | edd38b50f665cb419507aa09f816cddcd895dfd0 (patch) | |
tree | a21b228067d82d3db35347125b2f76cde0026e0d /include/mysql | |
parent | 2c39f69d34e64a5cf94720e82e78c0ee91bd4649 (diff) | |
download | mariadb-git-edd38b50f665cb419507aa09f816cddcd895dfd0.tar.gz |
MDEV-7962 wsrep_on() takes 0.14% in OLTP RO
The reason why we have wsrep_on() at all is that the macro WSREP(thd)
depends on the definition of THD, and that is intentionally an opaque
data type for InnoDB. So, we cannot avoid invoking wsrep_on(), but
we can evaluate the less expensive conditions thd && WSREP_ON before
calling the function.
Global_read_lock: Use WSREP_NNULL(thd) instead of wsrep_on(thd)
because we not only know the definition of THD but also that
the pointer is not null.
wsrep_open(): Use WSREP(thd) instead of wsrep_on(thd).
InnoDB: Replace thd && wsrep_on(thd) with wsrep_on(thd), now that
the condition has been merged to the definition of the macro
wsrep_on().
Diffstat (limited to 'include/mysql')
-rw-r--r-- | include/mysql/service_wsrep.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/mysql/service_wsrep.h b/include/mysql/service_wsrep.h index 61a829f3043..522eb56fc4e 100644 --- a/include/mysql/service_wsrep.h +++ b/include/mysql/service_wsrep.h @@ -97,7 +97,7 @@ extern struct wsrep_service_st { #define wsrep_is_wsrep_xid(X) wsrep_service->wsrep_is_wsrep_xid_func(X) #define wsrep_xid_seqno(X) wsrep_service->wsrep_xid_seqno_func(X) #define wsrep_xid_uuid(X) wsrep_service->wsrep_xid_uuid_func(X) -#define wsrep_on(X) WSREP_ON && wsrep_service->wsrep_on_func(X) +#define wsrep_on(thd) (thd) && WSREP_ON && wsrep_service->wsrep_on_func(thd) #define wsrep_prepare_key_for_innodb(A,B,C,D,E,F,G) wsrep_service->wsrep_prepare_key_for_innodb_func(A,B,C,D,E,F,G) #define wsrep_thd_LOCK(T) wsrep_service->wsrep_thd_LOCK_func(T) #define wsrep_thd_UNLOCK(T) wsrep_service->wsrep_thd_UNLOCK_func(T) |