* __vm_enough_memory calculation when deactivating a swap device
@ 2019-06-30 19:57 Colin Hamilton
0 siblings, 0 replies; only message in thread
From: Colin Hamilton @ 2019-06-30 19:57 UTC (permalink / raw)
To: kernelnewbies
Hey everyone,
When the sys_swapoff() routine is attempting to deactivate a swap area
it checks to make sure there is enough free space to swap-in the
required new page frames from the deactivating swap device. In
__vm_enough_memory it adds to the free variable counting all currently
active swap pages, including from the device that is to be deactivated,
with:
free += get_nr_swap_pages();
My question/confusion is, why doesn't the kernel have code in
place to exclude free swap pages from the device that is to be
deactivated when __vm_enough_memory is used for this purpose?
Is it because it would require reworking too much of what approximately
works now? In other words, is this a cost/benefit decision to not have
that added logic? Or perhaps I'm just misunderstanding how something is
supposed to work?
Thanks,
--
Colin Hamilton <colin.hamilton@suse.com>
SUSE
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-06-30 19:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-30 19:57 __vm_enough_memory calculation when deactivating a swap device Colin Hamilton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).