linux-bcache.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* writeback mode behaviour on proper shut down
@ 2016-04-26  9:26 ching lu
  2016-04-26 19:57 ` Eric Wheeler
  0 siblings, 1 reply; 6+ messages in thread
From: ching lu @ 2016-04-26  9:26 UTC (permalink / raw)
  To: linux-bcache

Hi all,

if i have 1 SSD caching 1 HDD using bcache, the cache mode is writeback

if the PC shutdown/unmount normally, will all dirty data in the cache
be flushed to backing device before poweroff?

i am afraid that SSD lose data if left without power for a long time.
e.g. hoilday.

Thanks in advance,
C

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

* Re: writeback mode behaviour on proper shut down
  2016-04-26  9:26 writeback mode behaviour on proper shut down ching lu
@ 2016-04-26 19:57 ` Eric Wheeler
  2016-04-27  1:45   ` ching lu
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Wheeler @ 2016-04-26 19:57 UTC (permalink / raw)
  To: ching lu; +Cc: linux-bcache

On Tue, 26 Apr 2016, ching lu wrote:

> Hi all,
> 
> if i have 1 SSD caching 1 HDD using bcache, the cache mode is writeback
> 
> if the PC shutdown/unmount normally, will all dirty data in the cache
> be flushed to backing device before poweroff?

No, it will remain in the cache.  

> i am afraid that SSD lose data if left without power for a long time.
> e.g. hoilday.

Wouldn't your data be retained if you used the SSD alone?  SSDs should be 
stable in a powered off state unless it is a bad device.  

There exist RAM-based disks that may be volatile, but that is unlikely to 
be your situation.

--
Eric Wheeler

> 
> Thanks in advance,
> C
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: writeback mode behaviour on proper shut down
  2016-04-26 19:57 ` Eric Wheeler
@ 2016-04-27  1:45   ` ching lu
  2016-04-27  2:10     ` Eric Wheeler
  0 siblings, 1 reply; 6+ messages in thread
From: ching lu @ 2016-04-27  1:45 UTC (permalink / raw)
  To: Eric Wheeler; +Cc: linux-bcache

is there any command for forcing flushing cache or invalidate cache?

On Wed, Apr 27, 2016 at 3:57 AM, Eric Wheeler <bcache@lists.ewheeler.net> wrote:
> On Tue, 26 Apr 2016, ching lu wrote:
>
>> Hi all,
>>
>> if i have 1 SSD caching 1 HDD using bcache, the cache mode is writeback
>>
>> if the PC shutdown/unmount normally, will all dirty data in the cache
>> be flushed to backing device before poweroff?
>
> No, it will remain in the cache.
>
>> i am afraid that SSD lose data if left without power for a long time.
>> e.g. hoilday.
>
> Wouldn't your data be retained if you used the SSD alone?  SSDs should be
> stable in a powered off state unless it is a bad device.
>
> There exist RAM-based disks that may be volatile, but that is unlikely to
> be your situation.
>
> --
> Eric Wheeler
>
>>
>> Thanks in advance,
>> C
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>

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

* Re: writeback mode behaviour on proper shut down
  2016-04-27  1:45   ` ching lu
@ 2016-04-27  2:10     ` Eric Wheeler
  2016-04-28  3:55       ` ching lu
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Wheeler @ 2016-04-27  2:10 UTC (permalink / raw)
  To: ching lu; +Cc: linux-bcache


On Wed, 27 Apr 2016, ching lu wrote:

> is there any command for forcing flushing cache or invalidate cache?

I think you would benefit from reading this:

https://www.kernel.org/doc/Documentation/bcache.txt


--
Eric Wheeler

	

> 
> On Wed, Apr 27, 2016 at 3:57 AM, Eric Wheeler <bcache@lists.ewheeler.net> wrote:
> > On Tue, 26 Apr 2016, ching lu wrote:
> >
> >> Hi all,
> >>
> >> if i have 1 SSD caching 1 HDD using bcache, the cache mode is writeback
> >>
> >> if the PC shutdown/unmount normally, will all dirty data in the cache
> >> be flushed to backing device before poweroff?
> >
> > No, it will remain in the cache.
> >
> >> i am afraid that SSD lose data if left without power for a long time.
> >> e.g. hoilday.
> >
> > Wouldn't your data be retained if you used the SSD alone?  SSDs should be
> > stable in a powered off state unless it is a bad device.
> >
> > There exist RAM-based disks that may be volatile, but that is unlikely to
> > be your situation.
> >
> > --
> > Eric Wheeler
> >
> >>
> >> Thanks in advance,
> >> C
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
> >> the body of a message to majordomo@vger.kernel.org
> >> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >>
> 

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

* Re: writeback mode behaviour on proper shut down
  2016-04-27  2:10     ` Eric Wheeler
@ 2016-04-28  3:55       ` ching lu
  2016-05-11  1:14         ` Eric Wheeler
  0 siblings, 1 reply; 6+ messages in thread
