Messages in this thread | | | Date | Tue, 26 May 2009 14:39:27 -0700 | Subject | Re: [PATCH] cls_cgroup: read classid atomically in classifier | From | Paul Menage <> |
| |
On Tue, May 26, 2009 at 2:04 PM, Andrew Morton <akpm@linux-foundation.org> wrote: > On Tue, 26 May 2009 12:59:11 -0700 > Paul Menage <menage@google.com> wrote: > >> Avoid reading the unsynchronized value cs->classid multiple times, >> since it could change concurrently from non-zero to zero; this would >> result in the classifier returning a positive result with a bogus >> (zero) classid. > > When this race occurs, what are the user-visible consequences?
My guess is very little - rather than returning -1 to indicate that there's no classid associated with the flow, we're returning a positive response that the classid is 0. I don't know the network scheduling code well enough to predict what effect that would have, but I'd guess it results in the subsequent classid->queue lookup failing and the packet being shunted down some default queue (unless the user happens to have set up a queue with id 0). But the race looks to be against the intent of the code, which is to return -1 if the classid is 0, or fill in the res struct if it's non-zero.
> > People who need to decide to which kernels a patch should be applied > like to know such things. >
I don't think this is a -stable candidate.
Paul
| |