]> git.baikalelectronics.ru Git - kernel.git/commit
[XFS] Move memory allocations for log tracing out of the critical path
authorLachlan McIlroy <lachlan@sgi.com>
Wed, 17 Sep 2008 06:45:37 +0000 (16:45 +1000)
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>
Wed, 17 Sep 2008 06:45:37 +0000 (16:45 +1000)
commit34a80a579b22afcc9f2e38a5394c7e1812a914bc
treea98afc0d4bcd98f0f4e648a5e1dddcc090c3f791
parent80cd4880f2a663545605c6f7abc61c95f052972b
[XFS] Move memory allocations for log tracing out of the critical path

Memory allocations for log->l_grant_trace and iclog->ic_trace are done on
demand when the first event is logged. In xlog_state_get_iclog_space() we
call xlog_trace_iclog() under a spinlock and allocating memory here can
cause us to sleep with a spinlock held and deadlock the system.

For the log grant tracing we use KM_NOSLEEP but that means we can lose
trace entries. Since there is no locking to serialize the log grant
tracing we could race and have multiple allocations and leak memory.

So move the allocations to where we initialize the log/iclog structures.
Use KM_NOFS to avoid recursing into the filesystem and drop log->l_trace
since it's not even used.

SGI-PV: 983738

SGI-Modid: xfs-linux-melb:xfs-kern:31896a

Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
fs/xfs/xfs_log.c
fs/xfs/xfs_log_priv.h