Subject: Re: Why does connector use a work queue???

From: [email-masked] (Eric W. Biederman)
Date: Sun, 28 Feb 2010 12:10:35 -0800

Evgeniy Polyakov <[email-masked]> writes:

> On Sat, Feb 27, 2010 at 06:57:02PM -0800, Eric W. Biederman ([email-masked]) wrote:
>> These days netlink callbacks for messages happen in the context of the
>> process who sent the message.  Things like permission checks are much
>> more complicated if we don't use that process context.
>> 
>> I was looking at removing NETLINK_CB(skb).eff_cap but I discovered
>> that connected takes the netlink messages, them from their
>> perfectly good process context, and puts the into a workqueue
>> for reasons that are not apparent to me.
>
> Netlink was made synchronous rather recently and connector was not
> changed to take advantage of that. Previously it used work queue to
> postpone work processing into always-process context.

I suspected it was something like that but I want to be certain.

>> Unless I am misreading something we should just be able to remove the
>> work queues and greatly simplify the connector code.
>> 
>> Something like:
>
> Idea looks very good, thank you, but it misses structure changes
> to eliminate now unneded members.

Right. I didn't trust myself to write a patch that would rip out half
of the connector code until I understood what the constraints were.

Eric