Re: raid1 bitmap code [Was: Re: Questions answered by Neil Brown]

2 messages, 2 authors, 2003-02-27 · open the first message on its own page

Re: raid1 bitmap code [Was: Re: Questions answered by Neil Brown]

From: Peter T. Breuer <hidden>
Date: 2003-02-27 08:48:48

"Paul Clements wrote:"
"Peter T. Breuer" wrote:
quoted
Curiously enough, I'm slightly more nonplussed by the problem of
kfreeing the bitmap pages when their dirty count drops to zero.
quoted
What should I do? Maintain a how-many-times-we-have-wanted-to-free-this
page count and only free it on the 10th attempt?
hmm...perhaps an LRU approach? you could store a timestamp (jiffies?),
so that you never deallocate a page unless it hasn't been used in X
amount of time...might be too heavyweight for what you're trying to do
This is not silly, but is too heavyweight to do each time a bit is set.

The best thing to do is probably either or both of

   a) put the notionally freed pages on a free list and allocate from
      that list first when we want a new page

   b) do a periodic sweep for clean pages and free them. 

Peter

Re: raid1 bitmap code [Was: Re: Questions answered by Neil Brown]

From: Paul Clements <hidden>
Date: 2003-02-27 15:47:29

"Peter T. Breuer" wrote:
"Paul Clements wrote:"
quoted
"Peter T. Breuer" wrote:
quoted
Curiously enough, I'm slightly more nonplussed by the problem of
kfreeing the bitmap pages when their dirty count drops to zero.
quoted
quoted
What should I do? Maintain a how-many-times-we-have-wanted-to-free-this
page count and only free it on the 10th attempt?
hmm...perhaps an LRU approach? you could store a timestamp (jiffies?),
so that you never deallocate a page unless it hasn't been used in X
amount of time...might be too heavyweight for what you're trying to do
This is not silly, but is too heavyweight to do each time a bit is set.
Yeah, I was thinking of things like an ext3 journal, where you really do
not want to _ever_ free the pages. With a simple counter, I don't think
there's any way to get that type of behavior.

Of course, if you keep a pool of pre-allocated pages, the penalty for
deallocation/reallocation becomes a lot lower.

--
Paul
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help