Skip to contentSkip to conversation

Question: memory management and QoS

DISCUSSION Jan Astalos 3 participants 10 messages Aug 24, 2000 – Aug 31, 2000 Memory management

lore
Share & tools
lore
#0 lore raw

Hello,

I have a question about possibility to provide Quality of Service guaranties by Linux memory management. I'm asking this in the context of possible use of Linux clusters in computational grids
(http://www.gridforum.org/). There is still more computing power (mostly unused) in workstations...

One of the most important issues (IMO) is QoS. Especially, how OS can guarantee availability of resources. Since Linux is top-ranking OS in high-performance clusters, obviously there will be need to implement QoS in it.

So, why am I writing this to this list ? In last couple of days I was experimenting with Linux MM subsystem to find out whether Linux can (how it could) assure exclusive access to some amount of memory for user. Of course I was searching the archives. So far, I found only the beancounter patch, which is designed for limiting of memory usage. This is not quite exactly what I am looking for. Rather, users should have their memory reserved...

If I missed something please send me the pointers.

I have some (rough) ideas how it could work and I would be happy if you'll send me your opinions.

Concept of personal swapfiles:

- each user would have its own swapfile (size would depend on his memory needs and disk quota, he would be able to resize it)
- system swapfile would be shared between daemons and superuser
- each active user would have some amount of physical pages allocated (according to selected policy)

The benefits (among others):
- there wouldn't be system OOM (only per user OOM)
- user would be able to check his available memory
- no limits for VM address space
- there could be more policies for sharing of physical memory by users (and system)

Drawbacks:
<please fill>

Thanks in advance for your comments,

Jan
--
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.eu.org/Linux-MM/

#1 lore raw

Hello,

On Thu, Aug 24, 2000 at 12:13:28PM +0200, Jan Astalos wrote:
[snip]

Quoted 10 lines

So, why am I writing this to this list ? In last couple of days I was experimenting with Linux MM subsystem to find out whether Linux can (how it could) assure exclusive access to some amount of memory for user. Of course I was searching the archives. So far, I found only the beancounter patch, which is designed for limiting of memory usage. This is not quite exactly what I am looking for. Rather, users should have their memory reserved...

If I missed something please send me the pointers.

Well, the main goal of the memory management part of user beancounter patch is exactly QoS. It allows to control how to share resources between accounting subjects and specify the minimal amount of resources that are guaranteed to be available to them. These minimal amounts are the guaranteed level of service, the remaining resources are provided on a best-effort basis, doing it more or less fairly. The mentioned resources are total amount of memory, and in-core memory (as opposite to swap).

The code implementing this kind of QoS has been in user beancounter patch since version IV-0006. See ftp://ftp.sw.com.sg/pub/Linux/people/saw/kernel/user_beancounter/ ftp://ftp.swusa.com/pub/Linux/people/saw/kernel/user_beancounter/ The current code is dirty and incomplete, so questions (and comments) are welcome.

The patch also contains some upper limits on virtual address space. But they don't play any significant role, clearly being not a QoS or DoS protection mechanism.

Quoted 5 lines

I have some (rough) ideas how it could work and I would be happy if you'll send me your opinions.

Concept of personal swapfiles:

[snip]

I don't think that personal swapfiles is an efficient approach to achieve QoS. Most of the space will be reserved for exceptional cases, and, thus, wasted, as Yuri has mentioned. A shared swap space allowing exceeding the guaranteed amount (if the memory isn't really used) is much more efficient spending of the space. If the system has some spare memory, users exceeding their limits may still use it (but, certainly, only if only some of them, not all, exceed the limits). Moreover, if some users don't consume all the memory guaranteed to them, others may temporarily use it.

Best regards
Andrey V. Savochkin
--
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.eu.org/Linux-MM/

#2 lore raw
Quoted 2 lines · Andrey Savochkin

Hello,

Hi.

Quoted 9 lines

