Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fsal api has changed quite a bit and documentation is seriously lacking #1098

Open
drieber opened this issue Mar 15, 2024 · 6 comments
Open

Comments

@drieber
Copy link
Contributor

drieber commented Mar 15, 2024

Late 2023 we discovered the fsal API had changed, and when we looked at fsals that ship with ganesha we found all of them were using many of the facilities in src/include/FSAL/fsal_commonlib.h:

  • fsal_start_io
  • fsal_start_global_io
  • fsal_complete_io
  • fsal_start_fd_work
  • fsal_complete_fd_work
  • insert_fd_lru
  • merge_share
  • fsal_close_fd
  • fsal_reopen_fd
  • close_fsal_fd
  • check_share_conflict
  • check_share_conflict_and_update
  • update_share_counters
  • Also the fsal_obj_handle::obj_lock

Most of those functions do not have any documentation. It is really really hard to understand exactly how those APIs should be used. I cannot overemphasize enough how this hurts our nfs-ganesha adoption plans in my team at Google.

@drieber
Copy link
Contributor Author

drieber commented Apr 15, 2024

Is there any chance to prioritize this? As a FSAL author it is nearly impossible to figure out what to do.
Thanks!

@dang
Copy link
Contributor

dang commented Apr 16, 2024

Most or all of those functions are doxygen documented in fsal/commonlib.c. Basically all of our API-level documentation is done via doxygen comments on the function's implementation.

@drieber
Copy link
Contributor Author

drieber commented Apr 16, 2024

I am mostly concerned about these:

  • fsal_start_io
  • fsal_start_global_io
  • fsal_complete_io
  • fsal_start_fd_work
  • fsal_complete_fd_work
  • insert_fd_lru
  • Also the fsal_obj_handle::obj_lock

All fsals that ship with ganesha call most of these, so it appears to me this is definitely part of the FSAL api. It would greatly help to have a doc or comments on the header file or whatever that describes global file descriptors, and FD lru. How is this used? What is the policy? Etc.

@ffilz
Copy link
Member

ffilz commented Apr 16, 2024

There is some in code documentation on those in commonlib.c.

I can try and find some time to improve the documentation of all of that...

@drieber
Copy link
Contributor Author

drieber commented Apr 24, 2024

Perhaps the most useful thing would be one or two pages on what those functions are about, and not necessarily a bunch of comments on each of the functions (although that would also be super useful).

What is this "fd lru" thing?
What is bump fd lru for?
In fact, what IS an fd?
How do I configure fd lru in ganesha config?
etc.....

Please keen in mind developers that write their own FSAL.

@ffilz
Copy link
Member

ffilz commented Apr 24, 2024

I'm working on, and will submit tomorrow, a patch that adds more description about fsal_fd and the API with the definition of struct fsal_fd.

As to how to configure, we don't really have much suggestion for that, but I will document the mdcache parameters that are passed onto the fd_lru.

The most important ones are the FD_Limit_Percent, FD_HWMark_Percent, and FD_LWMark_Percent that govern the size of the fd_lru based on a percentage of the process RLIMIT_NOFILE (ulimit -n)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants