Questions about Normal and Urgent writes Topic is solved

FAQ, getting help, user experience about PrimoCache
TomB
Level 5
Level 5
Posts: 40
Joined: Wed Jul 29, 2020 11:15 pm

Questions about Normal and Urgent writes

Post by TomB »

Hello again, Mr. Primo Support! If you are not too busy, I have another question. (Or actually I think I have several questions. This has turned into a very long post. I am sorry. Please just reply at your convenience!)

I am now trying to figure out the behavior of PrimoCache when both L1 and L2 are set for write caching and deferred writes are also enabled. I have been testing and looking at the program and also re-reading the documentation and technical discussions again, but I think I do not completely understand how the different options for write caching work. (As you may know, I have only recently discovered PrimoCache and purchased PrimoCache 3.2.0, but I have now downloaded version 4.0.0 Alpha, so my following questions are for PC version 4.0.0 Alpha.)

Ok, so I see that there are Normal writes and Urgent writes. And I also see that the option for Flush L1 Cache to L2 Cache allows to "move L1 deferred data to L2 instead of flush to target when L1 is full". But I believe that I am confused because I think I don't initially understand what is the default (regular or standard) behavior for Deferred-Write anyway. So I think my best questions may be this:

1) What is the Urgent state? Does it mean Urgent just when L1 is full? Or only when L1 and L2 are both full? Or does Urgent mean something different?

2) What is the Normal state? Does it mean Normal only when both L1 and L2 have more room? Or is it Normal if at least either L1 and L2 have some space left? Or does Normal mean something different?

3) What must happen for Normal state to become Urgent or for Urgent to return to Normal?

4) What is the default behavior for L1 and L2 Deferred Write Caching when condition is Normal ? (Not when Flush L1 Cache to L2 Cache is enabled, but just the default Normal behavior.)

a) Service Write Requests to L1, then just Flush L1 Writes to Target based on L1 Defer Policy?
Or ...
b) Service Write Requests to L1, then Flush L1 Writes to L2 based on L1 Defer Policy, then eventually flush L2 to Target based on L2 Policy?
Or ...
c) Something else?

5) What is the default behavior for L1 and L2 Deferred Write Caching when condition is Urgent ? (Not when Flush L1 Cache to L2 Cache is enabled, but just the default Urgent behavior.)

a) Bypass L1 and L2. Just service new incoming Write Requests Direct to Target, ignoring all currently configured Deferred-Write policies?
Or ...
b) Bypass L1 only. Just service new incoming Write Requests Direct to L2, ignoring currently configured L2 Deferred-Write policies?
Or ...
c) Something else?

6) What is the behavior for L1 and L2 Deferred Write Caching when condition is Normal but when Flush L1 Cache to L2 Cache is enabled?

7) What is the behavior for L1 and L2 Deferred Write Caching when condition is Urgent but when Flush L1 Cache to L2 Cache is enabled?


I know this is a very long and complicated post, so thank you very much for considering my questions. I am hoping that receiving the answers to these questions may help not only me but also others to know how to properly tune our PrimoCache for our individual needs on our individual systems.

Thank you and your whole team again for such a great product and for such great technical support and customer responsiveness. The design of your product brings me the great enjoyment of good craftmanship, and your technical team and also your Forum Community members are a pleasure to work with.

Tom
User avatar
Support
Support Team
Support Team
Posts: 3333
Joined: Sun Dec 21, 2008 2:42 am

Re: Questions about Normal and Urgent write

Post by Support »

I split your post from the old topic and started a new topic because it's unrelated to the old topic.
So all questions are about normal and urgent write. What is an urgent write? When L1 or L2 cache is full of deferred write-data, and now if a new write request comes, PrimoCache cannot simply discard old cached data like it does for read caching. It has to write deferred data to target disks first, then cache blocks containing these data can be used to cache new write-data. This write is called a urgent write.

What is a Normal write? A normal write which writes deferred data to target disks is triggered by latency or mode-specific conditions.

The urgent writes in L1 and L2 cache are independent. That is when L1 cache is full, even L2 has lots of space, urgent write still will happen in L1 cache. In such scenario, if the option "Flush L1 Cache to L2 Cache" is not enabled, L1 Urgent write will write deferred data to the target disks. If the option is enabled, L1 Urgent write will write deferred data to the L2 cache.
Hope this helps.
TomB
Level 5
Level 5
Posts: 40
Joined: Wed Jul 29, 2020 11:15 pm

Re: Questions about Normal and Urgent writes

Post by TomB »

Thank you, Sir. This does help. And thank you for beginning a new topic. You are correct, this topic was indeed unrelated to the previous one.

I have made progress today with your program, and your post also definitely clears some things up for me. With your information and with what I have learned today, I think I now understand the default behaviors.

For instance, in the Normal condition and when L1 and L2 both have Deferred-Write enabled, then L1 cache will flush its writes only to L2 disk.

But in the Urgent condition, then L1 cache will flush its writes only to the target disk, except when the option "Flush L1 Cache to L2 Cache" is enabled.

