kern/183077: don't have the compiler inline txg_quiesce so that zilstat works

Ruben van Staveren ruben at verweg.com
Fri Oct 18 08:00:00 UTC 2013


>Number:         183077
>Category:       kern
>Synopsis:       don't have the compiler inline txg_quiesce so that zilstat works
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 18 08:00:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Ruben van Staveren
>Release:        FreeBSD 9.2-STABLE r256452M
>Organization:
>Environment:
FreeBSD helium.niet.verweg.com 9.2-STABLE FreeBSD 9.2-STABLE #1 r256452M: Thu Oct 17 14:01:31 CEST 2013     root at helium.niet.verweg.com:/usr/obj/usr/svn/9-stable/src/sys/GENERIC  amd64

>Description:
On unpatched systems, txg_quiesce gets inlined and is hidden from dtrace. The zilstat script (http://www.richardelling.com/Home/scripts-and-programs-1/zilstat) will report that no probes could be found for fbt::txg_quiesce:entry

After patching zilstat will report lines like these:


   N-Bytes  N-Bytes/s N-Max-Rate    B-Bytes  B-Bytes/s B-Max-Rate    ops  <=4kB 4-32kB >=32kB
         0          0          0          0          0          0      0      0      0      0
       504        504        504     131072     131072     131072      1      0      0      1
         0          0          0          0          0          0      0      0      0      0
         0          0          0          0          0          0      0      0      0      0
         0          0          0          0          0          0      0      0      0      0
         0          0          0          0          0          0      0      0      0      0

>How-To-Repeat:
run zilstat on an unpatched system, it will report the missing probe for fbt::txg_quiesce:entry and exits
>Fix:
In sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c, prefix the txg_quiesce function with 

__attribute__ ((noinline))


Patch attached with submission follows:

Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	(revision 256452)
+++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	(working copy)
@@ -354,7 +354,7 @@
  * On return, the transaction group has reached a stable state in which it can
  * then be passed off to the syncing context.
  */
-static void
+static __attribute__ ((noinline)) void
 txg_quiesce(dsl_pool_t *dp, uint64_t txg)
 {
 	tx_state_t *tx = &dp->dp_tx;


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list