Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Aug 2022 15:17:51 -0500
From:      Jake Freeland <jake@technologyfriends.net>
To:        freebsd-hackers@freebsd.org
Subject:   SRC Contributions: Advice and Objections
Message-ID:  <CAOgZAGaiBbuXhBwF=fyTUH%2Bb38fAQVeW%2B0Zivh5fDFD2JXJdjA@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--0000000000008e484305e766f552
Content-Type: text/plain; charset="UTF-8"

Hi there,

I've been hard at work over the last few months contributing to FreeBSD
through
the Google Summer of Code program and learning about the operating system.
Now that I am almost finished with porting Intel's igt-gpu-tools to
FreeBSD, I am
thinking about other potential SRC contributions that I can get started on.

I ran into a few OS-related problems during my project that I would like to
fix.
I thought I would share those issues here for advice and potential
objections.

* Implementing signalfd:
https://man7.org/linux/man-pages/man2/signalfd.2.html
This is a huge one. I needed to comment a lot of important code inside
of igt-gpu-tools to compensate for signalfd's absence. I am reading The
Design and Implementation of the FreeBSD Operating System by McKusick,
Neville-Neil, and Watson (excellent read by the way) to get a comprehensive
grasp on how FreeBSD handles signals and file descriptors internally.
I plan to finish the book and get started on this first.

* Implementing timerfd:
https://man7.org/linux/man-pages/man2/timerfd_gettime.2.html
I am unsure whether it would be beneficial to upstream POSIX timer
patches for igt-gpu-tools or to implement timerfd for FreeBSD. I am
erring on the side of implementing timerfd if other applications need
to use it in the future.

* Implementing userfaultfd:
https://man7.org/linux/man-pages/man2/userfaultfd.2.html
Page fault handling and processing from the userspace.

* Adding %m format specifier to scanf:
The %m format specifier is a POSIX extension to the ISO C standard that can
precede
%c, %s, and %[. The %m allocates a memory buffer to hold the string
including a
terminating null character.

* Adding the gettid() funtion:
https://man7.org/linux/man-pages/man2/gettid.2.html
This function grabs the thread identifier for the currently running process.
I am not yet informed about FreeBSD's thread scheduling so I don't know
if adding this function is even necessary.

* Adding ETIME errno:
I am not sure how necessary this one is because ETIMEDOUT exists, but I
understand the distinction between the two. I would think that ETIME
would already be present if it were necessary.

Any input would be appreciated.

Thank you,
Jake Freeland

--0000000000008e484305e766f552
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi there,<br><div><br></div><div>I&#39;ve been hard at wor=
k over the last few months contributing to FreeBSD through</div><div>the Go=
ogle Summer of Code program and learning about the operating system.</div><=
div>Now that I am almost finished with porting Intel&#39;s igt-gpu-tools to=
 FreeBSD, I am</div><div>thinking about other potential SRC contributions t=
hat I can get started on.</div><div><br></div><div>I ran into a few OS-rela=
ted problems during my project that I would like to fix.</div><div>I though=
t I would share those issues here for advice and potential objections.</div=
><div><br></div><div>* Implementing signalfd:</div><div><a href=3D"https://=
man7.org/linux/man-pages/man2/signalfd.2.html">https://man7.org/linux/man-p=
ages/man2/signalfd.2.html</a></div><div>This is a huge one. I needed to com=
ment a lot of important code inside</div><div>of igt-gpu-tools to compensat=
e for signalfd&#39;s=C2=A0absence. I am reading The</div><div>Design and Im=
plementation of the FreeBSD Operating System by McKusick,</div><div>Neville=
-Neil, and Watson (excellent read by the way) to get a comprehensive</div><=
div>grasp on how FreeBSD handles signals and file descriptors internally.</=
div><div>I plan to finish the book and get started on this first.</div><div=
><br></div><div>* Implementing timerfd:</div><div><a href=3D"https://man7.o=
rg/linux/man-pages/man2/timerfd_gettime.2.html">https://man7.org/linux/man-=
pages/man2/timerfd_gettime.2.html</a><br></div><div>I am unsure whether it =
would be beneficial to upstream POSIX timer</div><div>patches for igt-gpu-t=
ools or to implement timerfd for FreeBSD. I am</div><div>erring on the side=
 of implementing timerfd if other applications need</div><div>to use it in =
the future.</div><div><div><br class=3D"gmail-Apple-interchange-newline">* =
Implementing userfaultfd:</div><div><a href=3D"https://man7.org/linux/man-p=
ages/man2/userfaultfd.2.html">https://man7.org/linux/man-pages/man2/userfau=
ltfd.2.html<br></a></div><div>Page fault handling and processing from the u=
serspace.</div><div><div><br class=3D"gmail-Apple-interchange-newline">* Ad=
ding %m format specifier to scanf:</div><div>The %m format specifier is a P=
OSIX extension to the ISO C standard that can precede</div><div>%c, %s, and=
 %[. The %m allocates a memory buffer to hold the string including a</div><=
div>terminating null character.</div><div><br></div><div>* Adding the getti=
d() funtion:</div><div><a href=3D"https://man7.org/linux/man-pages/man2/get=
tid.2.html">https://man7.org/linux/man-pages/man2/gettid.2.html</a><br></di=
v><div>This function grabs the thread identifier for the currently running =
process.</div><div>I am not yet informed about FreeBSD&#39;s thread schedul=
ing so I don&#39;t know</div><div>if adding this function is even necessary=
.</div><div><br></div></div><div><div>* Adding ETIME errno:</div><div>I am =
not sure how necessary this one is because ETIMEDOUT exists, but I</div><di=
v>understand the distinction between the two. I would think that ETIME</div=
><div>would already be present if it were necessary.</div></div><div><br></=
div></div><div>Any input would be appreciated.</div><div><br></div><div>Tha=
nk you,</div><div>Jake Freeland</div></div>

--0000000000008e484305e766f552--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOgZAGaiBbuXhBwF=fyTUH%2Bb38fAQVeW%2B0Zivh5fDFD2JXJdjA>