All of lore.kernel.org
 help / color / mirror / Atom feed
* calc. of currspeed in md.c code in 2.4.20
@ 2003-05-14  8:33 Peter T. Breuer
  2003-05-14 11:47 ` Neil Brown
  2003-05-14 13:48 ` Paul Clements
  0 siblings, 2 replies; 7+ messages in thread
From: Peter T. Breuer @ 2003-05-14  8:33 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid


Can you shed some light on this for me?

currspeed =
 (j-mddev->resync_mark_cnt)/2/((jiffies-mddev->resync_mark)/HZ +1) +1;

jiffies is divided by HZ here, which results in a quantity of dimension
time-squared!

I could understand it (better) if jiffies were multiplied by HZ.

Peter

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: calc. of currspeed in md.c code in 2.4.20
  2003-05-14  8:33 calc. of currspeed in md.c code in 2.4.20 Peter T. Breuer
@ 2003-05-14 11:47 ` Neil Brown
  2003-05-14 13:48 ` Paul Clements
  1 sibling, 0 replies; 7+ messages in thread
From: Neil Brown @ 2003-05-14 11:47 UTC (permalink / raw)
  To: ptb; +Cc: linux-raid

On Wednesday May 14, ptb@it.uc3m.es wrote:
> 
> Can you shed some light on this for me?
> 
> currspeed =
>  (j-mddev->resync_mark_cnt)/2/((jiffies-mddev->resync_mark)/HZ +1) +1;
> 
> jiffies is divided by HZ here, which results in a quantity of dimension
> time-squared!
> 
> I could understand it (better) if jiffies were multiplied by HZ.
> 
> Peter

HZ == jiffies/second

so jiffies / HZ == jiffies / (jiffies/seconds) == seconds.

NeilBrown

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: calc. of currspeed in md.c code in 2.4.20
  2003-05-14  8:33 calc. of currspeed in md.c code in 2.4.20 Peter T. Breuer
  2003-05-14 11:47 ` Neil Brown
@ 2003-05-14 13:48 ` Paul Clements
  2003-05-14 13:54   ` Peter T. Breuer
  1 sibling, 1 reply; 7+ messages in thread
From: Paul Clements @ 2003-05-14 13:48 UTC (permalink / raw)
  To: ptb; +Cc: neilb, linux-raid

"Peter T. Breuer" wrote:
> 
> Can you shed some light on this for me?
> 
> currspeed =
>  (j-mddev->resync_mark_cnt)/2/((jiffies-mddev->resync_mark)/HZ +1) +1;
> 
> jiffies is divided by HZ here, which results in a quantity of dimension
> time-squared!
> 
> I could understand it (better) if jiffies were multiplied by HZ.

Just curious, but are you looking at this because the speed calculations
break when using a bitmap to resync? I realized this problem a few days
ago, but I'm not sure how to solve it, yet...

I think we might need two counters, one for the actual resync progress
(to display the progress bar, and show actual resync speed) and the
other to throttle I/O if actual I/O becomes too fast...

--
Paul

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: calc. of currspeed in md.c code in 2.4.20
  2003-05-14 13:48 ` Paul Clements
@ 2003-05-14 13:54   ` Peter T. Breuer
  2003-05-14 14:18     ` Peter T. Breuer
  0 siblings, 1 reply; 7+ messages in thread
From: Peter T. Breuer @ 2003-05-14 13:54 UTC (permalink / raw)
  To: Paul Clements; +Cc: ptb, neilb, linux-raid

"A month of sundays ago Paul Clements wrote:"
> "Peter T. Breuer" wrote:
> > 
> > Can you shed some light on this for me?
> > 
> > currspeed =
> >  (j-mddev->resync_mark_cnt)/2/((jiffies-mddev->resync_mark)/HZ +1) +1;
> > 
> > jiffies is divided by HZ here, which results in a quantity of dimension
> > time-squared!
> > 
> > I could understand it (better) if jiffies were multiplied by HZ.
> 
> Just curious, but are you looking at this because the speed calculations
> break when using a bitmap to resync? I realized this problem a few days

