On Wed, Oct 28, 2009 at 06:55:32PM -0700, Roland McGrath wrote: > Please take a look at the patch below and tell me what you think. This > is the new(ish) utrace-indirect branch (not to be confused with what's > now old/utrace-indirect). I first made it a while ago, but I don't > recall if I ever mentioned it. This compiles and looks right, but I > have not done any testing at all. > > Unlike the old code that freaked upstream reviewers all the way out, > this has very simple lifetime rules for struct utrace. Once allocated, > it lives until task_struct is freed. The utrace_task_alloc() logic > covers the only race (at first attach), and that seems pretty easy > to understand and be confident in.
First glance, this looks much simpler and easier to understand compared to the earlier rcu implementation. ... > + if (!utrace) { > + if (unlikely(!utrace_task_alloc(target))) > + return ERR_PTR(-ENOMEM); > + utrace = target->utrace; utrace = task_utrace_struct(target); > + } > + > engine = kmem_cache_alloc(utrace_engine_cachep, GFP_KERNEL); > if (unlikely(!engine)) > return ERR_PTR(-ENOMEM); Ananth