I don't think that personal swapfiles is an efficient approach to achieve QoS. Most of the space will be reserved for exceptional cases, and, thus, wasted, as Yuri has mentioned. A shared swap space allowing exceeding the guaranteed amount (if the memory isn't really used) is much more efficient spending of the space. If the system has some spare memory, users exceeding their limits may still use it (but, certainly, only if only some of them, not all, exceed the limits). Moreover, if some users don't consume all the memory guaranteed to them, others may temporarily use it.

I think I explained my points clearly enough in my second reply to Yuri so I won't repeat it again.

I still claim that per user swapfiles will:
- be _much_ more efficient in the sense of wasting disk space (saving money) because it will teach users efficiently use their memory resources (if user will waste the space inside it's own disk quota it will be his own problem)
- provide QoS on VM memory allocation to users (will guarantee amount of available VM for user)
- be able to improve _per_user_ performance of system (localizing performance problems to users that caused them and reducing disk seek times)
- shift the problem with OOM from system to user.

Please, don't repeat Yuri's argument with unswapable kernel objects and locked memory. Users should be able to lock only memory inside their own allocation and kernel objects should be accounted to this kind of memory too. Whether it is easy or hard to implement really does not matter for design. Anyway, there still could be pool of memory allocated to anonymous objects...

I think that your beancounter is a big step towards good QoS in Linux MM, but I'm a bit confused when I'll hear "...users exceeding their limits". What's the limit good for if it can be exceeded ? Can you rethought the term ?

Can you describe how to avoid VM shortage by beancounter ? Other than I described in my first reply to Yuri (point A) .

Regards,
Jan
--
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.eu.org/Linux-MM/

#3 lore raw
Quoted 13 lines · Jan Astalos
Quoted 8 lines · Andrey Savochkin

I don't think that personal swapfiles is an efficient approach to achieve QoS. Most of the space will be reserved for exceptional cases, and, thus, wasted, as Yuri has mentioned. A shared swap space allowing exceeding the guaranteed amount (if the memory isn't really used) is much more efficient spending of the space. If the system has some spare memory, users exceeding their limits may still use it (but, certainly, only if only some of them, not all, exceed the limits). Moreover, if some users don't consume all the memory guaranteed to them, others may temporarily use it.

I think I explained my points clearly enough in my second reply to Yuri so I won't repeat it again.

Quoted 10 lines

I still claim that per user swapfiles will:
- be _much_ more efficient in the sense of wasting disk space (saving money) because it will teach users efficiently use their memory resources (if user will waste the space inside it's own disk quota it will be his own problem)
- provide QoS on VM memory allocation to users (will guarantee amount of available VM for user)
- be able to improve _per_user_ performance of system (localizing performance problems to users that caused them and reducing disk seek times)
- shift the problem with OOM from system to user.

Ok, tell me: if user A has swapfile of 10MB and doesn't use it, whether user B is allowed to use it meanwhile?
If the answer is no, it's a waste of space, as I said.
If the answer is yes, I don't buy your argument of better clustering and less fragmentation.

Quoted 1 line

From my point of view, the real topics are

1. memory QoS, which starts from controlled sharing of in-core memory between users and, then, sharing of swap space, and the swap storage organization (per-user or global) being a second-order question because separate storages may easily be "emulated" by just quotas, and visa versa;
2. swap-out clusterization.
Speaking about the clusterization, the current code already keeps this aspect in mind. It may be more or less efficient, but it's a separate topic.

Quoted 3 lines

I think that your beancounter is a big step towards good QoS in Linux MM, but I'm a bit confused when I'll hear "...users exceeding their limits". What's the limit good for if it can be exceeded ? Can you rethought the term ?

Well, I usually call them "thresholds" rather than "limits". Users are guaranteed to have some quality of service below the these thresholds, i.e. that their allocations succeed, that the processes aren't killed because of OOM, that the pages aren't swapped out.
Over the thresholds the resources are given and requests are served on the best-effort basis.

Quoted 1 line

Can you describe how to avoid VM shortage by beancounter ?

I don't want to avoid VM shortage.
The goal is to introduce different levels of service and allows administrators to manage it.
Users obeying their "contracts" (staying below the thresholds set for them) have some guarantees. The guarantees are real if the administrator ensures that the sum of guaranteed amounts of resources is not greater than what's available.
Users disobeying their "contracts" may face negative effects with the chances depending on the amount of unused resources and the degree of their violation.

VM shortage is possible (and total avoiding it is very inefficient). The goal is to make its consequences controllable, guarantee that certain processes will never suffer from it etc.

Regards
Andrey V. Savochkin
--
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.eu.org/Linux-MM/

#4 lore raw
Quoted 26 lines · Andrey Savochkin
Quoted 13 lines · Jan Astalos
Quoted 8 lines · Andrey Savochkin

I don't think that personal swapfiles is an efficient approach to achieve QoS. Most of the space will be reserved for exceptional cases, and, thus, wasted, as Yuri has mentioned. A shared swap space allowing exceeding the guaranteed amount (if the memory isn't really used) is much more efficient spending of the space. If the system has some spare memory, users exceeding their limits may still use it (but, certainly, only if only some of them, not all, exceed the limits). Moreover, if some users don't consume all the memory guaranteed to them, others may temporarily use it.

