<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style title="owaParaStyle"><!--P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
--></style>
<meta content="MSHTML 6.00.6000.17063" name="GENERATOR">
</head>
<body ocsi="x">
<div dir="ltr"> </div>
<div></div>
<div>
<div dir="ltr"><font face="Tahoma" color="#000000" size="2">Hi ,</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">I need your help to solve below confusion.</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">1. I know that spin_lock_irqsave, disables premption and local_irq.</font></div>
<div dir="ltr"><font face="tahoma" size="2">2. There is some below piece of kernel code running on Quad core Machine.</font></div>
<div dir="ltr"><font face="tahoma" size="2"> spin_lock_irqsave(&lock, flags);</font></div>
<div dir="ltr"><font face="tahoma" size="2"> some_large_critical_section //sleep of 5 minutes</font></div>
<div dir="ltr"><font face="tahoma" size="2"><font face="tahoma"> </font>//I know there should be as small as possible task in critical section</font></div>
<div dir="ltr"><font face="tahoma" size="2"> // treat this as an example only</font></div>
<div dir="ltr"><font face="tahoma" size="2"> spin_lock_irqrestore();</font></div>
<div dir="ltr"><font face="tahoma" size="2">3. One of the CPU core tries to execute this code and so acquires the lock.</font></div>
<div dir="ltr"><font face="tahoma" size="2">4. Now, second core is also goes to execute same piece of code and so will keep spinning for lock</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">Now, the question is </font></div>
<div dir="ltr"><font face="tahoma" size="2">Will EVER second CPU core get chance to execute another task ?
</font></div>
<div dir="ltr"><font face="tahoma" size="2">Ever if timeslice is over for the current task ?</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">What if scheduler code is running on CPU core-3 and sees that
</font></div>
<div dir="ltr"><font face="tahoma" size="2"><font face="tahoma"><font face="tahoma" size="2"><font face="tahoma"><font face="tahoma" size="2"><font face="tahoma">timeslice</font></font></font></font> for
</font>task running on CPU core-2 has expired ?</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">I guess timeslice expire case is not as same as preemption. Or may be I am terribly wrong.</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">Please help,</font></div>
<div dir="ltr"><font face="tahoma" size="2">Thanks,</font></div>
<div dir="ltr"><font face="tahoma" size="2">Viral</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
</div>
<br>
<hr>
<font face="Arial" color="Black" size="3">The contents of this e-mail and any attachment(s) may contain confidential or privileged information for the intended recipient(s). Unintended recipients are prohibited from taking action on the basis of information
in this e-mail and using or disseminating the information, and must notify the sender and delete it from their system. L&T Infotech will not accept responsibility or liability for the accuracy or completeness of, or the presence of any virus or disabling code
in this e-mail"<br>
</font>
<BR>
______________________________________________________________________<BR>
</body>
</html>