<br><br><div class="gmail_quote">On Tue, Nov 22, 2011 at 3:53 PM, Enes Albay - انس الباى <span dir="ltr"><<a href="mailto:albayenes@gmail.com">albayenes@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Thanks for reply.<br><br>I also asked that set_user_nice where and when
is called(file and line). I think it is not called after each forking
operation, isn't it? Could you give calling order between functions from
do_fork() like that func1()->func2()->...<br>
<br>Regards. <br><br><div class="gmail_quote">On Mon, Nov 21, 2011 at 3:59 AM, Mulyadi Santosa <span dir="ltr"><<a href="mailto:mulyadi.santosa@gmail.com" target="_blank">mulyadi.santosa@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Mon, Nov 21, 2011 at 00:31, Enes Albay - انس الباى<br>
<<a href="mailto:albayenes@gmail.com" target="_blank">albayenes@gmail.com</a>> wrote:<br>
> Hi!<br>
><br>
> anybody knows that where is set_user_nice() function called in the kernel?<br>
> i couldn't find that. i just found that in forking operation<br>
> do_fork()->copy_process()-><br>
> dup_task_struct() called then set_user_nice()<br>
> called but i couldn't find that where. Also how/where do_fork() function<br>
> called in kernel i couldn't find.<br>
<br>
</div>In x86, do_fork() is called from sys_fork()... check :<br>
<a href="http://lxr.linux.no/#linux+v3.1.1/arch/x86/kernel/process.c%23L235" target="_blank">http://lxr.linux.no/#linux+v3.1.1/arch/x86/kernel/process.c#L235</a><br>
<br>
While sys_fork() itself, since it's a syscall handler, is called from<br>
entry.S. Please refer to:<br>
<a href="http://lxr.linux.no/#linux+v3.1.1/arch/x86/ia32/ia32entry.S%23L475" target="_blank">http://lxr.linux.no/#linux+v3.1.1/arch/x86/ia32/ia32entry.S#L475</a><br>
<span><font color="#888888"><br>
<br>
<br>
--<br>
regards,<br>
<br>
Mulyadi Santosa<br>
Freelance Linux trainer and consultant<br>
<br>
blog: <a href="http://the-hydra.blogspot.com" target="_blank">the-hydra.blogspot.com</a><br>
training: <a href="http://mulyaditraining.blogspot.com" target="_blank">mulyaditraining.blogspot.com</a><br>
</font></span></blockquote></div><font color="#888888"><br><br clear="all"><br>-- <br><div style="text-align:left">Enes Albay<span style="font-size:14pt;line-height:115%" lang="AR-SA"></span><span dir="LTR"></span><span dir="LTR" style="font-size:14pt;line-height:115%" lang="AR-SA"><span dir="LTR"></span></span><span style="font-size:14pt;line-height:115%" lang="AR-SA"></span><br>
</div><br>
</font><br>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div>make use of cscope to get the locations from whr <span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); ">set_user_nice() is called. I did egrep pattern search using cscope and could see it getting called from many locations : -</span><div>
<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); "><div>
0 loop.c 578 set_user_nice(current, -20);</div><div>1 nbd.c 505 set_user_nice(current, -20);</div><div>2 pktcdvd.c 1567 set_user_nice(current, -20);</div><div>3 ipmi_si_intf.c 1012 set_user_nice(current, 19);</div>
<div>4 dmatest.c 291 set_user_nice(current, 10);</div><div>5 ap_bus.c 1563 set_user_nice(current, 19);</div><div>6 bnx2fc_fcoe.c 436 set_user_nice(current, -20);</div><div>7 bnx2fc_fcoe.c 567 set_user_nice(current, -20);</div>
<div>8 fcoe.c 1646 set_user_nice(current, -20);</div><div>9 ibmvfc.c 4438 set_user_nice(current, -20);</div><div>a ibmvscsi.c 1891 set_user_nice(current, -20);</div><div>b lpfc_hbadisc.c 715 set_user_nice(current, -20);</div>
<div>c qla_os.c 3314 set_user_nice(current, -20);</div><div>d main.c 2322 set_user_nice(speakup_task, 10);</div><div>e target_core_transport.c 6091 set_user_nice(current, -20);</div><div>f tfc_cmd.c 702 set_user_nice(current, -20);</div>
<div>g fs-writeback.c 902 set_user_nice(current, 0);</div><div>h background.c 83 set_user_nice(current, 10);</div><div>i heartbeat.c 1093 set_user_nice(current, -20);</div><div>j sched.h 2037 extern void set_user_nice(struct task_struct *p, long nice);</div>
<div>k exit.c 350 set_user_nice(current, 0);</div><div>l hung_task.c 195 set_user_nice(current, 0);</div><div>m kmod.c 157 set_user_nice(current, 0);</div><div>n rcutorture.c 867 set_user_nice(current, 19);</div>
<div>o rcutorture.c 910 set_user_nice(current, 19);</div><div>p rcutorture.c 993 set_user_nice(current, 19);</div><div>q rcutree_plugin.h 1452 set_user_nice(current, 19);</div><div>r rtmutex-tester.c 307 set_user_nice(current, 0);</div>
<div>s sched.c 4880 void set_user_nice(struct task_struct *p, long nice)</div><div>t sched.c 4925 EXPORT_SYMBOL(set_user_nice);</div><div>u sched.c 4977 set_user_nice(current, nice);</div>
<div>v sched.c 8271 set_user_nice(p, 0);</div><div>w sys.c 168 set_user_nice(p, niceval);</div><div>x ring_buffer_benchmark.c 453 set_user_nice(consumer, consumer_nice);</div><div>y ring_buffer_benchmark.c 462 set_user_nice(producer, producer_nice);</div>
<div>z workqueue.c 2034 set_user_nice(current, RESCUER_NICE_LEVEL);</div><div>A backing-dev.c 272 set_user_nice(current, 0);</div><div><br></div><div>रेगार्ड्स,</div><div>रोहन पूरी</div><div><br></div>
<div><br></div></span></div>