Re: how set_user_nice() function is called

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

 





On Tue, Nov 22, 2011 at 3:53 PM, Enes Albay - انس الباى <albayenes@xxxxxxxxx> wrote:
Thanks for reply.

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()->...

Regards.

On Mon, Nov 21, 2011 at 3:59 AM, Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx> wrote:
On Mon, Nov 21, 2011 at 00:31, Enes Albay - انس الباى
<albayenes@xxxxxxxxx> wrote:
> Hi!
>
> anybody knows that where is set_user_nice() function called in the kernel?
> i couldn't find that.  i just found that in forking operation
> do_fork()->copy_process()->
> dup_task_struct() called then set_user_nice()
> called but i couldn't find that where. Also how/where do_fork() function
> called in kernel i couldn't find.

In x86, do_fork() is called from sys_fork()... check :
http://lxr.linux.no/#linux+v3.1.1/arch/x86/kernel/process.c#L235

While sys_fork() itself, since it's a syscall handler, is called from
entry.S. Please refer to:
http://lxr.linux.no/#linux+v3.1.1/arch/x86/ia32/ia32entry.S#L475



--
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com



--
Enes Albay


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

make use of cscope to get the locations from whr set_user_nice() is called. I did egrep pattern search using cscope and could see it getting called from many locations : -

0 loop.c                   578 set_user_nice(current, -20);
1 nbd.c                    505 set_user_nice(current, -20);
2 pktcdvd.c               1567 set_user_nice(current, -20);
3 ipmi_si_intf.c          1012 set_user_nice(current, 19);
4 dmatest.c                291 set_user_nice(current, 10);
5 ap_bus.c                1563 set_user_nice(current, 19);
6 bnx2fc_fcoe.c            436 set_user_nice(current, -20);
7 bnx2fc_fcoe.c            567 set_user_nice(current, -20);
8 fcoe.c                  1646 set_user_nice(current, -20);
9 ibmvfc.c                4438 set_user_nice(current, -20);
a ibmvscsi.c              1891 set_user_nice(current, -20);
b lpfc_hbadisc.c           715 set_user_nice(current, -20);
c qla_os.c                3314 set_user_nice(current, -20);
d main.c                  2322 set_user_nice(speakup_task, 10);
e target_core_transport.c 6091 set_user_nice(current, -20);
f tfc_cmd.c                702 set_user_nice(current, -20);
g fs-writeback.c           902 set_user_nice(current, 0);
h background.c              83 set_user_nice(current, 10);
i heartbeat.c             1093 set_user_nice(current, -20);
j sched.h                 2037 extern void set_user_nice(struct task_struct *p, long nice);
k exit.c                   350 set_user_nice(current, 0);
l hung_task.c              195 set_user_nice(current, 0);
m kmod.c                   157 set_user_nice(current, 0);
n rcutorture.c             867 set_user_nice(current, 19);
o rcutorture.c             910 set_user_nice(current, 19);
p rcutorture.c             993 set_user_nice(current, 19);
q rcutree_plugin.h        1452 set_user_nice(current, 19);
r rtmutex-tester.c         307 set_user_nice(current, 0);
s sched.c                 4880 void set_user_nice(struct task_struct *p, long nice)
t sched.c                 4925 EXPORT_SYMBOL(set_user_nice);
u sched.c                 4977 set_user_nice(current, nice);
v sched.c                 8271 set_user_nice(p, 0);
w sys.c                    168 set_user_nice(p, niceval);
x ring_buffer_benchmark.c  453 set_user_nice(consumer, consumer_nice);
y ring_buffer_benchmark.c  462 set_user_nice(producer, producer_nice);
z workqueue.c             2034 set_user_nice(current, RESCUER_NICE_LEVEL);
A backing-dev.c            272 set_user_nice(current, 0);

रेगार्ड्स,
रोहन पूरी


_______________________________________________
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