On 2016-04-27 12:15, Bjoern Voigt wrote:
Any ideas? What is a reasonable time for swapoff? I probably found the answer. It's a Kernel problem:
"The function responsible for deactivating an area is, predictably enough, called sys_swapoff(). This function is mainly concerned with updating the swap_info_struct. The major task of paging in each paged-out page is the responsibility of try_to_unuse() which is /extremely/ expensive. For each slot used in the swap_map, the page tables for processes have to be traversed searching for it. In the worst case, all page tables belonging to all mm_structs may have to be traversed. Therefore, the tasks taken for deactivating an area are broadly speaking;" Sources: https://www.kernel.org/doc/gorman/html/understand/understand014.html#toc81 http://www.faqoverflow.com/unix/45673.html
Unfortunately nobody seems to work on this. There was a discussion 2007 on Kernel mailing list, but without results: http://copilotco.com/mail-archives/linux-kernel.2007/msg39423.html
Makes sense. I just said in another post that "swapoff" must be seen like a very little used thing, so no interest in improving it. -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)