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

[-- Attachment #1 --]
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

[-- Attachment #2 --]
<div dir="ltr">Hi there,<br><div><br></div><div>I&#39;ve been hard at work over the last few months contributing to FreeBSD through</div><div>the Google 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 that I can get started on.</div><div><br></div><div>I ran into a few OS-related problems during my project that I would like to fix.</div><div>I thought I would share those issues here for advice and potential objections.</div><div><br></div><div>* Implementing signalfd:</div><div><a href="https://man7.org/linux/man-pages/man2/signalfd.2.html">https://man7.org/linux/man-pages/man2/signalfd.2.html</a></div><div>This is a huge one. I needed to comment a lot of important code inside</div><div>of igt-gpu-tools to compensate for signalfd&#39;sĀ absence. I am reading The</div><div>Design and Implementation 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="https://man7.org/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-tools 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="gmail-Apple-interchange-newline">* Implementing userfaultfd:</div><div><a href="https://man7.org/linux/man-pages/man2/userfaultfd.2.html">https://man7.org/linux/man-pages/man2/userfaultfd.2.html<br></a></div><div>Page fault handling and processing from the userspace.</div><div><div><br class="gmail-Apple-interchange-newline">* Adding %m format specifier to scanf:</div><div>The %m format specifier is a POSIX 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 gettid() funtion:</div><div><a href="https://man7.org/linux/man-pages/man2/gettid.2.html">https://man7.org/linux/man-pages/man2/gettid.2.html</a><br></div><div>This function grabs the thread identifier for the currently running process.</div><div>I am not yet informed about FreeBSD&#39;s thread scheduling 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><div>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>Thank you,</div><div>Jake Freeland</div></div>

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