Skip to contentSkip to conversation

Consider for longterm kernels: mm: avoid swapping out with swappiness==0

DISCUSSION Ben Hutchings 5 participants 8 messages Sep 9, 2012 – Sep 10, 2012 1 message not in the archive Memory management

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 10 lines · Zdenek Kaspar

Hi Greg,

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=fe35004fbf9eaf67482b074a2e032abb9c89b1dd

In short: this patch seems beneficial for users trying to avoid memory swapping at all costs but they want to keep swap for emergency reasons.

More details: https://lkml.org/lkml/2012/3/2/320

Its included in 3.5, so could this be considered for -longterm kernels ?

Andrew, Rik, does this seem appropriate for longterm?

Ben.

Signature · 2 lines
Ben Hutchings
Time is nature's way of making sure that everything doesn't happen at once.
#2 lore raw
Quoted 5 lines · Ben Hutchings
Quoted 4 lines · Zdenek Kaspar

Hi Greg,

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=fe35004fbf9eaf67482b074a2e032abb9c89b1dd

Quoted 8 lines
Quoted 6 lines

In short: this patch seems beneficial for users trying to avoid memory swapping at all costs but they want to keep swap for emergency reasons.

More details: https://lkml.org/lkml/2012/3/2/320

Its included in 3.5, so could this be considered for -longterm kernels ?

Andrew, Rik, does this seem appropriate for longterm?

Yes, absolutely. Default behaviour is not changed at all, and the patch makes swappiness=0 do what people seem to expect it to do.

Signature · 7 lines
All rights reversed

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#3 lore raw
Quoted 17 lines · Rik van Riel
Quoted 16 lines · Ben Hutchings
Quoted 12 lines · Zdenek Kaspar

Hi Greg,

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=fe35004fbf9eaf67482b074a2e032abb9c89b1dd

In short: this patch seems beneficial for users trying to avoid memory swapping at all costs but they want to keep swap for emergency reasons.

More details: https://lkml.org/lkml/2012/3/2/320

Its included in 3.5, so could this be considered for -longterm kernels ?

Quoted 6 lines
Quoted 1 line

Andrew, Rik, does this seem appropriate for longterm?

Yes, absolutely. Default behaviour is not changed at all, and the patch makes swappiness=0 do what people seem to expect it to do.

Just curious, but what theoretically would happen if someone were to want to set swappiness to 200 or something?

Should it be sorta like vfs_cache_pressure?

Quoted 8 lines

--
All rights reversed

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#4 lore raw
Quoted 6 lines · Shentino

Just curious, but what theoretically would happen if someone were to want to set swappiness to 200 or something?

Should it be sorta like vfs_cache_pressure?

How could it be set to 200? As 0~100 is valid:

{
.procname = "swappiness",
.data = &vm_swappiness,
.maxlen = sizeof(vm_swappiness),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
.extra2 = &one_hundred,
},

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#5 lore raw
Quoted 11 lines · Cong Wang
Quoted 6 lines · Shentino

Just curious, but what theoretically would happen if someone were to want to set swappiness to 200 or something?

Should it be sorta like vfs_cache_pressure?

How could it be set to 200? As 0~100 is valid:

Quoted 9 lines

{
.procname = "swappiness",
.data = &vm_swappiness,
.maxlen = sizeof(vm_swappiness),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
.extra2 = &one_hundred,
},

My comment/question was more abstract and focusing on the comparison to vfs_cache_pressure.

:P

Quoted 6 lines

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#6 lore raw
Quoted 22 lines · Shentino
Quoted 11 lines · Cong Wang
Quoted 6 lines · Shentino

Just curious, but what theoretically would happen if someone were to want to set swappiness to 200 or something?

Should it be sorta like vfs_cache_pressure?

How could it be set to 200? As 0~100 is valid:

Quoted 9 lines

{
.procname = "swappiness",
.data = &vm_swappiness,
.maxlen = sizeof(vm_swappiness),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
.extra2 = &one_hundred,
},

Quoted 2 lines

My comment/question was more abstract and focusing on the comparison to vfs_cache_pressure.

Just to be clear about what I meant.

Both swapping and reclaiming from dentry/inode caches both share the common factor of being alternatives to reclaiming from page cache when memory is tight.

So I was wondering how similiar in effect these two knobs should be.

One possible use case off the top of my head is a file server that banks heavily on page cache and spends most of its runtime sending file data over the network. It might be overkill but swappiness > 100 might actually be beneficial here. I have no numbers to back it up though as it's a rough idea.

Sorry if I'm butting in on the subject but I was curious about the idea.

Also still learning how to pos tin general on the kernel lists, so apologies if I've been rude or anything.

Quoted 8 lines

:P

Quoted 6 lines

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#7 lore raw
In reply to Rik van Riel
Quoted 11 lines · Rik van Riel
Quoted 10 lines · Ben Hutchings
Quoted 9 lines · Zdenek Kaspar

Hi Greg,

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=fe35004fbf9eaf67482b074a2e032abb9c89b1dd

In short: this patch seems beneficial for users trying to avoid memory swapping at all costs but they want to keep swap for emergency reasons.

More details: https://lkml.org/lkml/2012/3/2/320

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Its included in 3.5, so could this be considered for -longterm kernels ?

Andrew, Rik, does this seem appropriate for longterm?

Yes, absolutely. Default behaviour is not changed at all, and the patch makes swappiness=0 do what people seem to expect it to do.

OK, I've queued this up for 3.2.

Ben.

Signature · 2 lines
Ben Hutchings
Time is nature's way of making sure that everything doesn't happen at once.
#8 lore raw
In reply to Rik van Riel
Quoted 7 lines · Rik van Riel
Quoted 7 lines
Quoted 7 lines

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=fe35004fbf9eaf67482b074a2e032abb9c89b1dd

In short: this patch seems beneficial for users trying to avoid memory swapping at all costs but they want to keep swap for emergency reasons.

More details: https://lkml.org/lkml/2012/3/2/320

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Its included in 3.5, so could this be considered for -longterm kernels ?

Andrew, Rik, does this seem appropriate for longterm?

Yes, absolutely. Default behaviour is not changed at all, and the patch makes swappiness=0 do what people seem to expect it to do.

Just for the record, in 3.0 and below we don't have vmscan_swappiness(), so if the match makes sense there, that function will need to be backported, in which mem_cgroup_swappiness() will have to be replaced by get_swappiness().

Regards,
Willy

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>