[RFC] kiobuf problems with 2.4.17

From: Badari Pulavarty (pbadari@us.ibm.com)
Date: Thu Feb 14 2002 - 13:09:05 EST


Hi,

We are having problems with kiobufs on 2.4.17 while running
database benchmarks (on RAW). Issue here is we get one kiobuf
per device open. Since database processes does lots of opens
we end up allocating lots of kiobufs. So we run out of memory
and start swapping.

These benchmarks ran fine on 2.4.6, since it has only kiobuf
per device.

I have few ideas and need your suggestions/comments on fixing
this issue.

1) Have one kiobuf per process instead of open. Since a process
   cannot do more than one IO at any time, why not maintain
   one kiobuf per process instead file open ? (With the exception
   of asyncio).

   This way we can save a lot, if process does lots of opens.
   What am I missing here ?

2) Reduce the size of kiobuf.

   (i) Currently kiobuf has:
                
                struct buffer_head * bh[KIO_MAX_SECTORS];

     Why not make it

                struct buffer_head * bh;

   and them chainup in alloc_kiovec(). We can save almost 4K doing this.

   (ii) kiobuf also has:

                unsigned long blocks[KIO_MAX_SECTORS];

     We don't really need this for RAW IO. Why not make it

                unsigned long *blocks;

   and NOT allocate it for RAW (for O_DIRECT and other usages we can
   allocated it). This will save another 4K for RAW.

   I made a patch to do (2) and it works fine.

Please let me know.

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



This archive was generated by hypermail 2b29 : Fri Feb 15 2002 - 21:01:03 EST