Re: How do we handle the same but uptodated data to disk cache?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday May 27, bo@anthologysolutions.com wrote:
> Neil,
> 
> It improved a lot for the sync I/O.
> However, I am looking for a solution to handle
> the regular async I/O with a page data on the
> same sector repeatedly like writing the MD SB
> data to disk without flushing.

This is a filesystem question.  Not a raid question.

I would just:
   getblk
   copy new data in
   mark update
   mark dirty
   release block

and it will eventually be flushed to disk.
If you want to written sooner, call
   submit_bh


NeilBrown

> 
> The follwing is my simple algorithm for it;
> 
>         bh=getblk(dev, block, size);
>         if (buffer_uptodate(bh)) { /* still in cache, not flushed yet */
>               bh->b_data = "updated data";
>               brelse(bh);
>         }
>         else { /* all were flushed or new  */
>             .
>             .
>              mark_buffer_uptodate(bh,1);
>              mark_buffer_dirty(bh);
>             generic_make_request(rw, &bh);
>        }
> 
>  Please give me your suggestion or comment.
> 
> 
> Bo
> ----- Original Message -----
> From: "Neil Brown" <neilb@cse.unsw.edu.au>
> To: "bmoon" <bo@anthologysolutions.com>
> Cc: <linux-raid@vger.kernel.org>
> Sent: Monday, May 26, 2003 7:47 PM
> Subject: Re: How do we handle the same but uptodated data to disk cache?
> 
> 
> > On Monday May 26, bo@anthologysolutions.com wrote:
> > > Hello,
> > >
> > > I want to write the data to the fixed sector with the same size
> frequently
> > > just like MD super block, but I do not want to sync and flush the dev
> > > on each write.
> > >
> > > For example, to write md super block in /drivers/md/md.c
> >
> > I suggest you look at a newer md.c.  With 2.4.21pre or 2.5.* have
> > "sync_page_io" which does what you want more effectively.
> >
> > NeilBrown
> >
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux