OSDN Git Service

dm cache policy mq: track entries hit this 'tick' via sentinel objects
authorJoe Thornber <ejt@redhat.com>
Fri, 20 Feb 2015 13:49:45 +0000 (13:49 +0000)
committerMike Snitzer <snitzer@redhat.com>
Tue, 31 Mar 2015 16:03:48 +0000 (12:03 -0400)
commit3e45c91e5cdd0cfd3cc1228628602c8e7e587157
treed276979206c17fe5725a4f0dcf18eba27076831c
parentc74ffc5c63b0b2753bedd49bdc1196d570f66803
dm cache policy mq: track entries hit this 'tick' via sentinel objects

A sentinel object is placed on each level of the multiqueues.  When an
object is hit it is requeued behind the sentinel.  When the tick is
incremented we iterate through all objects behind the sentinel and
update the hit_count, then reposition the sentinel at the very back.

This saves memory by avoiding tracking the tick explicitly for every
struct entry object in the multiqueues.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-cache-policy-mq.c