Mailing List archive

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

[vdr] "fast" memory model .. ?!



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

last time i patched around bitstreamout,
i thought about to force memory into RAM,
to have it fast and responsiveness ... -> no swapping , no moving around ..
especially for kinda ringbuffers ..

this makes a positive difference within a heavy load environment,
e.g. many recordings and transfere streams .. encodings etc.

so instead of "just" call alloc, i use:

+++
    if ((shmfd = shm_open("/vdr_bitstreamout_memory", O_RDWR|O_CREAT, S_IRUSR|S_IWUSR)) < 0) {
        esyslog("cBitStreamOut::Start() shm_open failed: %s\n", strerror(errno));
        goto err;
    }
    if(ftruncate(shmfd, sizeof(uint_8)*OVERALL_MEM) < 0) {
        esyslog("cBitStreamOut::Start() ftruncate (%d) failed: %s\n",
                 sizeof(uint_8)*OVERALL_MEM, strerror(errno));
        goto err;
    }

    setup.buf = (uint_8*)mmap(NULL, sizeof(uint_8)*OVERALL_MEM,
                              PROT_READ|PROT_WRITE,
                              MAP_PRIVATE|MAP_NORESERVE|MAP_LOCKED,
                              shmfd, 0);

    if (setup.buf == MAP_FAILED) {
        esyslog("cBitStreamOut::Start() mmap failed: %s\n", strerror(errno));
        goto err;
    }

    if(mlock(setup.buf, sizeof(uint_8)*OVERALL_MEM) < 0)
        dsyslog("cBitStreamOut::Start() mlock failed: %s\n", strerror(errno));
+++

maybe this should be used for any ringbuffers within vdr ?

if you say this is true, i will do a little easy alloc/free wrapping
for this purpose ..


your opinion ?

cheers, sven

- -- 
health & wealth
mailto:sgoethel@jausoft.com
www   : http://www.jausoft.com ; pgp: http://www.jausoft.com/gpg/
voice : +49-5121-999600 ; fax : +49-5121-999602
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/ixYFHdOA30NoFAARApsZAJ92PmbmHwggoOHV3H1MtOsTFW7gNACgus9Z
T3L6M/N5R3XuhVwfCoZLRxY=
=OLUo
-----END PGP SIGNATURE-----



-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index