I think I explained my points clearly enough in my second reply to Yuri so I won't repeat it again.

Quoted 10 lines

I still claim that per user swapfiles will:
- be _much_ more efficient in the sense of wasting disk space (saving money) because it will teach users efficiently use their memory resources (if user will waste the space inside it's own disk quota it will be his own problem)
- provide QoS on VM memory allocation to users (will guarantee amount of available VM for user)
- be able to improve _per_user_ performance of system (localizing performance problems to users that caused them and reducing disk seek times)
- shift the problem with OOM from system to user.

Quoted 3 lines

Ok, tell me: if user A has swapfile of 10MB and doesn't use it, whether user B is allowed to use it meanwhile?
If the answer is no, it's a waste of space, as I said.

As a user, you would waste 10MB of your 20MB quota ? I don't think so...

Quoted 2 lines

If the answer is yes, I don't buy your argument of better clustering and less fragmentation.

Do you really need to post questions like that ? It's obvious that swapfiles would be protected from access by another users. That's why they will be _personal_.

Quoted 6 lines
Quoted 2 lines

From my point of view, the real topics are

1. memory QoS, which starts from controlled sharing of in-core memory between users and, then, sharing of swap space, and the swap storage organization (per-user or global) being a second-order question because separate storages may easily be "emulated" by just quotas, and visa versa;

How the quotas will give you per user clustered pages ? If the quotas will change who will maintain them, sysadmin ? Look, how much of system maintenance cost is cost of system administration ? Still convinced that quotas on VM are good idea ?

Quoted 3 lines

2. swap-out clusterization.
Speaking about the clusterization, the current code already keeps this aspect in mind. It may be more or less efficient, but it's a separate topic.

? OK. Your are aimed on management of physical memory. I _is_ important. I'm aimed on VM QoS guaranties. From my point of view this is important too... As I said, MM of physical memory is core of QoS. But without VM QoS there wouldn't be _any_ memory QoS at all.

Quoted 12 lines
Quoted 4 lines

I think that your beancounter is a big step towards good QoS in Linux MM, but I'm a bit confused when I'll hear "...users exceeding their limits". What's the limit good for if it can be exceeded ? Can you rethought the term ?

Well, I usually call them "thresholds" rather than "limits". Users are guaranteed to have some quality of service below the these thresholds, i.e. that their allocations succeed, that the processes aren't killed because of OOM, that the pages aren't swapped out.
Over the thresholds the resources are given and requests are served on the best-effort basis.

Quoted 5 lines
Quoted 1 line

Can you describe how to avoid VM shortage by beancounter ?

I don't want to avoid VM shortage.
The goal is to introduce different levels of service and allows administrators to manage it.

excellent. If you'll make it flexible enough to make adding of new MM policy straightforward, you'll have my thanks...

Quoted 11 lines

Users obeying their "contracts" (staying below the thresholds set for them) have some guarantees. The guarantees are real if the administrator ensures that the sum of guaranteed amounts of resources is not greater than what's available.
Users disobeying their "contracts" may face negative effects with the chances depending on the amount of unused resources and the degree of their violation.

VM shortage is possible (and total avoiding it is very inefficient). The goal is to make its consequences controllable, guarantee that certain processes will never suffer from it etc.

I can't resist :-). So you have effectively transformed the _problem_of_VM_shortage_ to the _someone_else's_problem_ putting it completely on the shoulders of sysadmins. Why I have still impression that it's not the right way ? Hmm, maybe because the cost of system administation...
Can't you still see how easilly personal swapfiles would solve it ?

Regards,
Jan
--
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.eu.org/Linux-MM/

#5 lore raw
In reply to Jan Astalos
Quoted 10 lines · Jan Astalos

I still claim that per user swapfiles will:
- be _much_ more efficient in the sense of wasting disk space (saving money) because it will teach users efficiently use their memory resources (if user will waste the space inside it's own disk quota it will be his own problem)
- provide QoS on VM memory allocation to users (will guarantee amount of available VM for user)
- be able to improve _per_user_ performance of system (localizing performance problems to users that caused them and reducing disk seek times)
- shift the problem with OOM from system to user.

Do you have any reasons for this, or are you just asserting them as if they were fact? ;)

I think we can achieve the same thing, with higher over-all system performance, if we simply give each user a VM quota and do the bookkeeping on a central swap area.

The reasons for this are multiple:
1) having one swap partition will reduce disk seeks (no matter how you put it, disk seeks are a _system_ thing, not a per user thing)
2) not all users are logged in at the same time, so you can do a minimal form of overcomitting here (if you want)
3) you can easily give users _2_ VM quotas, a guaranteed one and a maximum one ... if a user goes over the guaranteed quota, processes can be killed in OOM situations (this allows each user to make their own choices wrt. overcommitment)

