diff options
Diffstat (limited to 'include/linux/shrinker.h')
| -rw-r--r-- | include/linux/shrinker.h | 11 | 
1 files changed, 9 insertions, 2 deletions
| diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h index 6794490f25b2..b154fd2b084c 100644 --- a/include/linux/shrinker.h +++ b/include/linux/shrinker.h @@ -34,12 +34,15 @@ struct shrink_control {  };  #define SHRINK_STOP (~0UL) +#define SHRINK_EMPTY (~0UL - 1)  /*   * A callback you can register to apply pressure to ageable caches.   *   * @count_objects should return the number of freeable items in the cache. If - * there are no objects to free or the number of freeable items cannot be - * determined, it should return 0. No deadlock checks should be done during the + * there are no objects to free, it should return SHRINK_EMPTY, while 0 is + * returned in cases of the number of freeable items cannot be determined + * or shrinker should skip this cache for this time (e.g., their number + * is below shrinkable limit). No deadlock checks should be done during the   * count callback - the shrinker relies on aggregating scan counts that couldn't   * be executed due to potential deadlocks to be run at a later call when the   * deadlock condition is no longer pending. @@ -66,6 +69,10 @@ struct shrinker {  	/* These are for internal use */  	struct list_head list; +#ifdef CONFIG_MEMCG_KMEM +	/* ID in shrinker_idr */ +	int id; +#endif  	/* objs pending delete, per node */  	atomic_long_t *nr_deferred;  }; |