apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Reser <...@reser.org>
Subject Re: Question about httpd memory buffer alignment
Date Fri, 11 Jan 2013 19:21:37 GMT
On Fri, Jan 11, 2013 at 10:54 AM, Zhe Zhang <zhezhang@us.ibm.com> wrote:
> Hi Ben, thank you for the reply. I have disabled mmap and sendfile options.
> I'm getting 8192 bytes buffers; so the size is fine, but I want the starting
> address of the buffer to be 4K-aligned too. Now it seems aligned at 8 bytes
> boundary (xxxxx8 instead of xxxx000).

I'm assuming you're trying to align the access of data on the disk to
the actual blocks on the disk so that you're avoiding reading a block
multiple times across reads.  If you're seeing the access is off by 8
bytes, it sounds like there's someplace that apr_file_ungetc() is
getting used.

If you're trying to align the actual memory that's going to mean
messing with the memory pooling system for APR.  Probably writing your
own allocator.  And using that allocator with
apr_brigade_insert_file() call in default_handler() in server/core.c.

View raw message