Skip to content
Snippets Groups Projects
Commit c9d23149 authored by Phil Schwan's avatar Phil Schwan
Browse files

b=1598

r=shaver
Fix the 3x read performance regression caused by clobbering the
client's i_blksize number, which sets an upper bound on the amount of
readahead done by a single ll_readpage.  The practical upshot was that
all reads after the first one would do 4k to the disk and 4k over the
wire.
parent fb528b4c
No related branches found
No related tags found
No related merge requests found
......@@ -205,9 +205,8 @@ static int ll_osc_open(struct lustre_handle *conn, struct inode *inode,
GOTO(out, rc);
file->f_flags &= ~O_LOV_DELAY_CREATE;
obdo_refresh_inode(inode, oa, OBD_MD_FLBLOCKS | OBD_MD_FLBLKSZ |
OBD_MD_FLATIME | OBD_MD_FLMTIME |
OBD_MD_FLCTIME);
obdo_refresh_inode(inode, oa, (OBD_MD_FLBLOCKS | OBD_MD_FLATIME |
OBD_MD_FLMTIME | OBD_MD_FLCTIME));
EXIT;
out:
obdo_free(oa);
......@@ -264,7 +263,6 @@ static int ll_create_obj(struct lustre_handle *conn, struct inode *inode,
}
GOTO(out_oa, rc);
}
obdo_refresh_inode(inode, oa, OBD_MD_FLBLKSZ);
LASSERT(lsm && lsm->lsm_object_id);
rc = obd_packmd(conn, &lmm, lsm);
......@@ -471,8 +469,8 @@ int ll_inode_getattr(struct inode *inode, struct lov_stripe_md *lsm,
(aft != 0 || after < before) &&
oa.o_size < ((u64)before + 1) << PAGE_CACHE_SHIFT);
obdo_refresh_inode(inode, &oa, OBD_MD_FLBLOCKS | OBD_MD_FLBLKSZ |
OBD_MD_FLMTIME | OBD_MD_FLCTIME);
obdo_refresh_inode(inode, &oa, (OBD_MD_FLBLOCKS | OBD_MD_FLMTIME |
OBD_MD_FLCTIME));
if (inode->i_blksize < PAGE_CACHE_SIZE)
inode->i_blksize = PAGE_CACHE_SIZE;
......
......@@ -174,7 +174,7 @@ static int ll_readpage(struct file *file, struct page *first_page)
max_pages = ((end_index - first_page->index) << PAGE_CACHE_SHIFT) >>
PAGE_SHIFT;
pgs = kmalloc(max_pages * sizeof(*pgs), GFP_USER);
OBD_ALLOC_GFP(pgs, max_pages * sizeof(*pgs), GFP_USER);
if (pgs == NULL)
RETURN(-ENOMEM);
......@@ -214,6 +214,10 @@ static int ll_readpage(struct file *file, struct page *first_page)
} else if (extent_end < end_index)
end_index = extent_end;
CDEBUG(D_INFO, "max_pages: %d, extent_end: %lu, end_index: %lu, "
"i_size: "LPU64"\n",
max_pages, extent_end, end_index, inode->i_size);
/* to balance the find_get_page ref the other pages get that is
* decrefed on teardown.. */
page_cache_get(page);
......@@ -317,7 +321,7 @@ static int ll_readpage(struct file *file, struct page *first_page)
page_cache_release(page);
}
kfree(pgs);
OBD_FREE(pgs, max_pages * sizeof(*pgs));
RETURN(rc);
} /* ll_readpage */
......
......@@ -205,9 +205,8 @@ void obdo_refresh_inode(struct inode *dst, struct obdo *src, obd_flag valid)
LTIME_S(dst->i_ctime) = src->o_ctime;
if (valid & OBD_MD_FLSIZE && src->o_size > dst->i_size)
dst->i_size = src->o_size;
/* optimum IO size */
if (valid & OBD_MD_FLBLKSZ)
dst->i_blksize = src->o_blksize;
/* Bug 1598: don't ever update i_blksize here; it needs to be managed
* by the LOV */
/* allocation of space */
if (valid & OBD_MD_FLBLOCKS && src->o_blocks > dst->i_blocks)
dst->i_blocks = src->o_blocks;
......
......@@ -464,7 +464,7 @@ static int filter_preprw_write(int cmd, struct obd_export *exp, struct obdo *oa,
LASSERT(oti != NULL);
oti->oti_handle = fsfilt_brw_start(exp->exp_obd, objcount, fso,
niocount, oti);
niocount, oti->oti_handle);
if (IS_ERR(oti->oti_handle)) {
rc = PTR_ERR(oti->oti_handle);
CDEBUG(rc == -ENOSPC ? D_INODE : D_ERROR,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment