Alessandro Nardin Page for Google Summer of Code 2024

Google Summer of Code 2024 - Final Report

Project Summary

My project for the 2024 edition of Google Summer of Code was done in collaboration with the RTEMS Project. RTEMS (Real-Time Executive for Multiprocessor Systems) is a real-time operating system (RTOS) designed for embedded systems. (More information can be found on the Project Page)

The goal of my project was to improve the POSIX compliance of the OS, specifically by working on the Asynchronous Input/Output (AIO) interface. My objective was to correct behaviors that did not comply with POSIX specifications and to implement the missing features.

My Contributions

Overall, I’m satisfied with the work I managed to do this summer. Most of the work I planned has been successfully completed, although not everything has been merged. There was more work than I anticipated to implement missing features and correct issues in the existing functions. This, combined with an unexpected and hard-to-identify error, led to my inability to fully complete the work on lio_listio(). However, I plan to continue working even after this experience ends to finish everything I started.

Below, you’ll find a table summarizing all completed and planned contributions. After the table, there is a short description outlining the goal of each contribution. For more detailed information about each of them, you can refer to the blog posts linked in the table, which provide more insight and detail about the approach used for the solution and the difficulties encountered for each task.

Contribution Status Related MR Blog Posts
Review and merge existing patches Completed !40- !41- !42 link
Correct the behavior of aio_return() and aio_error() Completed !85 link
Add support for O_DSYNC in aio_fsync() Completed !128 link
Add notification at request completion Completed !118 link
Implement lio_listio() Work in Progress !188 -
Implement aio_suspend() Not started - -
Update documentation Completed !56- !26- !44 link

- Review and merge existing patches

This was my first contribution to the project. I began by reviewing patches provided by my mentor to determine if they were still relevant and should be merged. This task didn’t involve writing any code, except for correcting a few formatting errors. However, it was valuable in helping me learn the RTEMS project’s workflow and familiarize myself with the contribution submission process.

- Correct the behavior of aio_return() and aio_error()

The goal of this part of the project was to correct the behavior of aio_return() and aio_error(). The issue was that these functions could be called multiple times for the same operation. This behavior violated POSIX specifications and needed to be corrected.

- Add support for O_DSYNC in aio_fsync()

The objective here was to add missing functionality to the aio_fsync() function. According to the specification, one of the function’s parameters can accept two values that specify the type of synchronization to be performed. However, the function only accepted one of these values, so it was necessary to add support for the other.

- Add notification at request completion

One of the features missing from the implementation was the notification of request completion. One of the fields of the aiocb (Asynchronous Input/Output Control Block) is a sigevent struct, which must be used to generate a notification, as outlined by the POSIX specifications. This field was being ignored by the implementation, so my task was to add the code that utilized this field.

- Implement lio_listio()

The goal of this part was to implement the missing lio_listio() method. The work on this task is mostly complete. There’s still an error that must be fixed befor merging the changes.

- Implement aio_suspend()

The goal of this part was to implement the missing aio_suspend() method. However, I was unable to start this task because the work lio_listio() is taking longer than expected.

- Update documentation

This contribution covers all the merge requests I made to update the documentation, including both Doxygen comments and the RTEMS API Docs.

What I learned

This experience has been an invaluable learning opportunity for me. Prior to this summer, my coding experience was limited to school and university projects. This meant I had only worked on small codebases, often entirely written by me. As a result, I rarely used version control programs since the code was typically used for a short period and then discarded. My experience with debugging tools was also limited, as the simple nature of the code I worked on allowed me to rely on print statements to diagnose and solve any errors.

Working on the RTEMS project was a completely different experience. The large scale of the codebase challenged my existing knowledge. I had to refine my understanding of Git to manage my project fork effectively and submit my work for review. I also had to learn proper debugging techniques to resolve the errors I encountered. To ensure code quality, I learned how to write extensive tests and run coverage analysis to determine how much of the code was effectively tested (Dedicated Post about coverage). I had to overcome my bad coding habits and adhere to the RTEMS coding standards to ensure that the code I wrote was understandable to others.

I feel that my ability to read and understand code written by others, which I had rarely needed before, has greatly improved. When I started the application process, I couldn’t even grasp the various project proposals listed by the organization. Now, after reading the documentation and working with the code, I have a decent understanding of the project’s general structure. Even though my knowledge is primarily limited to the AIO interface, I can follow discussions by others and at least understand which part of the code is being affected.

Overall, this project has significantly enhanced my skills as a programmer, teaching me the importance of writing clean, maintainable code that can stand the test of time. I’ve gained experience in working on a large and collaborative project, which has pushed me to improve my technical abilities and my approach to collaboration. This summer has not only broadened my understanding of coding practices but has also prepared me to contribute more effectively to any future projects. I now feel more confident in my ability to tackle complex challenges and work within a professional codebase, skills that will certainly benefit me in the future.