Bug #4736

“zpool history” is consuming 100% CPU

Added by Marco . over 1 year ago. Updated over 1 year ago.

Status:ResolvedStart date:04/06/2014
Priority:Nice to haveDue date:
Assignee:Xin Li% Done:

0%

Category:Backend
Target version:9.2.1.4-RELEASE
Seen in:9.2.1.3-RELEASE Hardware Configuration:


Description

The zpool history command does not finish and consumes 100% CPU on my system. This call is used by the scrubbing code which parses its output.

[root@freenas] /mnt/tank# ps aux | grep zpool
root        2279 100.0  0.0  1704772  2156 ??  R    1:15AM  817:53.33 zpool history tank
root        2280  0.0  0.0    16272  1424 ??  I    1:15AM    0:00.00 egrep ^[0-9\\.\\:\\-]{19} zpool scrub tank$
root      39364  0.0  0.0    16272  1952  0  S+    3:10PM    0:00.00 grep zpool

I can't reproduce it on every system. On most systems zpool history returns within a few seconds. On this particular pool, however, it does not. See this forum thread:

http://forums.freenas.org/index.php?threads/%E2%80%9Czpool-history%E2%80%9D-is-consuming-100-cpu.19997/

The behaviour I expect is that zpool history returns within a few seconds and does not consume significant CPU.

G2020
32GiB ECC RAM
2 mirrored vdevs

Screenshot from 2014-04-06 15_08_42.png - CPU graph (81.5 KB) Marco ., 04/06/2014 01:48 PM

procstat.gz - procstat output (10.3 KB) Marco ., 04/07/2014 11:41 PM

707

Associated revisions

Revision b447e042
Added by Xin Li over 1 year ago

Work around the case where hisory buffer is larger than HIS_BUF_LEN (128K).

Ticket: #4736

Revision 887098ca
Added by Xin Li over 1 year ago

Take into account when zpool history block grows exceeding 128KB in zpool(8)
and zdb(8) by growing the buffer on demand with a cap of 1GB (specified in
spa_history_create_obj()).

PR: bin/186574
Submitted by: Andrew Childs <lorne cons org nz> (with changes)
MFC after: 2 weeks

(cherry picked from commit 78e547c5404320fbd04ad333c9f9691a30b0e86e)

Ticket: #4736

Revision de042548
Added by Xin Li over 1 year ago

Take into account when zpool history block grows exceeding 128KB in zpool(8)
and zdb(8) by growing the buffer on demand with a cap of 1GB (specified in
spa_history_create_obj()).

PR: bin/186574
Submitted by: Andrew Childs <lorne cons org nz> (with changes)
MFC after: 2 weeks

(cherry picked from commit 78e547c5404320fbd04ad333c9f9691a30b0e86e)

Ticket: #4736
(cherry picked from commit 887098cab7b481404f44107ec9fac6e0a65d4ade)

Revision a72a13f2
Added by Xin Li over 1 year ago

Work around the case where hisory buffer is larger than HIS_BUF_LEN (128K).

Ticket: #4736

Revision d601e16c
Added by Xin Li over 1 year ago

Take into account when zpool history block grows exceeding 128KB in zpool(8)
and zdb(8) by growing the buffer on demand with a cap of 1GB (specified in
spa_history_create_obj()).

PR: bin/186574
Submitted by: Andrew Childs <lorne cons org nz> (with changes)
MFC after: 2 weeks

(cherry picked from commit 78e547c5404320fbd04ad333c9f9691a30b0e86e)

Ticket: #4736

Revision ece4ce02
Added by Xin Li about 1 year ago

Take into account when zpool history block grows exceeding 128KB in zpool(8)
and zdb(8) by growing the buffer on demand with a cap of 1GB (specified in
spa_history_create_obj()).

PR: bin/186574
Submitted by: Andrew Childs <lorne cons org nz> (with changes)
MFC after: 2 weeks

(cherry picked from commit 78e547c5404320fbd04ad333c9f9691a30b0e86e)

Ticket: #4736

History

#1 Updated by Jordan Hubbard over 1 year ago

  • Assignee set to Xin Li
  • Target version set to 79

#2 Updated by Xin Li over 1 year ago

Please provide 'procstat -kk -a' output.

#3 Updated by Xin Li over 1 year ago

  • Status changed from Unscreened to Screened

#4 Updated by Marco . over 1 year ago

Here's the “procstat -kk -a” output.

#5 Updated by Xin Li over 1 year ago

  • Status changed from Screened to Resolved

This should have been resolved in trunk.

#6 Updated by Jordan Hubbard over 1 year ago

  • Target version changed from 79 to 9.2.1.4-RELEASE

Also available in: Atom PDF