-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discard operations on empty zvols are "slow" #7951
Comments
Seems possible this is blocked by some other operation using the zvol_taskq. I wonder if the queue is full at the time? |
@trisk This is the only zvol on this system and nothing else is touching it. The IO queue is definitely full though:
The zvol threads are also taking up all CPU time. |
perhaps the default value of zvol_max_discard_blocks is too high? |
@richardelling The issue is two fold. One is that there is no way for the code to respond to a signal from userspace and exit early. The other is that the code doesn't check to see if the zvol is already empty and turn the discard into a no-op. |
@richardelling Actually, I see what you are saying. It is likely the reverse. |
Two things:
|
In the scenario that I described where a discard is done on the entirety of an empty zvol that is 1EB, assuming the default volblocksie, zvol_request will be called approximately 7.6 billion times. That is the cause of the slow down. The DMU is great at making sure that we don’t actually write anything, taking less than 2 microseconds per operation on average, but we still run through the motions of trying to free data billions of times in a non-interruptible context. I do not believe that any amount of tweaking that does not involve getting the kernel to pass the entire discard to zvol_request will make this quick. In that respect, I think that this is different than #6728. Here the zvol is empty, which is a special case. In the other issue, the state of the zvol is unclear. It could include zvols that have data. Formatting a zvol right after making it is a fairly common operation and apparently, the discard as part of the format is a common operation too, so we probably should change this. The fix for that won’t necessarily help a zvol that has data. |
This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions. |
I was trying to produce a counter example for #7937, but I ended up discovering a "deficiency" in our zvol code. I ran two commands:
The first created a 1EB sparse zvol. The second was to make a XFS filesystem on it. Unfortunately,
mkfs.xfs
will do a discard before its format operation by default. This blocked on a discard operation:iostat
claims that we are writing to the zvol at 82354484213.86 kB/sec, which is ~82TB/sec. On a 1EB zvol, this will take 3 to 4 hours to complete.mkfs.xfs
also cannot be killed until the discard operation has completed.Anyway, there are a few things wrong here:
The text was updated successfully, but these errors were encountered: