From: Thomas Graf <tgraf@suug.ch>
To: Ying Xue <ying.xue@windriver.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v2] rhashtable: involve rhashtable_lookup_insert routine
Date: Mon, 5 Jan 2015 13:05:14 +0000 [thread overview]
Message-ID: <20150105130514.GA15499@casper.infradead.org> (raw)
In-Reply-To: <1420457634-13017-1-git-send-email-ying.xue@windriver.com>
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@windriver.com>
> Signed-off-by: Thomas Graf <tgraf@suug.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.
I see some further optimization potential when we need to calculate
the hash for both the old and new table. We can introduce a new
function which provides both based on a single hash iteration.
However, we should do that in a separate patch.
next prev parent reply other threads:[~2015-01-05 13:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-05 11:33 [PATCH net-next v2] rhashtable: involve rhashtable_lookup_insert routine Ying Xue
2015-01-05 13:05 ` Thomas Graf [this message]
2015-01-05 21:30 ` David Miller
2015-01-05 21:52 ` Thomas Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150105130514.GA15499@casper.infradead.org \
--to=tgraf@suug.ch \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=ying.xue@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).