[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150106230050.GA6870@casper.infradead.org>
Date: Tue, 6 Jan 2015 23:00:50 +0000
From: Thomas Graf <tgraf@...g.ch>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, herbert@...dor.apana.org.au,
paulmck@...ux.vnet.ibm.com, edumazet@...gle.com,
john.r.fastabend@...el.com, josh@...htriplett.org
Subject: Re: [RFC] netlink: get rid of nl_table_lock
On 01/03/15 at 11:02am, Stephen Hemminger wrote:
> As a follow on to Thomas's patch I think this would complete the
> transistion to RCU for netlink.
> Compile tested only.
>
>
>
> This patch gets rid of the reader/writer nl_table_lock and replaces it
> with exclusively using RCU for reading, and a mutex for writing.
>
> Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>
I like it. One thing I noticed it that it leaves a mix of
native mutex unlocks and unlocks via netlink_table_ungrab().
The Open vSwitch upcall is a pretty good real world Netlink
benchmark. I'll run the tests I have to see if this has any
unexpected side effects.
> void netlink_table_grab(void)
> - __acquires(nl_table_lock)
> {
> - might_sleep();
> -
> - write_lock_irq(&nl_table_lock);
> -
> - if (atomic_read(&nl_table_users)) {
> - DECLARE_WAITQUEUE(wait, current);
> -
> - add_wait_queue_exclusive(&nl_table_wait, &wait);
> - for (;;) {
> - set_current_state(TASK_UNINTERRUPTIBLE);
> - if (atomic_read(&nl_table_users) == 0)
> - break;
> - write_unlock_irq(&nl_table_lock);
> - schedule();
> - write_lock_irq(&nl_table_lock);
> - }
> -
> - __set_current_state(TASK_RUNNING);
> - remove_wait_queue(&nl_table_wait, &wait);
> - }
> + mutex_lock(&nl_table_mutex);
> }
I left this untouched so far as I wasn't clear on what side effect
it would have to remove this as it does explicitely relax writers
right now.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists