/* * If jump labels are enabled in Kconfig, the static key uses nop sleds and * code patching to eliminate the overhead of taking the rwsem in * blocking_notifier_call_chain when there are no hooks configured. If not, * the static key per-call overhead is an atomic read. Most arches that can * handle XFS also support jump labels. * * Note: Patching the kernel code requires taking the cpu hotplug lock. Other * parts of the kernel allocate memory with that lock held, which means that * XFS callers cannot hold any locks that might be used by memory reclaim or * writeback when calling the static_branch_{inc,dec} functions.
*/ # define DEFINE_STATIC_XFS_HOOK_SWITCH(name) \ static DEFINE_STATIC_KEY_FALSE(name) # define xfs_hooks_switch_on(name) static_branch_inc(name) # define xfs_hooks_switch_off(name) static_branch_dec(name) # define xfs_hooks_switched_on(name) static_branch_unlikely(name)
struct xfs_hook { /* This must come at the start of the structure. */ struct notifier_block nb;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.