RE: [patch 18/26] drivers/scsi/megaraid.c: Replacing yield() with a better alternative

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

 



On Wednesday, November 08, 2006 10:56 PM, 
> For this driver cond_resched() seems to be a better alternative
Can you add some details on why cond_resched() better than yield()?
Is it because of _need_resched()_ checker in cond_resched()?


> -----Original Message-----
> From: linux-scsi-owner@xxxxxxxxxxxxxxx [mailto:linux-scsi-
> owner@xxxxxxxxxxxxxxx] On Behalf Of akpm@xxxxxxxx
> Sent: Wednesday, November 08, 2006 10:56 PM
> To: James.Bottomley@xxxxxxxxxxxx
> Cc: linux-scsi@xxxxxxxxxxxxxxx; akpm@xxxxxxxx;
amol@xxxxxxxxxxxxxxxxxxx
> Subject: [patch 18/26] drivers/scsi/megaraid.c: Replacing yield() with
a
> better alternative
> 
> From: Amol Lad <amol@xxxxxxxxxxxxxxxxxxx>
> 
> For this driver cond_resched() seems to be a better alternative
> 
> Signed-off-by: Amol Lad <amol@xxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
> ---
> 
>  drivers/scsi/megaraid.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff -puN
drivers/scsi/megaraid.c~drivers-scsi-megaraidc-replacing-yield-with-
> a drivers/scsi/megaraid.c
> ---
a/drivers/scsi/megaraid.c~drivers-scsi-megaraidc-replacing-yield-with-a
> +++ a/drivers/scsi/megaraid.c
> @@ -1753,7 +1753,8 @@ __mega_busywait_mbox (adapter_t *adapter
>  	for (counter = 0; counter < 10000; counter++) {
>  		if (!mbox->m_in.busy)
>  			return 0;
> -		udelay(100); yield();
> +		udelay(100);
> +		cond_resched();
>  	}
>  	return -1;		/* give up after 1 second */
>  }
> _
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi"
in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux