Re: [PATCH v2] mm: Add configuration to control whether vmpressure notifier is enabled

From: Michal Hocko
Date: Mon Sep 06 2021 - 02:37:21 EST


On Sat 04-09-21 18:41:00, yong w wrote:
[..]
> > It is not in conflict but runtime overhead reduction without more burden
> > on the configurability is usually a preferred approach.
> I agree with you.I had an idea that we use global variables to identify whether
> there is event registration,however, global variables need to be
> protected with locks.

Have a look at static keys which are usual tool to provide effectivelly
zero overhead disabled branch.
--
Michal Hocko
SUSE Labs