Commit Graph

19 Commits

Author SHA1 Message Date
fengbojiang f98fd1a615 Don't free the memory malloc with rte_malloc in more socket API to
improve proformance, such as ff_hook_writev(), ff_hook_ioctl(), ff_hook_setsockopt(), etc.

But there are some others socket API not support this now, such as
ff_hook_recvmsg(), ff_hook_readv(), ff_hook_sendmsg, because it not be
used now, and do it is relatively troublesome, So If you need call them
very frequently, maybe you should support it, and can see
ff_hook_writev().

Now it will cause memory lead, need to fix it later.
2023-04-26 15:29:15 +08:00
fengbojiang a791578c8a Fix the issue that memory leak in ff_hook_ioctl and ff_hook_getsockopt. 2023-04-25 15:01:22 +08:00
fengbojiang 77d7051991 Nginx can basic work with libff_syscall.so without any code modify now.
1. Add FF_KERNEL_EVENT argument, default disable. If enable FF_KERNEL_EVENT, epoll_create/epoll_clt/epoll_wait always call f-stack and system API at the same time. Use for some scenarios similar to Nginx. And F-Stack's kern.maxfiles value shoudn't > 65536.
2. Fix the issue that abs_timeout possibly is negative numbers.
3. If timeout < 0, such as -1, ff_hook_epoll_wait will run loop always until return some events.
3. Add some log.
2023-04-25 11:59:10 +08:00
fengbojiang ac0321e70e Add refcoount in sc for fork and detach. 2023-04-23 11:32:33 +08:00
fengbojiang dd7dc378ef opt code. 2023-04-23 10:51:56 +08:00
fengbojiang 3cd0ab86b6 1. Reduce the number of locks with dirty read first, and then try to lock sc and real read. QPS:360k -> 380k.
2. memory alignment. QPS:380k -> 400k.
2023-04-14 14:37:15 +08:00
fengbojiang 4af5a643fb 1. Fixed some issue that sem_timewait and sem_post.
2. Modify timeout of epoll_wait/kevent from 100us to 100ms by default.
3. set cpu affinity in main_stack_epoll_thread socket.
2023-04-13 19:27:57 +08:00
fengbojiang d3fabc9cef some opt. 2023-04-13 19:05:46 +08:00
fengbojiang e45925dd79 Don't free the memory malloc with rte_malloc in most commonly used socket API, to improve proformance.
The performance of single instance from 200,000 QPS improve to 260,000QPS.
NOTE:May cause memory leak.
2023-04-12 18:57:59 +08:00
fengbojiang 03b606ff9b Support timeout is NULL or 0 in libffsyscall.so.
And support it in main_stack.c.
2023-04-12 12:00:53 +08:00
fengbojiang e58d683b24 burst copy in ff_hook_epoll_wait. 2023-04-12 10:15:22 +08:00
fengbojiang 1d09ad5003 Fixed some issue that check the return value of sem_timedwait. 2023-04-11 17:51:34 +08:00
fengbojiang 8766cedde1 Add timeout in kevent. 2023-04-08 09:29:50 +08:00
fengbojiang f27d862f85 1. Add kevent demo, need link libff_syscall.so, not LD_PRELOAD.
2. Fix some issues.
2023-04-07 20:39:31 +08:00
fengbojiang baceb8fd64 1. Add FF_PROC_ID environment variable to fix the issue that secondary APP's process get sc
from the first ff_so_zone.
2. SIGINT can destructor sc.
2023-04-07 10:43:37 +08:00
fengbojiang 799c39d5f0 Fix the issue that not detach sc while destructor in exit. 2023-04-06 21:48:57 +08:00
fengbojiang 0efc8b3374 Fixed some issue in multi instances. 2023-04-06 19:09:55 +08:00
fengbojiang fe7e360eca Add FF_THREAD_SOCKET in Makefile, Whether to use thread-level socket,
default enable.
2023-04-06 18:02:47 +08:00
fengbojiang 865ab0ed63 Add adapter for LD_PRELOAD, TBC. 2023-04-06 15:02:39 +08:00