Page MenuHomeFreeBSD

vico13.chen_gmail.com (Vico Chen)
Vico Chen

Projects

User does not belong to any projects.

User Details

User Since
Jul 3 2021, 9:10 AM (11 w, 3 d)

Vico Chen

Recent Activity

Thu, Sep 2

vico13.chen_gmail.com added inline comments to D31037: Improve the epoll for socket to be compatible with Linux.
Thu, Sep 2, 6:08 AM
vico13.chen_gmail.com added a comment to D31037: Improve the epoll for socket to be compatible with Linux.
In D31037#711053, @wulf wrote:

Why do you store epoll events in separate member? kqueue(2) explicitly states that ext[0] and ext[1] fields are created for that:

ext        Extended data passed to and from kernel.  The ext[0] and
           ext[1] members use is defined by the filter.  If the filter
           does not use them, the members are copied unchanged.

You need to add new filter flag e.g. NOTE_EPOLL to indicate that your code starts using ext[0] to return event data in epoll format

It is OK to just use ext[0] for 'pevent' and 'pmask' (8 bytes). But my concern is: since ext[0] is a generic define, if other components also use ext[0], it will be conflict. Who use ext[0] must confirm no others use it. It is a potential risk.

Which conflict?

Two concerns:

  1. In 'linux_epoll_ctl', we set ext[0], and it means, in furture, others can't re-use it, and they must use ext[1].
  2. In 'linux_epoll_ctl', we set ext[0], and then the kevent is registered. Is there a risk that 'ext[0]' of this kevent is overrided by other components?
Thu, Sep 2, 3:23 AM

Aug 12 2021

vico13.chen_gmail.com added inline comments to D31037: Improve the epoll for socket to be compatible with Linux.
Aug 12 2021, 8:55 AM
vico13.chen_gmail.com added a comment to D31037: Improve the epoll for socket to be compatible with Linux.
In D31037#709587, @wulf wrote:

wulf,
all works well, and we don't see it breaks the API and ABI. Could you please describe more details how it breaks the API and ABI?

if your pre-patch code uses ext[3] to store some bits of context in it, it can not be compiled and executed on post-patch system due to array out-of-bound access. This is an API breakage.
if your binary is compiled out of code which uses ext[0] to store some bits of context and it was built on pre-patch system, it can not run on post-patch system correctly anymore as ext[0] value is clobbered by pevents member which have the same offset. This is an ABI breakage.

Aug 12 2021, 7:42 AM
vico13.chen_gmail.com added inline comments to D31037: Improve the epoll for socket to be compatible with Linux.
Aug 12 2021, 7:13 AM

Aug 9 2021

vico13.chen_gmail.com added a comment to D31037: Improve the epoll for socket to be compatible with Linux.

Test cases

Aug 9 2021, 9:59 AM
vico13.chen_gmail.com added a comment to D31037: Improve the epoll for socket to be compatible with Linux.

wulf,
This patch is applied in our project which is based on FreeBSD12, and all works well, and we don't see it breaks the API and ABI. Could you please describe more details how it breaks the API and ABI?
If there are concerns for eliminating of ext[3] array, how about just introducing pevent and pmask and keep ext[4] in 'struct kevent'?

Aug 9 2021, 9:08 AM

Jul 8 2021

vico13.chen_gmail.com updated vico13.chen_gmail.com.
Jul 8 2021, 2:21 AM
vico13.chen_gmail.com updated vico13.chen_gmail.com.
Jul 8 2021, 2:17 AM
vico13.chen_gmail.com updated vico13.chen_gmail.com.
Jul 8 2021, 2:17 AM

Jul 6 2021

vico13.chen_gmail.com updated the diff for D31037: Improve the epoll for socket to be compatible with Linux.
  1. Introduce 'pmask' in kevent to return the EPOLL events which are requested by applications.
  2. Add a test case which is compiled on Linux.
Jul 6 2021, 10:27 AM
vico13.chen_gmail.com updated the diff for D31037: Improve the epoll for socket to be compatible with Linux.
Jul 6 2021, 2:48 AM
vico13.chen_gmail.com updated the diff for D31037: Improve the epoll for socket to be compatible with Linux.
Jul 6 2021, 1:57 AM

Jul 5 2021

vico13.chen_gmail.com added reviewers for D31037: Improve the epoll for socket to be compatible with Linux: dchagin, Linux Emulation.
Jul 5 2021, 10:06 AM
vico13.chen_gmail.com requested review of D31037: Improve the epoll for socket to be compatible with Linux.
Jul 5 2021, 4:07 AM