Thread (2 messages) 2 messages, 2 authors, 2013-07-17

Re: reverse link from bucket to keys

From: sheng qiu <hidden>
Date: 2013-07-17 22:28:40

Hi Kent,

Thanks for you previous reply. I know bcache does not care write hit,
but is there a easy way to check write hit for write request?
If i reuse the search_recurse() as what you do for read request, will
it has any impact?

Thanks,
Sheng

On Tue, Jul 16, 2013 at 4:59 PM, Kent Overstreet [off-list ref] wrote:
On Tue, Jul 16, 2013 at 11:14:29AM -0400, sheng qiu wrote:
quoted
Hi Kent,

sorry to bother you again. i got another question. it's about the
bucket->pin. Can you explain what's the usage for this data member?
i see only bucket with pin value "0" can be invalidated. And only "0"
valued pin bucket's prio will be decreased within the
bch_rescale_priorities(). But every time when you write data to
bucket, you increase that bucket's pin, and i did not see when it will
be decreased. This makes me a little confused. Or do i miss anything
where you might reset it?
It's to keep buckets from being garbage collected after they're
allocated but before we've added a pointer to them to the btree.

I've actually been meaning to get rid of it, and just keep a refcount on
the open buckets (the ones pick_data_bucket() uses) and have garbage
collection mark those buckets too.

Originally I also used it for preventing buckets from being invalidated
while we were reading from them (on cache hit), but I got rid of that
ages ago for performance reasons - now it just checks after the read
finishes if it was invalidated, and if so rereads from the backing
device.


-- 
Sheng Qiu
Texas A & M University
Room 332B Wisenbaker
email: herbert1984106-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
College Station, TX 77843-3259
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help