[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150105215237.GC31637@casper.infradead.org>
Date: Mon, 5 Jan 2015 21:52:37 +0000
From: Thomas Graf <tgraf@...g.ch>
To: David Miller <davem@...emloft.net>
Cc: ying.xue@...driver.com, netdev@...r.kernel.org
Subject: Re: [PATCH net-next v2] rhashtable: involve rhashtable_lookup_insert
routine
On 01/05/15 at 04:30pm, David Miller wrote:
> From: Thomas Graf <tgraf@...g.ch>
> Date: Mon, 5 Jan 2015 13:05:14 +0000
>
> > On 01/05/15 at 07:33pm, Ying Xue wrote:
> >> Involve a new function called rhashtable_lookup_insert() which makes
> >> lookup and insertion atomic under bucket lock protection, helping us
> >> avoid to introduce an extra lock when we search and insert an object
> >> into hash table.
> >>
> >> Signed-off-by: Ying Xue <ying.xue@...driver.com>
> >> Signed-off-by: Thomas Graf <tgraf@...g.ch>
> >
> > Thanks for putting this around so quickly and thanks for testing.
> > I think this looks good. You might be able to factor out some code
> > from rhashtable_insert() to avoid duplication so we reduce the risk
> > of fixing a bug for one function but not the other.
>
> Do you want Ying to do this factoring out now in a v3 of this patch
> or in a subsequent patch?
>
> I assume the former since you didn't give your ACK.
Ying,
I prefer it now if you don't mind. Basically I would like to see the
grow decision factored out at least:
/* Only grow the table if no resizing is currently in progress. */
if (ht->tbl != ht->future_tbl &&
ht->p.grow_decision && ht->p.grow_decision(ht, tbl->size))
schedule_delayed_work(&ht->run_work, 0);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists