Discussion:
How to invalidate all cache
Zheng Liu
2014-10-13 03:03:51 UTC
Permalink
Hi all,

I am trying to do some benchmarks against bcache, espeically in cache
miss scenario, but I don't find a user interface to invalidate all
cache. Anyone can tell me how to do that.

Thanks in advance,
- Zheng
Slava Pestov
2014-10-13 03:16:31 UTC
Permalink
You can try to detach the backing device, which will cause all dirty
data to be written back, and attach it again.
Post by Zheng Liu
Hi all,
I am trying to do some benchmarks against bcache, espeically in cache
miss scenario, but I don't find a user interface to invalidate all
cache. Anyone can tell me how to do that.
Thanks in advance,
- Zheng
--
To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
More majordomo info at http://vger.kernel.org/majordomo-info.html
Zheng Liu
2014-10-13 03:45:37 UTC
Permalink
Hi Slava,

Thanks for your reply.
Post by Slava Pestov
You can try to detach the backing device, which will cause all dirty
data to be written back, and attach it again.
Yes, detaching a backing device will make all dirty data to be written
back to the backing device. But if I understand correctly it couldn't
invalidate all data in cache device. That means that after attaching
backing device the data in cache device is still valid. All I want to
do is to remove all data in cache device. Any idea?

Regards,
- Zheng
Post by Slava Pestov
Post by Zheng Liu
Hi all,
I am trying to do some benchmarks against bcache, espeically in cache
miss scenario, but I don't find a user interface to invalidate all
cache. Anyone can tell me how to do that.
Thanks in advance,
- Zheng
--
To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
More majordomo info at http://vger.kernel.org/majordomo-info.html
Pavel Goran
2014-10-13 03:43:14 UTC
Permalink
Hello Zheng,
Post by Zheng Liu
Yes, detaching a backing device will make all dirty data to be written
back to the backing device. But if I understand correctly it couldn't
invalidate all data in cache device. That means that after attaching
backing device the data in cache device is still valid.
It would be a bug if cached data were considered valid after detaching and
re-attaching. Because while a cache device an a backing device were separated,
data could be written to a backing device, this would possibly make data in a
"disconnected" cache obsolete.

Pavel Goran
Zheng Liu
2014-10-13 13:30:58 UTC
Permalink
Post by Pavel Goran
Hello Zheng,
Post by Zheng Liu
Yes, detaching a backing device will make all dirty data to be written
back to the backing device. But if I understand correctly it couldn't
invalidate all data in cache device. That means that after attaching
backing device the data in cache device is still valid.
It would be a bug if cached data were considered valid after detaching and
re-attaching. Because while a cache device an a backing device were separated,
data could be written to a backing device, this would possibly make data in a
"disconnected" cache obsolete.
Ah, Thanks for pointing it out. I got it.

BTW, there is a bug when I tried to detach/attach a backing device.
A patch has sent out to the mailing list. That would be great if some
one can review it.

Regards,
- Zheng
Eric Wheeler
2014-10-13 18:13:58 UTC
Permalink
unsubscribe linux-bcache

Loading...