]> git.baikalelectronics.ru Git - kernel.git/commit
rhashtable: Schedule async resize when sync realloc fails
authorThomas Graf <tgraf@suug.ch>
Wed, 22 Apr 2015 07:41:45 +0000 (09:41 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Apr 2015 18:17:22 +0000 (14:17 -0400)
commit8dbbc15c0b21b06ef989e684f612b40c3539f742
tree85280146bb297aaf40b4f921f0a1983fe01fe80d
parente0454b507e4382e4f63cb4d3c136cacff59a0d17
rhashtable: Schedule async resize when sync realloc fails

When rhashtable_insert_rehash() fails with ENOMEM, this indicates that
we can't allocate the necessary memory in the current context but the
limits as set by the user would still allow to grow.

Thus attempt an async resize in the background where we can allocate
using GFP_KERNEL which is more likely to succeed. The insertion itself
will still fail to indicate pressure.

This fixes a bug where the table would never continue growing once the
utilization is above 100%.

Fixes: 43719bf4351e ("rhashtable: Add immediate rehash during insertion")
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/rhashtable.c