lkml.org 
[lkml]   [2005]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] CKRM: 3/10 CKRM: Core ckrm, rcfs
On Thu, Feb 24, 2005 at 01:30:10PM -0800, Gerrit Huizenga wrote:
> > >
> > > The classification engines can be loadable modules.
> >
> > Then you have a race condition in the above code that needs to be fixed.
> > And no, using an atomic_t is not the solution.
>
> Why not? This simply gives an EBUSY if someone tries to load multiple
> classification engines in parallel - one wins, one loses. I'm not sure
> if there is a higher level mutex on module loading that might even prevent
> this race although I wouldn't be surprised if there were. If there is,
> I think this code might be removable. If there isn't, it provides a
> first-one-wins approach.
>
> Hmm. Oh, partial answer to my own question... I think in theory you
> could have a classification engine compiled into the kernel and another
> one built as a module. But no, you still wouldn't have a race like this.
> All built-in CE's would be executed linearly, only module loads could
> potentially race.
>
> Chandra, do you know if this is the only race this is protecting against?
> It is the only one I see at the moment.

We want to have only one CE active at any point of time, for that we need
to have some internal variable. using atomic helps us get that along with
protecting against a very unlikely race condition.

>
> gerrit

--

----------------------------------------------------------------------
Chandra Seetharaman | Be careful what you choose....
- sekharan@us.ibm.com | .......you may get it.
----------------------------------------------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:10    [W:0.061 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site