Re: Re: block allocation in ext2fs

From: animesh_singh@bbv.satyam.com
Date: Tue May 09 2000 - 13:31:52 EST


On Tue, 9 May 2000, Gabriel Benhanokh wrote:

>
> >
> > hi
> > very true i missed out a few more details , the buffer block after
> > being marked uptodate is also required to wake up any process sleeping on
> > its wait queue this is done by execution of b_end_io function in the
> > buffer head (ll_rw_blk) but this is all done only when the buffer block
> > has been flushed by bdflush or sync command line(this generates request
> > for the under laying disk driver by make_request) and successfully written
> > on the disk.
> > a very simple solution for your problem can be one of these
> > 1. you don't allow your buffer block to be ever processed by ll_rw_blk
> > function hence always mark it uptodate , wake up all waiting process and
> > not dirty
> how do i do this?
> will maring the buffer clean and than calling bforget won't do this ?
 
        have a look at the
        end_that_request_last function defined in the ll_rw_blk.c
        the wait queue is associated with request issued to the device
        it came here in the first place because the block asked for was
        not there in the buffer cache (bread returns immediately if the
        block is present else issues the request for it)hence its
        necessary to wakeup all these process

>
> > 2. you trap the request call at disk driver level(this is fairly easy) and
> > don't allow the block to be written but call end_request(1)(this does
> > everything for you) without executing the real request function of the
> > disk driver thus data is never written
> i think that this will only help not to do the disk io, but won't avoid the
> cache wiping problem. i will still be using too many un-nessceary cache
> buffers.
> and beside for this i must change the driver which i don't want.
> i'm trying to just add another module without changing any other stuff.
>
        No !!!!!
        you don't have to do all this ,
        request function of all the block devices are registered in
        request structure are part of the
        struct blk_dev_struct blk_dev (look in ll_rw_blk.c)
        blk_dev is an exposed DS thus its easy to steal the request
        function pointer and substitute your own function ptr here , thus
        a simple module can do all the job for you (i have some code if
        you want i shall send it )
        
        in order to release your buffer block its necessary to reduce its
        b_count to zero hence followed by any reference to buffer block
        through apis like bread shuold be followed by brelse. even though
        you might find that the buffers are still persisting they shall all be
        eatten away when any heavy mem requirements are put to your system
        

 
> THX
> /gaby
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:14 EST