forked from luck/tmp_suning_uos_patched
b29d4986d0
The cache policy interfaces have been updated to work well with the new bio-prison v2 interface's ability to queue work immediately (promotion, demotion, etc) -- overriding benefit being reduced latency on processing IO through the cache. Previously such work would be left for the DM cache core to queue on various lists and then process in batches later -- this caused a serious delay in latency for IO driven by the cache. The background tracker code was factored out so that all cache policies can make use of it. Also, the "cleaner" policy has been removed and is now a variant of the smq policy that simply disallows migrations. Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
47 lines
1.3 KiB
C
47 lines
1.3 KiB
C
/*
|
|
* Copyright (C) 2017 Red Hat. All rights reserved.
|
|
*
|
|
* This file is released under the GPL.
|
|
*/
|
|
|
|
#ifndef DM_CACHE_BACKGROUND_WORK_H
|
|
#define DM_CACHE_BACKGROUND_WORK_H
|
|
|
|
#include <linux/vmalloc.h>
|
|
#include "dm-cache-policy.h"
|
|
|
|
/*----------------------------------------------------------------*/
|
|
|
|
struct background_work;
|
|
struct background_tracker;
|
|
|
|
/*
|
|
* FIXME: discuss lack of locking in all methods.
|
|
*/
|
|
struct background_tracker *btracker_create(unsigned max_work);
|
|
void btracker_destroy(struct background_tracker *b);
|
|
|
|
unsigned btracker_nr_writebacks_queued(struct background_tracker *b);
|
|
unsigned btracker_nr_demotions_queued(struct background_tracker *b);
|
|
|
|
/*
|
|
* returns -EINVAL iff the work is already queued. -ENOMEM if the work
|
|
* couldn't be queued for another reason.
|
|
*/
|
|
int btracker_queue(struct background_tracker *b,
|
|
struct policy_work *work,
|
|
struct policy_work **pwork);
|
|
|
|
/*
|
|
* Returns -ENODATA if there's no work.
|
|
*/
|
|
int btracker_issue(struct background_tracker *b, struct policy_work **work);
|
|
void btracker_complete(struct background_tracker *b,
|
|
struct policy_work *op);
|
|
bool btracker_promotion_already_present(struct background_tracker *b,
|
|
dm_oblock_t oblock);
|
|
|
|
/*----------------------------------------------------------------*/
|
|
|
|
#endif
|