regards,

Rik
--
"What you're running that piece of shit Gnome?!?!"
-- Miguel de Icaza, UKUUG 2000

http://www.conectiva.com/ http://www.surriel.com/

--
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.eu.org/Linux-MM/

#6 lore raw
Quoted 14 lines · Rik van Riel
Quoted 10 lines · Jan Astalos

I still claim that per user swapfiles will:
- be _much_ more efficient in the sense of wasting disk space (saving money) because it will teach users efficiently use their memory resources (if user will waste the space inside it's own disk quota it will be his own problem)
- provide QoS on VM memory allocation to users (will guarantee amount of available VM for user)
- be able to improve _per_user_ performance of system (localizing performance problems to users that caused them and reducing disk seek times)
- shift the problem with OOM from system to user.

Quoted 6 lines

Do you have any reasons for this, or are you just asserting them as if they were fact? ;)

I think we can achieve the same thing, with higher over-all system performance, if we simply give each user a VM quota and do the bookkeeping on a central swap area.

Sorry, As a user I wouldn't care a bit about overall system performance... I would care only if I can get the service I has paid for.

Quoted 5 lines

The reasons for this are multiple:
1) having one swap partition will reduce disk seeks (no matter how you put it, disk seeks are a _system_ thing, not a per user thing)

I would be happy if you said that "we can guarantee that pages of one process will be swapped to compact swap area". Reading the code I didn't get that impression...

I didn't tested it (I always thought it's obvious) that storing a bunch of pages to and get another bunch from the same cylinder is _much_ faster than getting pages scattered over large disk space (maybe in different order) forcing disk heads to jump like mad. If you have tested it and can send me your results, please, do it. I may be wrong, nobody's perfect. :-) Technology changes, maybe disks have changed too...

Quoted 2 lines

2) not all users are logged in at the same time, so you can do a minimal form of overcomitting here (if you want)

