Opened 2 years ago

Last modified 2 years ago

#19 new enhancement

Would it be technically possible to allocate a new swap-file in a non-blocking manner?

Reported by: 123.wizek@… Owned by: somebody
Priority: normal Milestone:
Component: component1 Version:
Severity: Fails to communicate failure Keywords: question
Cc:

Description (last modified by jtv)

I like Swapspace, have been using it for a few months now.

Although, I notice, that there is a situation in which my system almost completely locks up when a new swapfile is being allocated. Even if I jump to TTY1 (via Ctrl+Alt+F1), I can't type anything there until the allocation is complete.

I understand that if the system is severely out of memory, it is a good idea to block all other computations until more memory is made available through the new swapfile.

But I wonder, if the memory pressure is not that immediate (e.g. the system has *just* tipped over the threshold but there are still some gigabytes left available) couldn't the allocation process be non-blocking?

So, in summary, my question is two-fold: 1) Technically, is it possible to allocate a swapfile in the background in a manner that doesn't lock up the computer? 2) Would it make sense for swapspace to observe two thresholds, 1 soft OOM threshold, which means that all other computation can continue, and 1 hard OOM threshold which locks up the computer just like it does right now.

If your answer is yes to both, then I will consider making a patch with the changed functionality.

Version: swapspace 1.10-4, Wed, 17 Sep 2008

Change History (4)

comment:1 Changed 13 years ago by jtv

  • Description modified (diff)

comment:2 Changed 13 years ago by jtv

  • Description modified (diff)

comment:3 Changed 8 years ago by jtv

  • Description modified (diff)
  • Severity changed from normal to Ugly

comment:4 Changed 2 years ago by jtv

Actually swapspace already sort of has this: it tries to keep the proportion of available memory in a configurable range, so it doesn't wait until you've already run out.

But yes, when memory runs short, you still get this unresponsive system. I think the problem may be that the system swaps out pages in order to make room for the new file, so the expansion is accompanied by a swap storm.

Note: See TracTickets for help on using tickets.