Skip to contentSkip to conversation

Clustering of Request in block layer

DISCUSSION Nirmala S 2 participants 2 messages Apr 13, 2003

lore
Share & tools
lore

Nirmala S

author
#0 lore raw

Hi,

As per my understanding the block layer clusters requests for all block drivers.
Clustering -
Creating a linked list of buffer_heads using b_reqnext.

But, when I run my block driver and try to view the number of clustered requests in my Request function, I do not find any clustering done.

void own_request(request_queue_t *q)

{
    struct buffer_head *tmp;
    int count;
    while(1) {
        INIT_REQUEST;
        printk("<1>request %p: cmd %i sec %li (nr. %li)\n", CURRENT,
               CURRENT->cmd,
               CURRENT->sector,
               CURRENT->current_nr_sectors);
       count=0;
       for (tmp=bh; tmp; tmp=tmp->b_reqnext)
            count ++;
       printk("Count = %d\n", count);
        end_request(1); /* success */
    }
}

The above always shows 'Count = 1'. dd if=/dev/mydevice of=/dev/null. Does this mean that no clustering is done ??

Just read a document a "http://www.usenix.org/publications/library/proceedings/usenix2000/freenix/full_papers/gopinath/gopinath_html/node14.html" which says "This clustering is performed only for the drivers compiled in the kernel and not for loadable modules."

Is this the reason ??

Regards,
Mala

Signature · 3 lines
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
#1 lore raw
Quoted 29 lines · Nirmala S

Hi,

As per my understanding the block layer clusters requests for all block drivers.
Clustering -
Creating a linked list of buffer_heads using b_reqnext.

But, when I run my block driver and try to view the number of clustered requests in my Request function, I do not find any clustering done.

void own_request(request_queue_t *q)

{
    struct buffer_head *tmp;
    int count;
    while(1) {
        INIT_REQUEST;
        printk("<1>request %p: cmd %i sec %li (nr. %li)\n", CURRENT,
               CURRENT->cmd,
               CURRENT->sector,
               CURRENT->current_nr_sectors);
       count=0;
       for (tmp=bh; tmp; tmp=tmp->b_reqnext)
            count ++;
       printk("Count = %d\n", count);
        end_request(1); /* success */
    }
}
Quoted 2 lines

The above always shows 'Count = 1'. dd if=/dev/mydevice of=/dev/null. Does this mean that no clustering is done ??

try to add a bs=256k or something like that.

Quoted 4 lines

Just read a document a "http://www.usenix.org/publications/library/proceedings/usenix2000/freenix/full_papers/gopinath/gopinath_html/node14.html" which says "This clustering is performed only for the drivers compiled
in the kernel and not for loadable modules."

2.2 and newer clusters for all drivers.

Signature · 1 line
Jens Axboe