[pbs-devel] [PATCH proxmox 4/5] access: factor out user config and cache handling

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Jun 12 14:49:35 CEST 2024


On Tue, Jun 11, 2024 at 04:30:25PM GMT, Shannon Sterz wrote:
> On Tue Jun 11, 2024 at 3:07 PM CEST, Wolfgang Bumiller wrote:
> > On Mon, Jun 10, 2024 at 05:42:13PM GMT, Shannon Sterz wrote:
> > > this commit factors out the user config as well as the shared memory
> > > based config version caching mechanism. this makes it necessary that
> > > users of this crate provide the product name and a reference to a
> > > shared memory location as well.
> >
> > Given that we have more values in the shared memory in PBS I wonder if
> > we should instead provide the `get` and `increment` methods to init
> > (directly as `fn` or via a trait).
> 
> yeah, that might make sense to hand that over via a trait and implement
> the actually shared memory portion either in the project itself or have
> a generic implementation that we can adapt to each project. not entirely
> sure what the best way is, though.
> 
> if we do implement some kind of generic shared memory cache generation
> counter, where would live ideal?

Depends on what it does.
As long as we only need simple counters, the crate could just expose
them as an array filling the allocated 4k with the users defining
indices for their counters. I doubt we'll need more than what we can fit
in there for now ;-)




More information about the pbs-devel mailing list