From: Ying Xue <ying.xue@windriver.com>
To: Thomas Graf <tgraf@suug.ch>
Cc: jon.maloy@ericsson.com, netdev@vger.kernel.org,
Paul.Gortmaker@windriver.com,
tipc-discussion@lists.sourceforge.net, davem@davemloft.net
Subject: Re: [PATCH net-next 3/5] rhashtable: use future table size to make expansion decision
Date: Tue, 6 Jan 2015 17:56:23 +0800 [thread overview]
Message-ID: <54ABB147.6020904@windriver.com> (raw)
In-Reply-To: <20150106093557.GC12468@casper.infradead.org>
On 01/06/2015 05:35 PM, Thomas Graf wrote:
> On 01/06/15 at 03:23pm, Ying Xue wrote:
>> Should use future table size instead of old table size to decide
>> whether hash table is worth being expanded.
>>
>> Signed-off-by: Ying Xue <ying.xue@windriver.com>
>> Cc: Thomas Graf <tgraf@suug.ch>
>> ---
>> lib/rhashtable.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> Apologies as you were probably mislead by the bug as commented
> on in the previous patch.
>
> I don't think we need this. future_tbl only points to a different
> table until the old table entries are linked from the new table.
> The condition in the resize check where meant to exclude this
> phase so we would newer get to the deferred worker while relinking
> is happening.
>
>
Thank you for above nice explanation. Regarding my understanding, as
rhashtable_expand() and rhashtable_shrink() are always under the
protection of "ht->mutex", the "future_tbl" and "tbl" absolutely point
to the same bucket array once rhashtable_expand() or rhashtable_shrink()
returns. Therefore, if rht_deferred_worker() takes the "ht->mutex" lock,
the both "future_tbl" and "tbl" should point to the same bucket array.
So the change made in the patch is useless for us, right?
But as you pointed in above patch, there is a bug in
rhashtable_wakeup_worker(). As long as ht->tbl == ht->future_tbl, we
should wake up the work. OK, I will drop the patch and fix the error in
patch #2.
In all, thank you for quickly reviewing the series, and I would deliver
the next version soon in which your all comments would be resolved.
Please wait a moment.
Regards,
Ying
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
next prev parent reply other threads:[~2015-01-06 9:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-06 7:23 [PATCH net-next 0/5] Involve rhashtable_lookup_insert routine Ying Xue
2015-01-06 7:23 ` [PATCH net-next 1/5] rhashtable: optimize rhashtable_lookup routine Ying Xue
2015-01-06 9:13 ` Thomas Graf
2015-01-06 7:23 ` [PATCH net-next 2/5] rhashtable: introduce rhashtable_wakeup_worker helper function Ying Xue
2015-01-06 9:29 ` Thomas Graf
2015-01-06 7:23 ` [PATCH net-next 3/5] rhashtable: use future table size to make expansion decision Ying Xue
2015-01-06 9:35 ` Thomas Graf
2015-01-06 9:56 ` Ying Xue [this message]
2015-01-06 10:06 ` Thomas Graf
2015-01-06 7:23 ` [PATCH net-next 4/5] rhashtable: involve rhashtable_lookup_insert routine Ying Xue
2015-01-06 9:41 ` Thomas Graf
2015-01-06 7:23 ` [PATCH net-next 5/5] tipc: convert tipc reference table to use generic rhashtable Ying Xue
2015-01-06 9:42 ` 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=54ABB147.6020904@windriver.com \
--to=ying.xue@windriver.com \
--cc=Paul.Gortmaker@windriver.com \
--cc=davem@davemloft.net \
--cc=jon.maloy@ericsson.com \
--cc=netdev@vger.kernel.org \
--cc=tgraf@suug.ch \
--cc=tipc-discussion@lists.sourceforge.net \
/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).