Thread (37 messages) 37 messages, 6 authors, 2011-09-05

Re: [PATCH 04/13] mm: new shrinker API

From: Dave Chinner <david@fromorbit.com>
Date: 2011-08-23 09:23:30
Also in: linux-fsdevel, lkml

On Tue, Aug 23, 2011 at 05:15:29AM -0400, Christoph Hellwig wrote:
quoted
 /*
  * A callback you can register to apply pressure to ageable caches.
It's much more than just a single callback these days.
quoted
+ * @scan_objects will be made from the current reclaim context.
  */
 struct shrinker {
 	int (*shrink)(struct shrinker *, struct shrink_control *sc);
+	long (*count_objects)(struct shrinker *, struct shrink_control *sc);
+	long (*scan_objects)(struct shrinker *, struct shrink_control *sc);
Is shrink_object really such a good name for this method?
Apart from the fact it is called "scan_objects", I'm open to more
appropriate names. I called is "scan_objects" because of the fact we
are asking to scan (rather than free) a specific number objects on
the LRU, and it matches with the "sc->nr_to_scan" control field.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help