mm: add context argument to shrinker callback
The current shrinker implementation requires the registered callback to have global state to work from. This makes it difficult to shrink caches that are not global (e.g. per-filesystem caches). Pass the shrinker structure to the callback so that users can embed the shrinker structure in the context the shrinker needs to operate on and get back to it in the callback via container_of(). Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:

committed by
Dave Chinner

szülő
d0c6f62584
commit
7f8275d0d6
@@ -4978,7 +4978,7 @@ i915_gpu_is_active(struct drm_device *dev)
|
||||
}
|
||||
|
||||
static int
|
||||
i915_gem_shrink(int nr_to_scan, gfp_t gfp_mask)
|
||||
i915_gem_shrink(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask)
|
||||
{
|
||||
drm_i915_private_t *dev_priv, *next_dev;
|
||||
struct drm_i915_gem_object *obj_priv, *next_obj;
|
||||
|
Reference in New Issue
Block a user