[PATCH v5 2/4] eal: allow applications to report their cpu usage

Konstantin Ananyev konstantin.ananyev at huawei.com
Mon Feb 6 21:34:59 CET 2023



> -----Original Message-----
> From: Robin Jarry <rjarry at redhat.com>
> Sent: Monday, February 6, 2023 8:29 PM
> To: Konstantin Ananyev <konstantin.ananyev at huawei.com>; dev at dpdk.org
> Cc: Tyler Retzlaff <roretzla at linux.microsoft.com>; Kevin Laatz <kevin.laatz at intel.com>; Morten Brørup
> <mb at smartsharesystems.com>
> Subject: Re: [PATCH v5 2/4] eal: allow applications to report their cpu usage
> 
> Konstantin Ananyev, Feb 06, 2023 at 21:07:
> > Problem is not in resetting cb function itself.
> >
> > Usually with CB user needs some sort of data structure (to accumulate
> > stats, track states, etc.). If we allow to reset the CB, then it
> > arises the question when/how should we allow user to free associated
> > data?
> >
> > And, as I undersand, we don't have a clear way to do it.
> 
> If the application decides to reset the callback function, they are in
> a good position to determine what resources they need to free.

Yes, app knows what resources it wants to free.
But it has no way to know *when* it is safe to free them.
Just a bit more explanation:
App invokes your function which resets global value of CB.
How would it know that after return from this function none
other thread still not executing this CB right now?
And how determine when this thread will finish with executing CB function?
That's why it might be easier simply not allow to reset it at all....

> I don't
> see why EAL should get involved here but I may be missing a point.



More information about the dev mailing list