Overcommitting of what ? Virtual memory ?

Quoted 5 lines

3) you can easily give users _2_ VM quotas, a guaranteed one and a maximum one ... if a user goes over the guaranteed quota, processes can be killed in OOM situations (this allows each user to make their own choices wrt. overcommitment)

What if user "suddenly" realizes that his guaranteed quota is not sufficient. Checkpoint ? Immediately contact sysadmin ?

Killing is bad (in general). By killing a process just to step outside of guaranteed quota may waste all resources consumed by killed process (including CPU time). Not saying that it's quite inconvenient for users. (thrashing, stealing, killing I wonder what's the most appropriate name for MM ;)

What I'd like to have are per user guarantees for:
- performance: no one will use physical memory allocated to me. No matter whether I'm drinking coffee or not. Waiting for system to swap-in/out pages that I have paid for is absolutely unacceptable performance drop. (I may not be drinking coffee, my app may be just waiting for input from its other part located anywhere else).
- reliability: system would prevent me from consuming more resources than I have. Especially the amount of requested VM can change over time.

Only if I ask, system will overcommit my VM memory. Then I should do checkpointing (if I'm able to do it and accept performance drop). Overcommitting of physical memory up to VM guarantee is obviously desired. Only if I allow others to use my unused memory, they would be allowed to. This can be motivated by different charging policies.
No page stealing (just lending and reclaiming).

Yes. This can be done with one big swapfile. But I tried to imagine how such system would be administered. And what would be the scalability of that administration. I got a sysadmin nightmare...
- users should be charged for guarantied amount of VM. Otherwise they would have maximal requirements -> wasted resources
- the requirements could vary quite deeply (user to user and also by time)
- sysadmin (or more likely his MM agent) will have to schedule users to resources by their (changing) requirements and should take care about not to guarantee more than he actually can. As I said, user may know his VM needs only when he decides to run his app with desired arguments.

Consider the maintenance costs in the case of per user swapfiles. Maybe they waste disk space when user is not logged in, but that's user's own disk space. He can do anything he like with it, right ? (QoS). (It could be used for storing of some persistent IPC objects...)

Maybe I'm only one with this view about memory QoS, but this can be solved only putting both solutions to users/sysadmins/managers and see what will happen... I'm far from claiming that per user swapfiles will be appropriate for all situations. So don't look at it as I would claim that anyone with different opinion is stupid. Everyone tends to bound his solution to concrete problem he has to solve. And seeing how my solution will fit to the requirements of other people is always helpful. I'm always willing to learn new things...

I certainly will implement my approach (in fact the most important part is more or less done by Andrey (thanks). If for nothing else, then just for seeing how it will perform. Look at it as at different approach to swap clustering. My main intention is to get the list of potential implementation pitfalls that can arise. Thanks.

Regards,

Jan
--
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.eu.org/Linux-MM/

#7 lore raw
Quoted 9 lines · Jan Astalos
Quoted 3 lines · Rik van Riel

I think we can achieve the same thing, with higher over-all system performance, if we simply give each user a VM quota and do the bookkeeping on a central swap area.

Sorry, As a user I wouldn't care a bit about overall system performance... I would care only if I can get the service I has paid for.

*sigh*

It's not always /you/ who is out drinking coffee. The other users will be drinking coffee too some of the time, and when they are out drinking coffee you'll have the extra performance they're not using at that moment.

Oh wait ... you didn't pay for it so you don't want it. ;)

Quoted 8 lines
Quoted 4 lines

The reasons for this are multiple:
1) having one swap partition will reduce disk seeks (no matter how you put it, disk seeks are a _system_ thing, not a per user thing)

I would be happy if you said that "we can guarantee that pages of one process will be swapped to compact swap area". Reading the code I didn't get that impression...

That's because it's not implemented yet. But I definately plan to have better swap clustering for Linux 2.5.

Quoted 5 lines

