Bug #184

zfs_putpage() optimization

Added by Bryan Leaman over 4 years ago. Updated about 4 years ago.

Status:Resolved Start date:2010-09-11
Priority:Normal Due date:
Assignee:Garrett D'Amore % Done:


Target version:-
Difficulty:Medium Tags:needs-triage


This has been logged as CR 6979725 but not yet fixed by Oracle.

I experienced the issue during a filebench run on Nexenta in which the file "re-use" operation (msync) on a 20GB file caused all I/O to hang for more than 30 seconds, even other zpools. Stack trace looked like this:

[ ffffff0010429990 _resume_from_idle+0xf1() ]
ffffff0010429b10 page_lookup_create+0xd6(ffffff02d2813c40, 37588b000, 1, 0, 0, 0)
ffffff0010429b40 page_lookup+0x26(ffffff02d2813c40, 375889000, 1)
ffffff0010429c00 zfs_putpage+0x1af(ffffff02d2813c40, 3758a5000, 1000, 10000, ffffff02cf328f20, 0)
ffffff0010429c70 fop_putpage+0x74(ffffff02d2813c40, 3758b0000, 1000, 10000, ffffff02cf328f20, 0)
ffffff0010429d50 segvn_sync+0x459(ffffff02ecb4e7f0, fffffd7f63c00000, 40000000, 0, 6)
ffffff0010429e40 as_ctl+0x200(ffffff02d15efda0, fffffd7f63c00000, 40000000, 1, 0, 6, 0, 0)
ffffff0010429f00 memcntl+0x764(fffffd7f63c00000, 40000000, 1, 2, 0, 0)
ffffff0010429f10 sys_syscall+0x17a()

I created the attached patch and re-ran the filebench tests, and the long I/O stalls were reduced to only 3 or 4 seconds. I'm creating this issue report since the problem most likely exists in Illumos as well. Looking for comments/feedback on whether this fix seems correct and appropriate. Thanks!

zfs_putpage-optimization-6979725.patch (593 Bytes) Bryan Leaman, 09/11/2010 08:16 am


Updated by Garrett D'Amore about 4 years ago

  • Category set to kernel
  • Status changed from New to In Progress
  • Assignee set to Garrett D'Amore
  • % Done changed from 0 to 90

The patch looks good, and the ZFS working group members have blessed the change, with one suggestion (the insertion of an ASSERT at the right point.)

Updated by Garrett D'Amore about 4 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 90 to 100

garrett@thinkpad{31}> hg head
changeset: 13283:4f8f71d21b9f
tag: tip
user: Garrett D'Amore <>
date: Mon Feb 07 14:16:27 2011 -0800
184 zfs_putpage() optimization
Reviewed by:
Reviewed by:
Approved by:

Also available in: Atom PDF