Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy: Replace rte_memcpy with regular memcpy #155

Closed
wants to merge 1 commit into from
Closed

copy: Replace rte_memcpy with regular memcpy #155

wants to merge 1 commit into from

Conversation

benlwalker
Copy link
Member

Eliminate rte_memcpy dependency by replacing it with
regular memcpy. This may impact performance, but the only
use of rte_memcpy was in the malloc bdev which is for
testing only.

Change-Id: I3e8592cb08262272518ec3d29ea165b4e8f48a5c

Eliminate rte_memcpy dependency by replacing it with
regular memcpy. This may impact performance, but the only
use of rte_memcpy was in the malloc bdev which is for
testing only.

Change-Id: I3e8592cb08262272518ec3d29ea165b4e8f48a5c
@johnmeneghini
Copy link
Contributor

johnmeneghini commented May 5, 2017 via email

Copy link

@ranjitnoronha ranjitnoronha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this will change further. ie. The standard assert.h, stdio.h and errno.h files would move to spdk/stdinc.h (change in pull described here:

#157 (comment)
)
So, anyone wanting to use their own memcpy implementation should be able to via a custom stdinc.h.

Approving this change.

@johnmeneghini
Copy link
Contributor

johnmeneghini commented May 5, 2017 via email

@@ -112,7 +110,8 @@ mem_copy_submit(void *cb_arg, struct spdk_io_channel *ch, void *dst, void *src,
{
struct spdk_copy_task *copy_req;

rte_memcpy(dst, src, (size_t)nbytes);
memcpy(dst, src, (size_t)nbytes);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was hoping to abstract rte_memcpy because there are other high performance implementations of memcpy that each platform may want to implement. rte_memcpy is the perfect example of a high performance memcpy routine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In SPDK itself we don't actually use mempcy in any situation where it is performance sensitive*. This was actually the only large copy of variable size remotely close to the I/O path, and this module is only used for testing. Instead, we use zero-copy strategies throughout.

Now, users of SPDK may need to copy data around and are free to use their own high performance memcpy implementations. Since those calls to mempcy are from user code, they don't need SPDK to create a wrapper - they can just call their version directly.

*There are a couple of places where we do a memcpy, but they're small copies of sizes known at compilation time, so the compiler replaces them with the appropriate instructions.

@benlwalker
Copy link
Member Author

This was merged as commit 1ad673a

@benlwalker benlwalker closed this May 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants