On a higher level, I think the scanning of the run list to set flags and
counters is a bit off. If these things need to be counted and kept
track of, the tasks should be doing it "in the moment" not some other
task at some distant time. For example if what is being protected is a
data structure, a counter could be put in the structure that keeps track
of the number of tasks that are interested in seeing it stay around. As
I understand the objective of the method being explored, a writer wants
to change the structure, but old readers can continue to use the old
while new readers get the new structure. The issue then is when to
"garbage collect" the no longer used structures. It seems to me that
the pointer to the structure can be changed to point to the new one when
the writer has it set up. Old users continue to use the old. When they
are done, they decrement the use count. When the use count goes to
zero, it is time to "garbage collect". At this time, the "garbage man"
is called (one simple one would be to check if the structure is still
the one a "new" task would get). Various methods exist for determing
how and if the "garbage man" should be called, but this sort of thing,
IMNSHO, does NOT belong in schedule().
George
-
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/