Skip to content

Commit 3d6035f

Browse files
Christoph Hellwigtorvalds
authored andcommitted
frontswap: remove frontswap_writethrough
frontswap_writethrough 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]>
1 parent 0a4ee51 commit 3d6035f

File tree

3 files changed

+1
-29
lines changed

3 files changed

+1
-29
lines changed

Documentation/vm/frontswap.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@ a disk write and, if the data is later read back, a disk read are avoided.
3939
If a store returns failure, transcendent memory has rejected the data, and the
4040
page can be written to swap as usual.
4141

42-
If a backend chooses, frontswap can be configured as a "writethrough
43-
cache" by calling frontswap_writethrough(). In this mode, the reduction
44-
in swap device writes is lost (and also a non-trivial performance advantage)
45-
in order to allow the backend to arbitrarily "reclaim" space used to
46-
store frontswap pages to more completely manage its memory usage.
47-
4842
Note that if a page is stored and the page already exists in transcendent memory
4943
(a "duplicate" store), either the store succeeds and the data is overwritten,
5044
or the store fails AND the page is invalidated. This ensures stale data may

include/linux/frontswap.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ struct frontswap_ops {
2626
extern void frontswap_register_ops(struct frontswap_ops *ops);
2727
extern void frontswap_shrink(unsigned long);
2828
extern unsigned long frontswap_curr_pages(void);
29-
extern void frontswap_writethrough(bool);
3029
#define FRONTSWAP_HAS_EXCLUSIVE_GETS
3130
extern void frontswap_tmem_exclusive_gets(bool);
3231

mm/frontswap.c

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,6 @@ static struct frontswap_ops *frontswap_ops __read_mostly;
3232
#define for_each_frontswap_ops(ops) \
3333
for ((ops) = frontswap_ops; (ops); (ops) = (ops)->next)
3434

35-
/*
36-
* If enabled, frontswap_store will return failure even on success. As
37-
* a result, the swap subsystem will always write the page to swap, in
38-
* effect converting frontswap into a writethrough cache. In this mode,
39-
* there is no direct reduction in swap writes, but a frontswap backend
40-
* can unilaterally "reclaim" any pages in use with no data loss, thus
41-
* providing increases control over maximum memory usage due to frontswap.
42-
*/
43-
static bool frontswap_writethrough_enabled __read_mostly;
44-
4535
/*
4636
* If enabled, the underlying tmem implementation is capable of doing
4737
* exclusive gets, so frontswap_load, on a successful tmem_get must
@@ -170,15 +160,6 @@ void frontswap_register_ops(struct frontswap_ops *ops)
170160
}
171161
EXPORT_SYMBOL(frontswap_register_ops);
172162

173-
/*
174-
* Enable/disable frontswap writethrough (see above).
175-
*/
176-
void frontswap_writethrough(bool enable)
177-
{
178-
frontswap_writethrough_enabled = enable;
179-
}
180-
EXPORT_SYMBOL(frontswap_writethrough);
181-
182163
/*
183164
* Enable/disable frontswap exclusive gets (see above).
184165
*/
@@ -283,9 +264,7 @@ int __frontswap_store(struct page *page)
283264
} else {
284265
inc_frontswap_failed_stores();
285266
}
286-
if (frontswap_writethrough_enabled)
287-
/* report failure so swap also writes to swap device */
288-
ret = -1;
267+
289268
return ret;
290269
}
291270
EXPORT_SYMBOL(__frontswap_store);

0 commit comments

Comments
 (0)