-
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
setfacl on 0.6.5.8 causes hang/load spike #5340
Comments
The only ACL related change in 0.6.5.8 looks like #4922. If possible could you revert to the previous kernel with 0.6.5.8 to try and narrow down where the problem was introduced. |
I did run a quick test of this with a stock upstream stable 4.7.9 kernel and a stock 0.6.5.8 build of SPL and ZFS on a filesystem with 1111 directories and 4.8M files and there were no load problems. @Lalufu You should at least run ps, top or perf to see where the excessive load might be coming from. There's a slim chance that db3f5ed might be coming into play; particularly on a system without a lot of memory. NOTE: My "quick test" only did the "setfacl"s and not the "restorecon" (no SELinux configured). |
There's nothing in dmesg except these: [ 4218.122953] perf: interrupt took too long (2502 > 2500), lowering kernel.perf_event_max_sample_rate to 79000 Now I do remember getting those before as well, so it's not totally new. Some further testing shows that just running the setfacl is not sufficient to trigger this, it seems some other writes/reads are necessary to trigger this as well (cache flushes? No idea). I've tried running a The first load jump is between 08:14:41 and 08:14:54. The script was started at :00 by cron. |
On Wed, Oct 26, 2016 at 11:48:05AM -0700, Tim Chase wrote:
If you can suggest a useful command to run in the background I can The machine in question has 16GB of RAM, with no special settings to |
@Lalufu The %si in top spiked along with the load average. I suppose you could sample /proc/softirqs while this is happening and look for anything abnormal. |
I've captured top and the softirqs during an incident: I've attached a modified version of the softirqs log as well, which contains deltas to the previous iteration: According to this less softirqs happened in the 15 second "window" than normally happen in a one second window. I don't know what to make of this. |
I've been looking at a) I'm getting a warning window from perf top telling me that events are being lost 19.92% [kernel] [k] task_expire I've been trying to figure out how to make perf write a log of events that can be inspected later, but I'm not having much luck so far. All the examples I'm finding for this assume one wants to perf a single command, and not the system in general. |
@Lalufu I think you've got enough information. The problem seems to be a stampede of Posix ACL expirations. I'm not sure whether |
Thanks for the update. Is there a way to reduce the number of threads? |
@dweeezil adding a small random factor is a nice easy improvement. If there is contention here it's going to be on the taskq spinlock so it's tempting to fan that out. One tempting way to do this would be to dispatch the delayed frees to the spa's ZIO_TYPE_FREE/ISSUE issue taskq which is ZTI_P(12, 8). |
@behlendorf I'll work up a patch which does just that or something similar. It sure seems we don't need yet another taskq. |
I think we should do batch free to reduce both the timers and tasks firing contention. |
@tuxoko That's probably a better idea. |
Somehow batching them locklessly would be ideal. |
I hacked up a quick patch doing batch free. I haven't test it though. Making it lockless should be possible, but I'll need to think about it. |
Unless we can do this without a lock it's not clear that this will be a significant win. Batching things will reduce the number of tasks dispatched, but we may just have shifted the contention point from the taskq spinlock to the one protecting the batch list. |
Here's a patch to make it lockless. I haven't tested it either. |
@behlendorf |
That makes sense, when you're happy with the lockless implementation can you open a new PR. |
@Lalufu |
On Thu, Nov 03, 2016 at 04:00:02PM -0700, tuxoko wrote:
So far this seems to fix the issue, I can no longer reproduce the load |
On Thu, Nov 03, 2016 at 04:00:02PM -0700, tuxoko wrote:
Still hasn't blown up, so I'll declare this good for my purpose. |
I have a script that runs every minute, running this code (paths/usernames changed to protect the innocent):
This finds around 4800 directories and 63000 files, /tank/a is on a ZFS pool.
On 0.6.5.7/4.6.5-200.fc23.x86_64 this caused no issues.
On 0.6.5.8/4.7.9-100.fc23.x86_64 running this script causes the machine to become unresponsive for a few seconds, and the load to spike to around 20 or 30, from a base load of <1.
File system properties:
Pool properties:
The text was updated successfully, but these errors were encountered: