Re: [4.4, 4.5, 4.6] Regression: encrypted swap (dm-crypt) freezes system while under memory pressure and swapping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Ondrej...

Thanks for taking the time.

On 27/04/16 17:13, Ondrej Kozina wrote:

> I observe that putting swap on top of dm-crypt (tested in current 4.6-rc
> kernel) have some unexpected side effects. Most notably it seems to me
> that oom killer joins the party quite prematurely even when there
> remains plenty of free swap space (almost all). But I didn't experience
> any permanent system freeze or crash. Just, let us dig deeper for a
> while...

Yes, 4.6-rc* behaves different from 4.4.x and >= 4.5-rc3 but it still
does not work correctly at all. You may want to try the little test
program I created and attached. I used it quite a lot to stress the system.

With that, you should have no problem seeing the described behavior on
the affected kernels. You may have to adjust the sleep a bit, depending
on your machine, though.

If there is anything else I can do to help, please let me know.

Have a nice day,
Matthias

-- 
Dipl.-Inf. (FH) Matthias Dahl | Software Engineer | binary-island.eu
 services: custom software [desktop, mobile, web], server administration
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

int main(int argc, char** argv)
{
    unsigned long chunkSize = 1 << 20;       // 1 MiB per \ total mem alloc
    unsigned long maxRuns   = 8 * (1 << 10); // 2^10 runs / of 8 GiB
    void* buffer  = NULL;

    if(argc == 3)
    {
        chunkSize = atol(argv[1]);
        maxRuns   = atol(argv[2]);
    }

    unsigned long maxMemAllocInMB    = (chunkSize * maxRuns) / (1 << 20);
    unsigned long curMemAllocInBytes = 0;

    for(unsigned int i = 0; i < maxRuns; ++i)
    {
        buffer = malloc(chunkSize);
        memset(buffer, 0, chunkSize);

        curMemAllocInBytes += chunkSize;
        printf("%lu MB / %lu MiB allocated (%lu bytes).\n", (curMemAllocInBytes / (1 << 20)), maxMemAllocInMB, curMemAllocInBytes);

        usleep(500);
    }

    return 0;
}
--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux