> -----Original Message-----
> From: Robin Jarry <rja...@redhat.com>
> Sent: Monday, February 6, 2023 8:29 PM
> To: Konstantin Ananyev <konstantin.anan...@huawei.com>; dev@dpdk.org
> Cc: Tyler Retzlaff <roret...@linux.microsoft.com>; Kevin Laatz 
> <kevin.la...@intel.com>; Morten Brørup
> <m...@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.

Reply via email to