I didn't tested it (I always thought it's obvious) that storing a bunch of pages to and get another bunch from the same cylinder is _much_ faster than getting pages scattered over large disk space (maybe in different order) forcing disk heads to jump like mad.

It is. Unfortunately you won't be able to swap one thing in without swapping OUT something else. This is why you really really want to have the swap for all users in the same place on disk.

Quoted 4 lines
Quoted 2 lines

2) not all users are logged in at the same time, so you can do a minimal form of overcomitting here (if you want)

Overcommitting of what ? Virtual memory ?

Yes. If you sell resources to 10.000 users, there's usually no need to have 10.000 times the maximum per-user quota for every system resource.

Instead, you sell each user a guaranteed resource with the possibility to go up to a certain maximum. That way you can give your users a higher quality of service for much lower pricing, only with 99.999% guarantee instead of 100%.

Quoted 8 lines
Quoted 5 lines

3) you can easily give users _2_ VM quotas, a guaranteed one and a maximum one ... if a user goes over the guaranteed quota, processes can be killed in OOM situations (this allows each user to make their own choices wrt. overcommitment)

What if user "suddenly" realizes that his guaranteed quota is not sufficient. Checkpoint ? Immediately contact sysadmin ?

That's up to the user. In general the system resources between the guaranteed and the maximum quota should be fairly reliable (say, 99.99%). If the user really needs better than that, (s)he should buy more guaranteed quota...

Quoted 4 lines

Killing is bad (in general). By killing a process just to step outside of guaranteed quota may waste all resources consumed by killed process (including CPU time). Not saying that it's quite inconvenient for users.

Of course it's inconvenient, but it should be far less inconvenient than paying 10 times more for their quota on the system because they want everything to be guaranteed.

The difference between 99.99% and 99.999% usually isn't worth a 10-fold increase in price for most things.

Quoted 2 lines

What I'd like to have are per user guarantees for:
- performance: no one will use physical memory allocated to me.

So for /your/ system, you set the guaranteed and the maximum quota to the same value and have your users pay the 10-fold extra in price. If you can get any customers with that pricing, of course...

Quoted 5 lines

Waiting for system to swap-in/out pages that I have paid for is absolutely unacceptable performance drop. (I may not be drinking coffee, my app may be just waiting for input from its other part located anywhere else).

"Its other part" may benefit a lot from being able to use some extra physical memory by having something idle swapped out.

Quoted 3 lines

- reliability: system would prevent me from consuming more resources than I have. Especially the amount of requested VM can change over time.

That's an administrative decision. IMHO it would be a big mistake to hardcode this in the OS.

Also, you should remember that the overall system performance is an upper limit on the sum of per-user performance. Without good overall performance, you cannot support either a lot of users or good performance per user. This should most likely make it worth it to keep overall system performance in mind even when you're doing QoS things...

regards,

Rik
--
"What you're running that piece of shit Gnome?!?!"
-- Miguel de Icaza, UKUUG 2000

http://www.conectiva.com/ http://www.surriel.com/

--
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.eu.org/Linux-MM/

#8 lore raw
Quoted 9 lines · Rik van Riel

Yes. If you sell resources to 10.000 users, there's usually no need to have 10.000 times the maximum per-user quota for every system resource.

Instead, you sell each user a guaranteed resource with the possibility to go up to a certain maximum. That way you can give your users a higher quality of service for much lower pricing, only with 99.999% guarantee instead of 100%.

That's exactly what I was speaking about and what I've been implementing.. Rik, thanks for saying it for me :-)

Andrey
--
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.eu.org/Linux-MM/

#9 lore raw
In reply to Rik van Riel
Quoted 12 lines · Rik van Riel
Quoted 9 lines · Jan Astalos
Quoted 3 lines · Rik van Riel

I think we can achieve the same thing, with higher over-all system performance, if we simply give each user a VM quota and do the bookkeeping on a central swap area.

Sorry, As a user I wouldn't care a bit about overall system performance... I would care only if I can get the service I has paid for.

