From dd72f3d647bae11d9fd5c3aa45ae6972de8cb319 Mon Sep 17 00:00:00 2001 From: Ned Bass Date: Thu, 29 Jul 2010 13:37:44 -0700 Subject: [PATCH] Inline zio_notify_parent() to reduce stack use Deep recursive call chains are contributing to segfaults in ztest due to heavy stack use. Inlining zio_notify_parent() helps reduce the stack depth of the zio_notify_parent() -> zio_execute() -> zio_done() recursive cycle. I am no longer seeing ztest segfaults in this code path with this change combined with the zio_done() stack reduction in the previous commit. Signed-off-by: Brian Behlendorf --- module/zfs/zio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/zfs/zio.c b/module/zfs/zio.c index 88d80af4e9..75807bd30e 100644 --- a/module/zfs/zio.c +++ b/module/zfs/zio.c @@ -435,7 +435,8 @@ zio_wait_for_children(zio_t *zio, enum zio_child child, enum zio_wait_type wait) return (waiting); } -static void +__attribute__((always_inline)) +static inline void zio_notify_parent(zio_t *pio, zio_t *zio, enum zio_wait_type wait) { uint64_t *countp = &pio->io_children[zio->io_child_type][wait];