From: ching lu @ 2016-04-28  3:55 UTC (permalink / raw)
  To: Eric Wheeler; +Cc: linux-bcache

is there any sysfs attribute storing the list of all attached cache
devices? i would like to write a script to force flushing cache by
stopping them all

"echo 1 > /sys/fs/bcache/<cset-uuid>/stop"

Furthermore, do the statement return only after the cache device is stopped
or i need to poll until "/sys/fs/bcache/<cset-uuid>/bdev*/state"="clean"

On Wed, Apr 27, 2016 at 10:10 AM, Eric Wheeler
<bcache@lists.ewheeler.net> wrote:
>
> On Wed, 27 Apr 2016, ching lu wrote:
>
>> is there any command for forcing flushing cache or invalidate cache?
>
> I think you would benefit from reading this:
>
> https://www.kernel.org/doc/Documentation/bcache.txt
>
>
> --
> Eric Wheeler
>
>
>
>>
>> On Wed, Apr 27, 2016 at 3:57 AM, Eric Wheeler <bcache@lists.ewheeler.net> wrote:
>> > On Tue, 26 Apr 2016, ching lu wrote:
>> >
>> >> Hi all,
>> >>
>> >> if i have 1 SSD caching 1 HDD using bcache, the cache mode is writeback
>> >>
>> >> if the PC shutdown/unmount normally, will all dirty data in the cache
>> >> be flushed to backing device before poweroff?
>> >
>> > No, it will remain in the cache.
>> >
>> >> i am afraid that SSD lose data if left without power for a long time.
>> >> e.g. hoilday.
>> >
>> > Wouldn't your data be retained if you used the SSD alone?  SSDs should be
>> > stable in a powered off state unless it is a bad device.
>> >
>> > There exist RAM-based disks that may be volatile, but that is unlikely to
>> > be your situation.
>> >
>> > --
>> > Eric Wheeler
>> >
>> >>
>> >> Thanks in advance,
>> >> C
>> >> --
>> >> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
>> >> the body of a message to majordomo@vger.kernel.org
>> >> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> >>
>>

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

* Re: writeback mode behaviour on proper shut down
  2016-04-28  3:55       ` ching lu
@ 2016-05-11  1:14         ` Eric Wheeler
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Wheeler @ 2016-05-11  1:14 UTC (permalink / raw)
  To: ching lu; +Cc: linux-bcache

On Thu, 28 Apr 2016, ching lu wrote:

> is there any sysfs attribute storing the list of all attached cache
> devices? i would like to write a script to force flushing cache by
> stopping them all

I don't think so, but you could scan sysfs easy enough.

--
Eric Wheeler



> 
> "echo 1 > /sys/fs/bcache/<cset-uuid>/stop"
> 
> Furthermore, do the statement return only after the cache device is stopped
> or i need to poll until "/sys/fs/bcache/<cset-uuid>/bdev*/state"="clean"
> 
> On Wed, Apr 27, 2016 at 10:10 AM, Eric Wheeler
> <bcache@lists.ewheeler.net> wrote:
> >
> > On Wed, 27 Apr 2016, ching lu wrote:
> >
> >> is there any command for forcing flushing cache or invalidate cache?
> >
> > I think you would benefit from reading this:
> >
> > https://www.kernel.org/doc/Documentation/bcache.txt
> >
> >
> > --
> > Eric Wheeler
> >
> >
> >
> >>
> >> On Wed, Apr 27, 2016 at 3:57 AM, Eric Wheeler <bcache@lists.ewheeler.net> wrote:
> >> > On Tue, 26 Apr 2016, ching lu wrote:
> >> >
> >> >> Hi all,
> >> >>
> >> >> if i have 1 SSD caching 1 HDD using bcache, the cache mode is writeback
> >> >>
> >> >> if the PC shutdown/unmount normally, will all dirty data in the cache
> >> >> be flushed to backing device before poweroff?
> >> >
> >> > No, it will remain in the cache.
> >> >
> >> >> i am afraid that SSD lose data if left without power for a long time.
> >> >> e.g. hoilday.
> >> >
> >> > Wouldn't your data be retained if you used the SSD alone?  SSDs should be
> >> > stable in a powered off state unless it is a bad device.
> >> >
> >> > There exist RAM-based disks that may be volatile, but that is unlikely to
> >> > be your situation.
> >> >
> >> > --
> >> > Eric Wheeler
> >> >
> >> >>
> >> >> Thanks in advance,
> >> >> C
> >> >> --
> >> >> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
> >> >> the body of a message to majordomo@vger.kernel.org
> >> >> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >> >>
> >>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

end of thread, other threads:[~2016-05-11  1:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-26  9:26 writeback mode behaviour on proper shut down ching lu
2016-04-26 19:57 ` Eric Wheeler
2016-04-27  1:45   ` ching lu
2016-04-27  2:10     ` Eric Wheeler
2016-04-28  3:55       ` ching lu
2016-05-11  1:14         ` Eric Wheeler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).