MFV/ZoL: Fix stack noinline
commit 60948de1ef976aabaa3630707bcc8b5867508507 Author: Brian Behlendorf <behlendorf1@llnl.gov> Date: Thu Aug 26 10:58:36 2010 -0700 Fix stack noinline Certain function must never be automatically inlined by gcc because they are stack heavy or called recursively. This patch flags all such functions I've found as 'noinline' to prevent gcc from making the optimization. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
parent
71d48dbda3
commit
104ed324dd
@ -3101,7 +3101,12 @@ dbuf_check_blkptr(dnode_t *dn, dmu_buf_impl_t *db)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
/*
|
||||
* dbuf_sync_indirect() is called recursively from dbuf_sync_list() so it
|
||||
* is critical the we not allow the compiler to inline this function in to
|
||||
* dbuf_sync_list() thereby drastically bloating the stack usage.
|
||||
*/
|
||||
noinline static void
|
||||
dbuf_sync_indirect(dbuf_dirty_record_t *dr, dmu_tx_t *tx)
|
||||
{
|
||||
dmu_buf_impl_t *db = dr->dr_dbuf;
|
||||
@ -3148,7 +3153,12 @@ dbuf_sync_indirect(dbuf_dirty_record_t *dr, dmu_tx_t *tx)
|
||||
zio_nowait(zio);
|
||||
}
|
||||
|
||||
static void
|
||||
/*
|
||||
* dbuf_sync_leaf() is called recursively from dbuf_sync_list() so it is
|
||||
* critical the we not allow the compiler to inline this function in to
|
||||
* dbuf_sync_list() thereby drastically bloating the stack usage.
|
||||
*/
|
||||
noinline static void
|
||||
dbuf_sync_leaf(dbuf_dirty_record_t *dr, dmu_tx_t *tx)
|
||||
{
|
||||
arc_buf_t **datap = &dr->dt.dl.dr_data;
|
||||
|
@ -2002,7 +2002,7 @@ receive_read(struct receive_arg *ra, int len, void *buf)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
noinline static void
|
||||
byteswap_record(dmu_replay_record_t *drr)
|
||||
{
|
||||
#define DO64(X) (drr->drr_u.X = BSWAP_64(drr->drr_u.X))
|
||||
@ -2137,7 +2137,7 @@ save_resume_state(struct receive_writer_arg *rwa,
|
||||
rwa->os->os_dsl_dataset->ds_resume_bytes[txgoff] = rwa->bytes_read;
|
||||
}
|
||||
|
||||
static int
|
||||
noinline static int
|
||||
receive_object(struct receive_writer_arg *rwa, struct drr_object *drro,
|
||||
void *data)
|
||||
{
|
||||
@ -2243,7 +2243,7 @@ receive_object(struct receive_writer_arg *rwa, struct drr_object *drro,
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
noinline static int
|
||||
receive_freeobjects(struct receive_writer_arg *rwa,
|
||||
struct drr_freeobjects *drrfo)
|
||||
{
|
||||
@ -2279,7 +2279,7 @@ receive_freeobjects(struct receive_writer_arg *rwa,
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
noinline static int
|
||||
receive_write(struct receive_writer_arg *rwa, struct drr_write *drrw,
|
||||
arc_buf_t *abuf)
|
||||
{
|
||||
@ -2309,7 +2309,6 @@ receive_write(struct receive_writer_arg *rwa, struct drr_write *drrw,
|
||||
return (SET_ERROR(EINVAL));
|
||||
|
||||
tx = dmu_tx_create(rwa->os);
|
||||
|
||||
dmu_tx_hold_write(tx, drrw->drr_object,
|
||||
drrw->drr_offset, drrw->drr_logical_size);
|
||||
err = dmu_tx_assign(tx, TXG_WAIT);
|
||||
@ -2500,7 +2499,7 @@ receive_spill(struct receive_writer_arg *rwa, struct drr_spill *drrs,
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
noinline static int
|
||||
receive_free(struct receive_writer_arg *rwa, struct drr_free *drrf)
|
||||
{
|
||||
int err;
|
||||
|
Loading…
x
Reference in New Issue
Block a user