Re: Fw: Buffer overflow in CIFS VFS.
- From: Przemyslaw Wegrzyn <czajnik@xxxxxxxxxxx>
- Date: Sun, 11 Nov 2007 01:22:47 +0100
Steve French wrote:
On Nov 10, 2007 7:03 AM, Przemyslaw Wegrzyn <czajnik@xxxxxxxxxxx> wrote:That was not really my intention to allocate variable size buffers -
Steve French wrote:What I meant is that two fixed size memory pools rather variable size
That might be better, although without memory pools, this would performWhy ? I don't get your point here.
much worse
kmallocs helps performance. By using two fixed size buffers (small -
which fits the typical smb request and response, and large which fits
the maximum size request other than write which is handled via an
iovec) and taking advantage of memory pools, cifs can always make
progress even in low memory situations (reducing the likelihood of
deadlock) and it reduces the number of times that cifs has to do the
very expensive allocation of 16.5K. If cifs only used variable size
request and response buffers, since they are frequently more than one
page in size we would be forcing the memory manager to find contiguous
pages which can be very slow.
it's perfectly Ok for me to have 2 fixed-size pools. What I meant was to
allocate buffers with some kind of header containing buffer size and
type of buffer or whatever needed info. Obviously, you could use
pointers to buffer body all over the code, functions/macros that need to
access the header would move the pointer back by sizeof(header). Then
one could e.g. provide a single function for disposing the buffer, and
no longer care which pool is it allocated from, for the additional
memory cost - the function would look into the header to check that for
you. Hope it's clear now (my English is far from perfect).
Przemyslaw
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- References:
- Re: Fw: Buffer overflow in CIFS VFS.
- From: Steve French
- Re: Fw: Buffer overflow in CIFS VFS.
- From: Przemyslaw Wegrzyn
- Re: Fw: Buffer overflow in CIFS VFS.
- From: Steve French
- Re: Fw: Buffer overflow in CIFS VFS.
- From: Przemyslaw Wegrzyn
- Re: Fw: Buffer overflow in CIFS VFS.
- From: Steve French
- Re: Fw: Buffer overflow in CIFS VFS.
- Prev by Date: Re: cd/dvd inaccessible in 2.6.24-rc2
- Next by Date: Re: WARNING: at lib/kref.c:33 kref_get() (-mm 2007-11-06-02-32++)
- Previous by thread: Re: Fw: Buffer overflow in CIFS VFS.
- Next by thread: [PATCH 0/3] Kvm clocksource, new spin
- Index(es):
Relevant Pages
|