tech-kern archive

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

Re: Autotuning of kern.ipc.shmmaxpgs



Joerg Sonnenberger <joerg%britannica.bec.de@localhost> wrote:
> -     shminfo.shmmax *= PAGE_SIZE;
> +     if (shminfo.shmmax == 0) {
> +             shminfo.shmmax = physmem / 4 * PAGE_SIZE;
> +             if (shminfo.shmmax < 1024)
> +                     shminfo.shmmax = 1024;
> +     } else {
> +             shminfo.shmmax *= PAGE_SIZE;
> +     }
> +     shminfo.shmall = shminfo.shmmax / PAGE_SIZE;

I would simplify this as:

shminfo.shmmax = max(physmem / 4 * PAGE_SIZE, PAGE_SIZE);
shminfo.shmall = shminfo.shmmax >> PAGE_SHIFT;

Also, I think remove SHMMAX/SHMMAXPGS check completely, that is, no need
to have if (shminfo.shmmax) case.

-- 
Best regards,
Mindaugas


Home | Main Index | Thread Index | Old Index