Exactly so.

> ago, but I'm not sure how to solve it, yet...

Pushing speed_min up is a workaround.

> I think we might need two counters, one for the actual resync progress
> (to display the progress bar, and show actual resync speed) and the
> other to throttle I/O if actual I/O becomes too fast...

Possibly.  There are a large number of possible solutions, but until
I can understand what the speed calculation is supposed to be doing, I
find myself unable to pick out a way forward.


Peter

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: calc. of currspeed in md.c code in 2.4.20
  2003-05-14 13:54   ` Peter T. Breuer
@ 2003-05-14 14:18     ` Peter T. Breuer
  2003-05-14 14:41       ` Paul Clements
  0 siblings, 1 reply; 7+ messages in thread
From: Peter T. Breuer @ 2003-05-14 14:18 UTC (permalink / raw)
  To: ptb; +Cc: Paul Clements, neilb, linux-raid

"Peter T. Breuer wrote:"
> > ago, but I'm not sure how to solve it, yet...
> 
> Pushing speed_min up is a workaround.

Correct me if this seems silly, but we could push speed_min up to equal
speed_max (or close) in the intervals in which the resync is skipping
sectors rather than syncing them. It does know.

Then nobody would have to change the (to me inscrutable) speed
calculation and throttling loop.

OTOH it would be nicer to have limits per device.

> > I think we might need two counters, one for the actual resync progress
> > (to display the progress bar, and show actual resync speed) and the
> > other to throttle I/O if actual I/O becomes too fast...


Peter

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: calc. of currspeed in md.c code in 2.4.20
  2003-05-14 14:18     ` Peter T. Breuer
@ 2003-05-14 14:41       ` Paul Clements
  2003-05-14 14:53         ` Peter T. Breuer
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Clements @ 2003-05-14 14:41 UTC (permalink / raw)
  To: ptb; +Cc: neilb, linux-raid

"Peter T. Breuer" wrote:
 
> Correct me if this seems silly, but we could push speed_min up to equal
> speed_max (or close) in the intervals in which the resync is skipping
> sectors rather than syncing them. It does know.

But as soon as it hits the disk again, it's going to go to sleep,
because the resync speed up to that point (when there was no real I/O)
will be so high that it'll be way over the limits.

--
Paul

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: calc. of currspeed in md.c code in 2.4.20
  2003-05-14 14:41       ` Paul Clements
@ 2003-05-14 14:53         ` Peter T. Breuer
  0 siblings, 0 replies; 7+ messages in thread
From: Peter T. Breuer @ 2003-05-14 14:53 UTC (permalink / raw)
  To: Paul Clements; +Cc: ptb, neilb, linux-raid

"A month of sundays ago Paul Clements wrote:"
> "Peter T. Breuer" wrote:
>  
> > Correct me if this seems silly, but we could push speed_min up to equal
> > speed_max (or close) in the intervals in which the resync is skipping
> > sectors rather than syncing them. It does know.
> 
> But as soon as it hits the disk again, it's going to go to sleep,
> because the resync speed up to that point (when there was no real I/O)
> will be so high that it'll be way over the limits.

It'll be over the (newly set back to normal) minimum, but not over the
maximum. I don't have the code in sight at the moment ... doesn't it
use the max as a highwater mark, then?

Anyway, one could take the min back down to normal slowly.  Halving the
difference every group of sectors resynced might be OK.

Peter

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-05-14 14:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-14  8:33 calc. of currspeed in md.c code in 2.4.20 Peter T. Breuer
2003-05-14 11:47 ` Neil Brown
2003-05-14 13:48 ` Paul Clements
2003-05-14 13:54   ` Peter T. Breuer
2003-05-14 14:18     ` Peter T. Breuer
2003-05-14 14:41       ` Paul Clements
2003-05-14 14:53         ` Peter T. Breuer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.