And L2 cache can never have an Urgent write. If L2 is full and the option "Flush L1 Cache to L2 Cache" is enabled, then L1 write request just has to wait, I think.

Is this correct?

Thank you again. You have simplified my confusion.

Tom
User avatar
Support
Support Team
Support Team
Posts: 3333
Joined: Sun Dec 21, 2008 2:42 am

Re: Questions about Normal and Urgent writes

Post by Support »

No. If you have both L1 and L2 defer-write enabled, below are behaviors in summary.

Normal: L1 -> Disks, L2 -> Disks. Because all deferred write-data in L1 and L2 shall be flushed to target disks according to the specified latency or mode-related flush policy.

Urgent:
  1. L1 full, L2 not full
    1. "Flush L1 Cache to L2 Cache" enabled: L1 -> L2
    2. "Flush L1 Cache to L2 Cache" disabled: L1 -> Disks
  2. L1 not full, L2 full: L2 -> Disks
  3. L1 full, L2 full: L1 -> Disks, L2 -> Disks
TomB
Level 5
Level 5
Posts: 40
Joined: Wed Jul 29, 2020 11:15 pm

Re: Questions about Normal and Urgent writes

Post by TomB »

Thank you very much. This is also most helpful.


So, I think I understand this:
Support wrote: Mon Aug 03, 2020 9:20 am Urgent:
L1 full, L2 not full
"Flush L1 Cache to L2 Cache" enabled: L1 -> L2
"Flush L1 Cache to L2 Cache" disabled: L1 -> Disks
L1 not full, L2 full: L2 -> Disks
L1 full, L2 full: L1 -> Disks, L2 -> Disks


.... But if this next part is true:
Support wrote: Mon Aug 03, 2020 9:20 am Normal: L1 -> Disks, L2 -> Disks. Because all deferred write-data in L1 and L2 shall be flushed to target disks according to the specified latency or mode-related flush policy.
... then how does L2 ever become full? In other words, if L1 --> Disks, and L2 --> Disks, but never L1 --> L2, then L2 is always empty ...

I must be misunderstanding this.


Perhaps I was not clear above, and I should have said this:
TomB wrote: Mon Aug 03, 2020 8:12 am For instance, in the Normal condition and when L1 and L2 both have Deferred-Write enabled, then L1 cache will flush its writes only to L2 SSD.
Then L2 SSD will flush his writes to target disk.
Instead of this:
TomB wrote: Mon Aug 03, 2020 8:12 am For instance, in the Normal condition and when L1 and L2 both have Deferred-Write enabled, then L1 cache will flush its writes only to L2 disk.

Thank you.

Tom
TomB
Level 5
Level 5
Posts: 40
Joined: Wed Jul 29, 2020 11:15 pm

Re: Questions about Normal and Urgent writes

Post by TomB »

In other words, here is question #4 from my original post:
TomB wrote: Sun Aug 02, 2020 6:47 am 4) What is the default behavior for L1 and L2 Deferred Write Caching when condition is Normal ? (Not when Flush L1 Cache to L2 Cache is enabled, but just the default Normal behavior.)

a) Service Write Requests to L1, then just Flush L1 Writes to Target based on L1 Defer Policy?
Or ...
b) Service Write Requests to L1, then Flush L1 Writes to L2 based on L1 Defer Policy, then eventually flush L2 to Target based on L2 Policy?
Or ...
c) Something else?

I guess this answer was b) ...
But I think you are saying that the answer was c) ...

Thanks again. This is a great program and I appreciate your attempts to help me understand.

Tom
TomB
Level 5
Level 5
Posts: 40
Joined: Wed Jul 29, 2020 11:15 pm

Re: Questions about Normal and Urgent writes

Post by TomB »

I believe my question is answered sufficiently.

Thank you very much.

Tom
User avatar
Support
Support Team
Support Team
Posts: 3333
Joined: Sun Dec 21, 2008 2:42 am

Re: Questions about Normal and Urgent writes

Post by Support »

TomB wrote: Mon Aug 03, 2020 10:13 am then how does L2 ever become full? In other words, if L1 --> Disks, and L2 --> Disks, but never L1 --> L2, then L2 is always empty
When L1 becomes full, L1 Urgent write will be triggered. During L1 urgent writes, new write-data will be cached by L2.
And with "Flush L1 Cache to L2 Cache" enabled, L1 cached write-data is transferred to L2.
TomB
Level 5
Level 5
Posts: 40
Joined: Wed Jul 29, 2020 11:15 pm

Re: Questions about Normal and Urgent writes

Post by TomB »

I believe I understand the Urgent behavior.

I think it is the Normal behavior of which I am uncertain. So I am asking about the Normal behavior, which is the case when L1 is not full.

So my main question is this:

Does L1 ever write to L2 when condition is Normal?

Thanks again for all your help and patience with me.

Tom
User avatar
Support
Support Team
Support Team
Posts: 3333
Joined: Sun Dec 21, 2008 2:42 am

Re: Questions about Normal and Urgent writes

Post by Support »

TomB wrote: Mon Aug 03, 2020 10:33 am Does L1 ever write to L2 when condition is Normal?
No.
Post Reply