Whamcloud - gitweb
b=1598
authorphil <phil>
Sun, 3 Aug 2003 19:44:44 +0000 (19:44 +0000)
committerphil <phil>
Sun, 3 Aug 2003 19:44:44 +0000 (19:44 +0000)
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.

lustre/llite/file.c
lustre/llite/rw.c
lustre/obdclass/obdo.c
lustre/obdfilter/filter_io.c

index 67d18fd..2ccf3c0 100644 (file)
@@ -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;
 
index e5890bf..b79ee7d 100644 (file)
@@ -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 */
 
index 4532534..493e829 100644 (file)
@@ -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;
index 0885a80..73cf7a0 100644 (file)
@@ -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,