Skip to content

Commit

Permalink
frontswap: remove frontswap_tmem_exclusive_gets
Browse files Browse the repository at this point in the history
frontswap_tmem_exclusive_gets is never called, so remove it.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Juergen Gross <[email protected]>
Cc: Dan Streetman <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Matthew Wilcox (Oracle) <[email protected]>
Cc: Seth Jennings <[email protected]>
Cc: Vitaly Wool <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Christoph Hellwig authored and torvalds committed Jan 22, 2022
1 parent 3d6035f commit 71024cb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
2 changes: 0 additions & 2 deletions include/linux/frontswap.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ struct frontswap_ops {
extern void frontswap_register_ops(struct frontswap_ops *ops);
extern void frontswap_shrink(unsigned long);
extern unsigned long frontswap_curr_pages(void);
#define FRONTSWAP_HAS_EXCLUSIVE_GETS
extern void frontswap_tmem_exclusive_gets(bool);

extern bool __frontswap_test(struct swap_info_struct *, pgoff_t);
extern void __frontswap_init(unsigned type, unsigned long *map);
Expand Down
23 changes: 1 addition & 22 deletions mm/frontswap.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ static struct frontswap_ops *frontswap_ops __read_mostly;
#define for_each_frontswap_ops(ops) \
for ((ops) = frontswap_ops; (ops); (ops) = (ops)->next)

/*
* If enabled, the underlying tmem implementation is capable of doing
* exclusive gets, so frontswap_load, on a successful tmem_get must
* mark the page as no longer in frontswap AND mark it dirty.
*/
static bool frontswap_tmem_exclusive_gets_enabled __read_mostly;

#ifdef CONFIG_DEBUG_FS
/*
* Counters available via /sys/kernel/debug/frontswap (if debugfs is
Expand Down Expand Up @@ -160,15 +153,6 @@ void frontswap_register_ops(struct frontswap_ops *ops)
}
EXPORT_SYMBOL(frontswap_register_ops);

/*
* Enable/disable frontswap exclusive gets (see above).
*/
void frontswap_tmem_exclusive_gets(bool enable)
{
frontswap_tmem_exclusive_gets_enabled = enable;
}
EXPORT_SYMBOL(frontswap_tmem_exclusive_gets);

/*
* Called when a swap device is swapon'd.
*/
Expand Down Expand Up @@ -296,13 +280,8 @@ int __frontswap_load(struct page *page)
if (!ret) /* successful load */
break;
}
if (ret == 0) {
if (ret == 0)
inc_frontswap_loads();
if (frontswap_tmem_exclusive_gets_enabled) {
SetPageDirty(page);
__frontswap_clear(sis, offset);
}
}
return ret;
}
EXPORT_SYMBOL(__frontswap_load);
Expand Down

0 comments on commit 71024cb

Please sign in to comment.