Quoted 8 lines

*sigh*

It's not always /you/ who is out drinking coffee. The other users will be drinking coffee too some of the time, and when they are out drinking coffee you'll have the extra performance they're not using at that moment.

Oh wait ... you didn't pay for it so you don't want it. ;)

If the extra performance means loss of reliability then the answer is no. Also, if I have to schedule 1000+ pieces of distributed app and cannot count with the extra performance the answer is no as well.

But back to your coffee drinking example. I think, that swapping out of idle programs could lead to serious problems with interactive performance. Ok, not every program needs it, but IMO it would be much more convenient for user to have some screensaver (or better
- moneysaver) which would suspend all his processes and return physical memory (temporarily) back to the system. Or to allow user to switch (use my free/all memory/don't use my memory).

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

The reasons for this are multiple:
1) having one swap partition will reduce disk seeks (no matter how you put it, disk seeks are a _system_ thing, not a per user thing)

Quoted 6 lines
Quoted 3 lines

I would be happy if you said that "we can guarantee that pages of one process will be swapped to compact swap area". Reading the code I didn't get that impression...

That's because it's not implemented yet. But I definately plan to have better swap clustering for Linux 2.5.

Can you share some ideas how it will look like ?

Quoted 11 lines
Quoted 6 lines

I didn't tested it (I always thought it's obvious) that storing a bunch of pages to and get another bunch from the same cylinder is _much_ faster than getting pages scattered over large disk space (maybe in different order) forcing disk heads to jump like mad.

It is. Unfortunately you won't be able to swap one thing in without swapping OUT something else. This is why you really really want to have the swap for all users in the same place on disk.

Why user that needs to swap something in should swap out the pages from another user ? Why not to get the LRU pages of that user and get the bunch of readahead pages from the (relatively) small swap area ? As Yuri has pointed out it's not that new idea...

Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

2) not all users are logged in at the same time, so you can do a minimal form of overcomitting here (if you want)

Overcommitting of what ? Virtual memory ?

Quoted 8 lines

Yes. If you sell resources to 10.000 users, there's usually no need to have 10.000 times the maximum per-user quota for every system resource.

Instead, you sell each user a guaranteed resource with the possibility to go up to a certain maximum. That way you can give your users a higher quality of service for much lower pricing, only with 99.999% guarantee instead of 100%.

You're right, I was shortsighted... ;).

Quoted 11 lines
Quoted 4 lines

Killing is bad (in general). By killing a process just to step outside of guaranteed quota may waste all resources consumed by killed process (including CPU time). Not saying that it's quite inconvenient for users.

Of course it's inconvenient, but it should be far less inconvenient than paying 10 times more for their quota on the system because they want everything to be guaranteed.

The difference between 99.99% and 99.999% usually isn't worth a 10-fold increase in price for most things.

Sometimes is. If you would have 1000 pieces, the probability that whole app would fail is 1% which is still quite high if you consider consumed resources and money spent. And if just putting of some additional swap area (inside otherwise unused disk quota) would make the guarantee rock solid it is certainly worth it.
(Welcome to grid computing ;).

Quoted 7 lines
Quoted 4 lines

- reliability: system would prevent me from consuming more resources than I have. Especially the amount of requested VM can change over time.

That's an administrative decision. IMHO it would be a big mistake to hardcode this in the OS.

How about to allow user to switch whether he needs to be limited by VM guarantee or not...

If you will add some per_user_clustering into swap, it will certainly perform better than per user swap files. But administration costs would be still equally high. Not saying that if user needs reliable service and system is not able to increase his guarantee (lack of resources), user has to wait -> lower interactive performance. Which will lead to batch queuing system.

Even with per user clustered swapfile, personal swapfiles still could get rid of low variations in user VM needs. Argument that they will waste disk space I can't accept. User can still mmap file for extending his VM memory. From this angle, personal swapfiles would be just an extra feature provided by system for non-developpers...

Regards,

Jan
--
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.eu.org/Linux-MM/