Skip to contentSkip to conversation

a bug in AS scheduler?

DISCUSSION Xiaoning Ding 3 participants 5 messages Feb 28, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

I am reading the source code AS scheduler in 2.6.18(as-ioscheduler.c). In function as_close_req, variable delay is in millisecond, while ad->antic_expire is in jiffies. Doesn't the comparison of delay and ad->antic_expire make any problem?
The related source code is quoted blow:

	if (ad->antic_status == ANTIC_OFF || !ad->ioc_finished)
		delay = 0;
	else
		delay = ((jiffies - ad->antic_start) * 1000) / HZ;

	if (delay == 0)
		delta = 8192;
	else if (delay <= 20 && delay <= ad->antic_expire)
		delta = 8192 << delay;
	else
		return 1;

Xiaoning

#1 lore raw
Quoted 8 lines · Xiaoning Ding

Hi,

I am reading the source code AS scheduler in 2.6.18(as-ioscheduler.c). In function as_close_req, variable delay is in millisecond, while ad->antic_expire is in jiffies. Doesn't the comparison of delay and ad->antic_expire make any problem?
The related source code is quoted blow:

Quoted 4 lines
	if (ad->antic_status == ANTIC_OFF || !ad->ioc_finished)
		delay = 0;
	else
		delay = ((jiffies - ad->antic_start) * 1000) / HZ;

antic_start is in jiffies, the difference is here multiplied by 1000 and divided by HZ to turn it into msecs. so delay is in msecs.

Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 9 lines · Jens Axboe
Quoted 8 lines · Xiaoning Ding

Hi,

I am reading the source code AS scheduler in 2.6.18(as-ioscheduler.c). In function as_close_req, variable delay is in millisecond, while ad->antic_expire is in jiffies. Doesn't the comparison of delay and ad->antic_expire make any problem?
The related source code is quoted blow:

Quoted 8 lines
Quoted 4 lines
      if (ad->antic_status == ANTIC_OFF || !ad->ioc_finished)
              delay = 0;
      else
              delay = ((jiffies - ad->antic_start) * 1000) / HZ;

antic_start is in jiffies, the difference is here multiplied by 1000 and divided by HZ to turn it into msecs. so delay is in msecs.

I am pretty sure Xiaoning was talking about antic_expire, particularly this comparison:

    else if (delay <= 20 && delay <= ad->antic_expire)

regards,

Benoit

#3 lore raw
Quoted 15 lines · Benoit Boissinot
Quoted 14 lines · Jens Axboe
Quoted 12 lines · Xiaoning Ding

Hi,

I am reading the source code AS scheduler in 2.6.18(as-ioscheduler.c). In function as_close_req, variable delay is in millisecond, while ad->antic_expire is in jiffies. Doesn't the comparison of delay and ad->antic_expire make any problem?
The related source code is quoted blow:

      if (ad->antic_status == ANTIC_OFF || !ad->ioc_finished)
              delay = 0;
      else
              delay = ((jiffies - ad->antic_start) * 1000) / HZ;
Quoted 7 lines
Quoted 3 lines

antic_start is in jiffies, the difference is here multiplied by 1000 and divided by HZ to turn it into msecs. so delay is in msecs.

I am pretty sure Xiaoning was talking about antic_expire, particularly this comparison:

    else if (delay <= 20 && delay <= ad->antic_expire)

Ah, I misread the name. That does look like a bug, antic_expire is in jiffies.

Signature · 1 line
Jens Axboe
#4 lore raw
Quoted 18 lines · Jens Axboe
Quoted 17 lines · Benoit Boissinot
Quoted 16 lines · Jens Axboe
Quoted 8 lines · Xiaoning Ding

Hi,

I am reading the source code AS scheduler in 2.6.18(as-ioscheduler.c). In function as_close_req, variable delay is in millisecond, while ad->antic_expire is in jiffies. Doesn't the comparison of delay and ad->antic_expire make any problem?
The related source code is quoted blow:

Quoted 4 lines
      if (ad->antic_status == ANTIC_OFF || !ad->ioc_finished)
              delay = 0;
      else
              delay = ((jiffies - ad->antic_start) * 1000) / HZ;

antic_start is in jiffies, the difference is here multiplied by 1000 and divided by HZ to turn it into msecs. so delay is in msecs.

Quoted 7 lines
Quoted 4 lines

I am pretty sure Xiaoning was talking about antic_expire, particularly this comparison:

    else if (delay <= 20 && delay <= ad->antic_expire)

Ah, I misread the name. That does look like a bug, antic_expire is in jiffies.

You got it.

Xiaoning