On 15/12/17 04:22 PM, Richard Brown wrote:
The more swap space you allocate, the more the kernel will try to use it
Experimentally, I see no evidence for that. What is there about the algorithms that would make it so? As far as I can tell, propensity to page out is a function of available memory and kernel parameters, such a swappiness, the degree of overcommit allowed, the freepages high, low and min setting. And how much gets used emerges from the kswapd parameters. All these are measures of the memory and its use by processes. Perhaps you are getting confused with the algorithm that determines if swap space is recovered. At first it is not; it is only when there is 'pressure' on the finding of swap space that the recovery algorithms are triggered. if so, then your wording is very misleading. If you have a 2G swap compression it will be triggered when you have consumed, perhaps 1.5G. Not that you have 1.5G swapped out right now, but over the lifetime of the machine running there have been that many pages swapped out at some time. Unlike real swap systems such as V7 UNIX there is not a 1:1 correspondence between the system/process memory and the page-out space, it is a first-come/first/served type of thing. (It is irrelevant in this example of the 'gap' is 3/4 or 0.5G) So it you have a 6G swap space the kernel will keep using it until the higher threshold. You can view this as a better situation since there isn't the pressure on the kernel so earnestly. There is nothing about the increased size of the swap that ENCOURAGES the kernel to use it. The extra size just means that the kernel doesn't have to run the swap space recovery/compression algorithm so often. Of course if you have adequate memory and never page-out, then the size of the swap is irrelevant. Which means that if you have additional REAL MEMORY you *DO* encourage the kernel to use it -- the *memory* that is. -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org