<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Sched_noage in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sched-noage/m-p/3026586#M131685</link>
    <description>Hi Karen,&lt;BR /&gt;&lt;BR /&gt;There are two ways I know of :&lt;BR /&gt;&lt;BR /&gt;1) Walk the kernel process and thread structures to find this. Only HP staff are normally lazy enough to do this but I'll show you if you want! :-)&lt;BR /&gt;2) Use the pstat interface on 11.00 and beyond. A little knowledge of C is required here. The lwp_schedpolicy and pst_schedpolicy will tell you the thread/process scheduling, but you only really need to look at the thread data as they are really all that is scheduled to run. Compare the values returned for the definitions in /usr/include/sys/sched.h&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;James.</description>
    <pubDate>Thu, 17 Jul 2003 15:45:57 GMT</pubDate>
    <dc:creator>James Murtagh</dc:creator>
    <dc:date>2003-07-17T15:45:57Z</dc:date>
    <item>
      <title>Sched_noage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sched-noage/m-p/3026585#M131684</link>
      <description>We are at the point to use this HP feature on our application/database server. But does anyone know how to find if a particular process is using it or still using the default shceduler (sched_hpus)?&lt;BR /&gt;Thanks!&lt;BR /&gt;Karen</description>
      <pubDate>Thu, 17 Jul 2003 15:02:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sched-noage/m-p/3026585#M131684</guid>
      <dc:creator>Karen Shen_1</dc:creator>
      <dc:date>2003-07-17T15:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sched_noage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sched-noage/m-p/3026586#M131685</link>
      <description>Hi Karen,&lt;BR /&gt;&lt;BR /&gt;There are two ways I know of :&lt;BR /&gt;&lt;BR /&gt;1) Walk the kernel process and thread structures to find this. Only HP staff are normally lazy enough to do this but I'll show you if you want! :-)&lt;BR /&gt;2) Use the pstat interface on 11.00 and beyond. A little knowledge of C is required here. The lwp_schedpolicy and pst_schedpolicy will tell you the thread/process scheduling, but you only really need to look at the thread data as they are really all that is scheduled to run. Compare the values returned for the definitions in /usr/include/sys/sched.h&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;James.</description>
      <pubDate>Thu, 17 Jul 2003 15:45:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sched-noage/m-p/3026586#M131685</guid>
      <dc:creator>James Murtagh</dc:creator>
      <dc:date>2003-07-17T15:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Sched_noage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sched-noage/m-p/3026587#M131686</link>
      <description>Hi, James:&lt;BR /&gt;Thanks for the reply. I'd appreciate if you can show me how to do in either way.&lt;BR /&gt;Thanks&lt;BR /&gt;Karen</description>
      <pubDate>Thu, 17 Jul 2003 16:00:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sched-noage/m-p/3026587#M131686</guid>
      <dc:creator>Karen Shen_1</dc:creator>
      <dc:date>2003-07-17T16:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Sched_noage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sched-noage/m-p/3026588#M131687</link>
      <description>Hi Karen,&lt;BR /&gt;&lt;BR /&gt;I'll show you the q4 way now, as it is quicker. I'll add the pstat code when I'm able to write it, tonight or more likely tomorrow morning.&lt;BR /&gt;&lt;BR /&gt;11i&lt;BR /&gt;&lt;BR /&gt;# ied q4 /stand/vmunix /dev/kmem&lt;BR /&gt;q4&amp;gt; load proc_t from proc_list next p_factp max nproc&lt;BR /&gt;q4&amp;gt; keep p_pid == &lt;YOUR_PID&gt;&lt;BR /&gt;q4&amp;gt; load kthread_t from p_firstthreadp next kt_factp max p_livethreads&lt;BR /&gt;q4&amp;gt; print -x kt_tid kt_schedpolicy &lt;BR /&gt;&lt;BR /&gt;Which will produce something similar to the following, although how many entries will depend on how many threads you have.&lt;BR /&gt;&lt;BR /&gt;kt_tid kt_schedpolicy&lt;BR /&gt; 0x79b            0x2&lt;BR /&gt; 0x79a            0x2&lt;BR /&gt; 0x799            0x2&lt;BR /&gt; 0x798            0x2&lt;BR /&gt; 0x797            0x2&lt;BR /&gt; 0x796            0x2&lt;BR /&gt; 0x793            0x2&lt;BR /&gt; 0x769            0x2&lt;BR /&gt;&lt;BR /&gt;So you can see, after comparing 0x2 in sched.h that this is sched_hpux.&lt;BR /&gt;&lt;BR /&gt;On hpux 11.00, things are a little different in the proc and thread commands:&lt;BR /&gt;&lt;BR /&gt;# ied q4 /stand/vmunix /dev/kmem&lt;BR /&gt;q4&amp;gt; load struct proc from proc max nproc&lt;BR /&gt;q4&amp;gt; keep p_pid == &lt;YOUR_PID&gt;&lt;BR /&gt;q4&amp;gt; load kthread_t from p_firstthreadp next kt_link max p_livethreads&lt;BR /&gt;q4&amp;gt; print -x kt_tid kt_schedpolicy &lt;BR /&gt;&lt;BR /&gt;Which gives:&lt;BR /&gt;&lt;BR /&gt;kt_tid kt_schedpolicy&lt;BR /&gt; 0x6a4            0x6&lt;BR /&gt;&lt;BR /&gt;Here you can see the schedulicy policy is now 0x6, so this is SCHED_RTPRIO from sched.h. Basically I ran a job using rtprio and used this.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;James.&lt;/YOUR_PID&gt;&lt;/YOUR_PID&gt;</description>
      <pubDate>Thu, 17 Jul 2003 16:57:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sched-noage/m-p/3026588#M131687</guid>
      <dc:creator>James Murtagh</dc:creator>
      <dc:date>2003-07-17T16:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sched_noage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sched-noage/m-p/3026589#M131688</link>
      <description>Hi Karen,&lt;BR /&gt;&lt;BR /&gt;The pstat code is attached. I was a bit delayed as it uses different codes as the kernel/sched.h do, but i've listed them at the bottom of the output. You can compile it just using the following syntax:&lt;BR /&gt;&lt;BR /&gt;# cc -o lwp lwp.c&lt;BR /&gt;&lt;BR /&gt;The output is similar to the following and it takes a process PID as the argument:&lt;BR /&gt;&lt;BR /&gt;# ./lwp 1785&lt;BR /&gt;&lt;BR /&gt;Process: PID SCHED Command&lt;BR /&gt;: 1785 4 /opt/perf/bin/midaemon&lt;BR /&gt;&lt;BR /&gt;Thread: TID SCHED&lt;BR /&gt;: 1823 4&lt;BR /&gt;: 1834 4&lt;BR /&gt;: 1835 4&lt;BR /&gt;&lt;BR /&gt;HPUX TIMESHARE 1&lt;BR /&gt;HPUX RTPRIO 2&lt;BR /&gt;HPUX FIFO 4&lt;BR /&gt;POSIX RR 8&lt;BR /&gt;POSIX RR II 10&lt;BR /&gt;HPUX NOAGE 20&lt;BR /&gt;&lt;BR /&gt;(it doesn't have the ":"s, hopefully these will keep the format)&lt;BR /&gt;&lt;BR /&gt;I was also just thinking, if you wanted to scan all threads looking for certain schedling priorities, i.e. sched_noage, you could use (11i):&lt;BR /&gt;&lt;BR /&gt;q4&amp;gt; load kthread_t from kthread_list next kt_factp max nkthread&lt;BR /&gt;q4&amp;gt; keep kt_schedpolicy == 0x8&lt;BR /&gt;q4&amp;gt; print -tx|grep kt_tid    (find the thread you want to keep)&lt;BR /&gt;q4&amp;gt; keep kt_tid == &lt;YOUR_THREAD&gt;&lt;BR /&gt;q4&amp;gt; load proc_t from kt_procp&lt;BR /&gt;q4&amp;gt; print -x p_comm&lt;BR /&gt; p_comm&lt;BR /&gt;"midaemon"&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;James.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/YOUR_THREAD&gt;</description>
      <pubDate>Sat, 19 Jul 2003 09:46:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sched-noage/m-p/3026589#M131688</guid>
      <dc:creator>James Murtagh</dc:creator>
      <dc:date>2003-07-19T09:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Sched_noage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sched-noage/m-p/3026590#M131689</link>
      <description>Hi (again) Karen,&lt;BR /&gt;&lt;BR /&gt;Sorry, that was the wrong version of the code. I won't post it again, if you just move "#endif" to immediately below "#define PS_NOAGE 0x20" this should work on 11.00 and 11i whether sched_noage is implemented or not.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;James.&lt;BR /&gt;</description>
      <pubDate>Sat, 19 Jul 2003 10:04:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sched-noage/m-p/3026590#M131689</guid>
      <dc:creator>James Murtagh</dc:creator>
      <dc:date>2003-07-19T10:04:34Z</dc:date>
    </item>
  </channel>
</rss>

