Re: idle task check

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

 



this what i was talking you about :)

On Sat, May 9, 2015 at 9:29 PM, nick <xerofoify@xxxxxxxxx> wrote:


On 2015-05-09 12:44 PM, Mustafa Hussain wrote:
> Hi all,
>
> i am working with __sched __schedule()
>
> and i want to add some thing i want to check whether the prev will become
> idle or not how can i do this.
>
> thanks in advance
>
>    -
>    -
Mustafa,
After looking around in pick_next_task there is a scheduler class called
idle_sched_class for idling when tasks need to be run. Something like
/*declare sched_class pointer to idle_sched_class address*/
const struct sched_class *idle=&idle_sched_class;
/*Check if the pointer pointing to the idle class is equal to prev's sched_class*/
if(prev->sched_class == idle)
After this condition you can just:
printk(KERN_INFO "Prev is equal to idle_sched_class,now running the idle sched_class\n");
If you have another question about this please let me known.
Cheers,
Nick
>
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@xxxxxxxxxxxxxxxxx
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux