<html><body><div style="color:#000; background-color:#fff; font-family:lucida console, sans-serif;font-size:10pt"><div><span>Hi All,</span></div><div><span></span> </div><div><span>From the patch it seems that it modifies the system call "ptctl".</span></div><div><span>So I guess this system call modifies the <span id="misspell-1"><span>behavior</span></span> of the child process.</span></div><div><span></span> </div><div><span>From the patch:</span></div><div><span><span class="p_chunk"></span></span> </div><div><span><span class="p_chunk">@@ -1917,12 +1918,10 @@</span> <span class="p_context"> SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,</span><br>                         error = current->timer_slack_ns;<br>                         break;<br>                 case PR_SET_TIMERSLACK:<br><span class="p_del">-                        if (arg2 <= 0)</span><br><span class="p_del">-                                current->timer_slack_ns =</span><br><span class="p_del">-                                
        current->default_timer_slack_ns;</span><br><span class="p_del">-                        else</span><br><span class="p_add">+                        if (arg2 <= HRTIMER_MAX_SLACK)</span><br>                                 current->timer_slack_ns = arg2;<br><span class="p_del">-                        error = 0;</span><br><span class="p_add">+                        else</span><br><span class="p_add">+                                error = -EINVAL;</span></span></div><div><span><span class="p_add"></span></span> </div><div><span><span class="p_add"></span></span> </div><div><span><span class="p_add">And <span>From the patch <span id="misspell-15"><span>describing</span></span>:</span></span></span></div><div><span>"</span><span>This patch proposes a system-wide sysctl-aware default for the<br>high-resolution timer slack value, which may be changed from 0<br>to HRTIMER_MAX_SLACK nanoseconds. Default system-wide and per-task<br>values are HRTIMER_DEFAULT_SLACK. Per-task value isn't inherited<br>across fork(); instead, newborn task uses system-wide value by<br>default, and
newborn thread uses it's group leader value."<br><span class="signed-off-by"></span></span></div><div><span>So the second argument to this system call can set the new Time slack value for the child process</span></div><div><span>this value can also be set from the sysctl command.</span></div><div><span></span> </div><div><span></span> </div><div><span>Here is the example from Linux Test Project (ltp) </span></div><div><span></span> </div><div><span>$ltp/testcases/kernel/syscalls/prctl/prctl02.c</span></div><div><span></span> </div><div><span></span> </div><div><span> switch (child_pid = FORK_OR_VFORK()) {</span></div><div><span> case
-1:<br> /* fork() failed */<br> tst_resm(TFAIL, "fork() failed");<br> continue;</span></div><div><span> case
0:<br> /* Child */</span></div><div><span> TEST(prctl(test_cases[i].option,<br> test_cases[i].arg2));<br> if ((TEST_RETURN == -1) && (TEST_ERRNO
==<br> test_cases[i].<br> exp_errno))
{<br> exit(TEST_ERRNO);<br> } else {<br> tst_resm(TWARN|TTERRNO, "prctl() returned
%ld",<br> TEST_RETURN);<br> exit(TEST_ERRNO);<br> }</span></div><div><span></span> </div><div><var id="yui-ie-cursor"></var>I guess this is the <span id="misspell-42">correct</span> example for this.</div><div>Please <span id="misspell-43">correct</span>
me if I am wrong.</div><div> </div><div>-Anand Moon<br></div> <div style="font-family: lucida console, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> <div style="margin: 5px 0px; padding: 0px; border: 1px solid rgb(204, 204, 204); height: 0px; line-height: 0; font-size: 0px;" class="hr" contentEditable="false" readonly="true"></div> <b><span style="font-weight: bold;">From:</span></b> trisha yad <trisha1march@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> naveen yadav <yad.naveen@gmail.com> <br><b><span style="font-weight: bold;">Cc:</span></b> Daniel Baluta <daniel.baluta@gmail.com>; Kernelnewbies@kernelnewbies.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Monday, March 5, 2012 4:14 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: slacks usage,..<br> </font>
</div> <br>
Thanks a lot.<br><br><br>On Mon, Mar 5, 2012 at 4:11 PM, naveen yadav <<a href="mailto:yad.naveen@gmail.com" ymailto="mailto:yad.naveen@gmail.com">yad.naveen@gmail.com</a>> wrote:<br>> Thanks Daniel, I got it ^^.<br>><br>><br>> On Mon, Mar 5, 2012 at 2:52 PM, Daniel Baluta <<a href="mailto:daniel.baluta@gmail.com" ymailto="mailto:daniel.baluta@gmail.com">daniel.baluta@gmail.com</a>> wrote:<br>>> On Mon, Mar 5, 2012 at 11:00 AM, trisha yad <<a href="mailto:trisha1march@gmail.com" ymailto="mailto:trisha1march@gmail.com">trisha1march@gmail.com</a>> wrote:<br>>>> Hi All,<br>>>><br>>>> I am going through below topic http://patches.linaro.org/6833/. I<br>>>> could not got the meaning of slacks. Why I need this ..<br>>>> Is there some real example of need of slacks.<br>>><br>>> Have you tried searching for it? :D [1].<br>>><br>>> thanks,<br>>>
Daniel.<br>>><br>>> [1] <a href="https://lwn.net/Articles/369549/" target="_blank">https://lwn.net/Articles/369549/</a><br>>><br>>> _______________________________________________<br>>> Kernelnewbies mailing list<br>>> <a href="mailto:Kernelnewbies@kernelnewbies.org" ymailto="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies<br><br>_______________________________________________<br>Kernelnewbies mailing list<br><a href="mailto:Kernelnewbies@kernelnewbies.org" ymailto="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><br> </div> </div> </div></body></html>