From nobody Mon Aug 29 20:17:51 2022 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MGhZY3TyJz4Zd1k for ; Mon, 29 Aug 2022 20:17:57 +0000 (UTC) (envelope-from jake@technologyfriends.net) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MGhZX5VGNz3dxP for ; Mon, 29 Aug 2022 20:17:56 +0000 (UTC) (envelope-from jake@technologyfriends.net) Received: by mail-qt1-x82a.google.com with SMTP id y18so7057311qtv.5 for ; Mon, 29 Aug 2022 13:17:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=technologyfriends.net; s=google; h=to:subject:message-id:date:from:mime-version:from:to:cc; bh=iprGCSlZcn7hmyJm3INdthMtneGdfWxeLz3oCLzMFiU=; b=TUeXZnBTPY3GP16/bDGQlln5mhqpYlm18ghoYPY8Ph3Jmj/Sp2fZLtQfvUcjz6Aeoo xvQHoUEh/VoIT3zDbjg/6OOWSaihGVhgzL4c13i/u5aKlN7TkGxoUjcWOr3mLyduD7R3 DCHFq3KW5GKqhBEziydwo3s+/HhpHxLcsD38YNocbX+cxgTeCPVAY39bMm3Y03gU8mX+ KMLpcJaTBY6zDpPzHAENJu03Rd6lKFQo15w6sCftdzTrsM1pZQmXjMWbvfUGbt+JkVuj wol595WohzP8LIhR8QzI7q2M6A6IlQxGIPMVJhtlIHJWVBRnoVztNyiNms09M08HSq/6 97bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc; bh=iprGCSlZcn7hmyJm3INdthMtneGdfWxeLz3oCLzMFiU=; b=rDrfXmeCRpXaXVBaqQ7x3wMTNL/jopjHNLktBXtWOREmx61MYq4UF6U07AgDMhWGuJ zNKYZsu0NvieVWzbqzSAIWzT+zzRyWhAfIg9t84WYwDtOttNtUafg+KDFQ7ZA45jjKVg w3z5Rdd0lsk2N7FZg44kzUrRoSabSrCcORHwUybhXcuOXxboZcn8/NRZkszheXtnmLkM +K1/6poGO5RS82K6Y13gnmo2ROjq60vkgUYRShc43ZBoR1f7aTYglIZVUYLqpb/tdz6g KF4mVH0syA1mPZ8RCNEpKEIj6YlUFrO93Venwpt3brIFoan/Pf+HnpO5xyjrEDJs+Mqm OE6Q== X-Gm-Message-State: ACgBeo2cdLE2MIsbePuR3wvlkKHS9yoagPuUlzvQq0mxfvh3MnFaubwL dKnMOb1cmS0Z4WwL/57OXZBsCZq2ttkLMrFoea+C1AChD3R4/wIz X-Google-Smtp-Source: AA6agR7CEvV1LxbSKTi8tCF+ab18etHrxvF3Gtv85AjJ3kh6u/0Gg3P67Db5YcICyNdWEE1JBC+HVJQPkkQIlH60fcU= X-Received: by 2002:ac8:7f84:0:b0:343:6984:5af2 with SMTP id z4-20020ac87f84000000b0034369845af2mr11939885qtj.494.1661804275971; Mon, 29 Aug 2022 13:17:55 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 From: Jake Freeland Date: Mon, 29 Aug 2022 15:17:51 -0500 Message-ID: Subject: SRC Contributions: Advice and Objections To: freebsd-hackers@freebsd.org Content-Type: multipart/alternative; boundary="0000000000008e484305e766f552" X-Rspamd-Queue-Id: 4MGhZX5VGNz3dxP X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none ("invalid DKIM record") header.d=technologyfriends.net header.s=google header.b=TUeXZnBT; dmarc=none; spf=none (mx1.freebsd.org: domain of jake@technologyfriends.net has no SPF policy when checking 2607:f8b0:4864:20::82a) smtp.mailfrom=jake@technologyfriends.net X-Spamd-Result: default: False [-3.10 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MIME_TRACE(0.00)[0:+,1:+,2:~]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; R_DKIM_PERMFAIL(0.00)[technologyfriends.net:s=google]; RCVD_TLS_LAST(0.00)[]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::82a:from]; ARC_NA(0.00)[]; DMARC_NA(0.00)[technologyfriends.net]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[jake]; DKIM_TRACE(0.00)[technologyfriends.net:~]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N --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
Hi there,

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

I ran into a few OS-rela= ted problems during my project that I would like to fix.
I though= t I would share those issues here for advice and potential objections.

* Implementing signalfd:
This is a huge one. I needed to com= ment a lot of important code inside
of igt-gpu-tools to compensat= e for signalfd's=C2=A0absence. I am reading The
Design and Im= plementation of the FreeBSD Operating System by McKusick,
Neville= -Neil, and Watson (excellent read by the way) to get a comprehensive
<= div>grasp on how FreeBSD handles signals and file descriptors internally.
I plan to finish the book and get started on this first.

* Implementing timerfd:
I am unsure whether it = would be beneficial to upstream POSIX timer
patches for igt-gpu-t= ools 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:
Page fault handling and processing from the u= serspace.

* Ad= ding %m format specifier to scanf:
The %m format specifier is a P= OSIX extension to the ISO C standard that can precede
%c, %s, and= %[. The %m allocates a memory buffer to hold the string including a
<= div>terminating null character.

* Adding the getti= d() 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 schedul= ing 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.

Tha= nk you,
Jake Freeland
--0000000000008e484305e766f552--