You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Devin Leamy <dl...@x.com> on 2024/02/12 17:04:43 UTC
Review Request 74872: [cgroups2] Add mounting and unmounting of cgroup2 filesystem.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74872/
-----------------------------------------------------------
Review request for mesos.
Repository: mesos
Description
-------
Introduces:
- `cgroups2::mount()`: Mount a cgroup2 hierarchy.
- `cgroups2::mount_or_create()`: Mount a cgroup2 hierarchy or use an
existing hierarchy if one is available.
- `cgroups2::unmount()`: Unmount the cgroup2 hierarchy, if it was not
pre-existing.
- `cgroups2::cleanup()`: Unmount the cgroup2 hierarchy and cleanup
cgroups2. Does nothing if no hierarchy is mounted.
The mount point is stored in a global variable that is set and unset by
the `mount()`, `mountOrCreate()`, and `unmount()` methods.
Diffs
-----
src/linux/cgroups2.hpp PRE-CREATION
src/linux/cgroups2.cpp PRE-CREATION
Diff: https://reviews.apache.org/r/74872/diff/1/
Testing
-------
Thanks,
Devin Leamy
Re: Review Request 74872: [cgroups2] Add mounting and unmounting of cgroup2 filesystem.
Posted by Devin Leamy <dl...@x.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74872/
-----------------------------------------------------------
(Updated Feb. 26, 2024, 8:59 p.m.)
Review request for mesos.
Repository: mesos
Description (updated)
-------
Introduces:
- `cgroups2::mount()`: Mount a cgroup2 hierarchy.
- `cgroups2::find_mount()`: Find an existing cgroup2 hierarchy.
- `cgroups2::unmount()`: Unmount the cgroup2 hierarchy, if it was not
pre-existing.
- `cgroups2::cleanup()`: Unmount the cgroup2 hierarchy and cleanup
cgroups2. Does nothing if no hierarchy is mounted.
The mount point is stored in a global variable that is set and unset by
the `mount()` and `unmount()` methods.
Diffs (updated)
-----
src/linux/cgroups2.hpp 833960d301335541f0bb7ad5c0e05e7222d7bc06
src/linux/cgroups2.cpp 6beb8dd2c43f548dd86be16e828b4abfe6fa3fd3
Diff: https://reviews.apache.org/r/74872/diff/2/
Changes: https://reviews.apache.org/r/74872/diff/1-2/
Testing
-------
Thanks,
Devin Leamy
Re: Review Request 74872: [cgroups2] Add mounting and unmounting of cgroup2 filesystem.
Posted by Devin Leamy <dl...@x.com>.
> On Feb. 20, 2024, 4:25 a.m., Benjamin Mahler wrote:
> > src/linux/cgroups2.hpp
> > Lines 33-41 (patched)
> > <https://reviews.apache.org/r/74872/diff/1/?file=2285172#file2285172line33>
> >
> > The terminology here is a bit confusing: mount_or_create seems to actually be semantically something like get_or_mount or mount_if_absent.
> >
> > In terms of api design, it's a bit unfortunate that the only two options provided are to mount, or to mount if absent. I would have expected a way for the caller to be able to do a read-only lookup too, e.g.
> >
> > ```
> > Try<string> find_mount();
> > Try<Nothing> mount(string path);
> > ```
> >
> > With only these two functions the caller can still accomplish mount_if_absent themselves, but they can also do a read-only locating of the mount if you only want to detect and use the existing one on the system.
I like this idea. More composable. Updated.
- Devin
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74872/#review226223
-----------------------------------------------------------
On Feb. 12, 2024, 5:04 p.m., Devin Leamy wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74872/
> -----------------------------------------------------------
>
> (Updated Feb. 12, 2024, 5:04 p.m.)
>
>
> Review request for mesos.
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Introduces:
> - `cgroups2::mount()`: Mount a cgroup2 hierarchy.
> - `cgroups2::mount_or_create()`: Mount a cgroup2 hierarchy or use an
> existing hierarchy if one is available.
> - `cgroups2::unmount()`: Unmount the cgroup2 hierarchy, if it was not
> pre-existing.
> - `cgroups2::cleanup()`: Unmount the cgroup2 hierarchy and cleanup
> cgroups2. Does nothing if no hierarchy is mounted.
>
> The mount point is stored in a global variable that is set and unset by
> the `mount()`, `mountOrCreate()`, and `unmount()` methods.
>
>
> Diffs
> -----
>
> src/linux/cgroups2.hpp PRE-CREATION
> src/linux/cgroups2.cpp PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/74872/diff/1/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Devin Leamy
>
>
Re: Review Request 74872: [cgroups2] Add mounting and unmounting of cgroup2 filesystem.
Posted by Benjamin Mahler <bm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74872/#review226223
-----------------------------------------------------------
src/linux/cgroups2.hpp
Lines 33-41 (patched)
<https://reviews.apache.org/r/74872/#comment314469>
The terminology here is a bit confusing: mount_or_create seems to actually be semantically something like get_or_mount or mount_if_absent.
In terms of api design, it's a bit unfortunate that the only two options provided are to mount, or to mount if absent. I would have expected a way for the caller to be able to do a read-only lookup too, e.g.
```
Try<string> find_mount();
Try<Nothing> mount(string path);
```
With only these two functions the caller can still accomplish mount_if_absent themselves, but they can also do a read-only locating of the mount if you only want to detect and use the existing one on the system.
- Benjamin Mahler
On Feb. 12, 2024, 5:04 p.m., Devin Leamy wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74872/
> -----------------------------------------------------------
>
> (Updated Feb. 12, 2024, 5:04 p.m.)
>
>
> Review request for mesos.
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Introduces:
> - `cgroups2::mount()`: Mount a cgroup2 hierarchy.
> - `cgroups2::mount_or_create()`: Mount a cgroup2 hierarchy or use an
> existing hierarchy if one is available.
> - `cgroups2::unmount()`: Unmount the cgroup2 hierarchy, if it was not
> pre-existing.
> - `cgroups2::cleanup()`: Unmount the cgroup2 hierarchy and cleanup
> cgroups2. Does nothing if no hierarchy is mounted.
>
> The mount point is stored in a global variable that is set and unset by
> the `mount()`, `mountOrCreate()`, and `unmount()` methods.
>
>
> Diffs
> -----
>
> src/linux/cgroups2.hpp PRE-CREATION
> src/linux/cgroups2.cpp PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/74872/diff/1/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Devin Leamy
>
>