On Wed, Jun 25, 2014 at 11:13 AM, AKASHI Takahiro
<[email protected]> wrote:
> This function copies the reply message directly into receiver's buffer
> (pool slice). Looking into the implementation closely, however, there are
> multiple occurrences of copy operations, kdbus_pool_slice_copy(), which
> then executes costly prolog/epilog functions, say set_fs() and
> write_begin/write_end(), on each entry/exit.
>
> This patch uses a temporary buffer on the stack to compose a message and
> replace a costly function, kdbus_pool_slice_copy(), to memcpy() wherever
> possible, although I have to further confirm that this change is actually
> safe.

> +#if KDBUS_HACK1
> +       tmp = kmalloc(vec_data, GFP_KERNEL);

You meant a malloced temporary buffer, not one allocated on the stack, right?

We need to handle larger vectors than kmalloc can handle, that's why
we copy directly to the receiver, and to avoid 2 copies.

Did you find out what exactly in the call chain of our "open-coded
write" shows up as expensive here?

Kay
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to