Re: [patch] voluntary-preempt-2.6.8-rc3-O4

From: Ingo Molnar
Date: Tue Aug 10 2004 - 03:46:52 EST



* Lee Revell <rlrevell@xxxxxxxxxxx> wrote:

> On Mon, 2004-08-09 at 22:06, Lee Revell wrote:
>
> > Same results here, the mlockall problem is not fixed by -O4:
>
> Correction, those traces did not involve mlockall at all, but
> kmap_atomic and get_user_pages.
>
> Here is another one I got starting jackd. Never seen it before today.
>
> (jackd/778): 14583us non-preemptible critical section violated 1100 us
> preempt threshold starting at schedule+0x55/0x5a0 and ending at
> schedule+0x2ed/0x5a0

can you trigger similar latencies via the attached mlock testcode?
(written by Florian. Run it as root.)

Ingo
// here is the code i used to test the mlockall caused xruns
#include <sys/mman.h>
#include <iostream>
#include <sstream>
#include <unistd.h>

int main (int argc, char *argv[]) {
if (argc < 2) {
std::cout << "how many kbytes you want allocated and mlockall'ed?" << std::endl;
}

std::stringstream stream(argv[1]);
int kbytes;
stream >> kbytes;
char *mem = new char[kbytes*1024];
std::cout << "filling with 0's" << std::endl;
for (int i = 0; i < kbytes*1024; ++i) {
mem[i] = 0;
}

std::cout << "ok, you want " << kbytes << "kb of memory mlocked. going for it.." << std::endl;
int error = mlockall(MCL_CURRENT);
if (error != 0) { std::cout << "mlock error" << std::endl; }
else { std::cout << "mlock successfull" << std::endl;}
}