[gst-devel] Gstreamer and Multi-core

ROSH CHERIAN rosh at tid.es
Thu Nov 6 10:11:45 CET 2008


Thank you Wim, for the quick comment.
Good to know that you are working on a solution for scheduling priority and I hope core affinity would also be looked into.
I have a proposal for implementation, which is to set the affinity in the gst_pad_push_event() of the gstpads.c file.

I enclose the result of a test that I did to verify the result of my implementation,

regards,
Rosh



file: gstpads.c


/*
CPU Affinity setting patch
Rosh at tid.es
*/

gint set_affinity(GstPad* pad) {

  GstObject* objPar =  (GstObject*) GST_OBJECT_PARENT (pad);
  cpu_set_t set;
  struct sched_param param;

  if(objPar->_cpu_affinity!=-1){
    printf("###########  Setting affinity of '%s' running in thread %x to %d ######## \n",
           objPar->name,
           pthread_self(),
           objPar->_cpu_affinity);

    CPU_ZERO(&set);
    CPU_SET(objPar->_cpu_affinity,&set);

    sched_setaffinity(0, sizeof(cpu_set_t),
                          &set);

    objPar->_cpu_affinity=-1;


    /*
    //this part is for setting real time priority, if needed
    memset(&param, 0, sizeof(sched_param));
    param.sched_priority = objPar->_prio;
    if(sched_setscheduler(0, SCHED_FIFO, &param) == -1)
      {
        printf("error in setting priority >>>>>>>>>>> \n");
      }

    */
}
________________________________________
From: Wim Taymans [wim.taymans at gmail.com]
Sent: 05 November 2008 16:00
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] Gstreamer and Multi-core

On Wed, 2008-11-05 at 14:30 +0100, ROSH CHERIAN wrote:
> As multi-core processor systems  are increasingly being used in high end media applications such as near-zero latency 3D video conferencing, what kind of support does Gstreamer provide so that this could be used to the full extent?
>
> In such high load applications, there could be plugins that need to communicate with hardware which are asymmetrically distributed among cores. For eg:in the HP ProLiant DL785 G5  machine(with 32 cores), only some cores are designed to have direct connection to PCI Express.  Hence a camera capture source plugin might prefer to be run in one of such cores.
>
> Wouldn't it be nice to have plugins to be able to specify the affinity to a certain core as a property, thereby bypassing kernel's allocation?
> In other words, the thread that runs the work doing function of all the plugins that belong to the same thread, should be able to be started in the core that is specified by one of the plugins in that thread.
>
> Is this an item of interest in the gstreamer community?

Yes, I think it relates to controlling the scheduling priority of
certain streaming threads, which is something we're going to try to
implement in the next months.

Wim
>
> regards,
> Rosh
>
>
>
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GstreamerCpuAffinityTest.pdf
Type: unknown/unknown
Size: 940358 bytes
Desc: GstreamerCpuAffinityTest.pdf
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20081106/a649327c/attachment.bin>


More information about the gstreamer-devel mailing list