From: Bagas Sanjaya <bagasdotme@gmail.com>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
linux-kernel@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org, maple-tree@lists.infradead.org
Subject: Re: [PATCH v2 2/5] rosebush: Add new data structure
Date: Tue, 2 Jul 2024 08:04:13 +0700 [thread overview]
Message-ID: <ZoNSDQfohcDHAcU9@archie.me> (raw)
In-Reply-To: <20240625211803.2750563-3-willy@infradead.org>
[-- Attachment #1: Type: text/plain, Size: 2299 bytes --]
On Tue, Jun 25, 2024 at 10:17:57PM +0100, Matthew Wilcox (Oracle) wrote:
> Rosebush is a resizing hash table. See
> Docuemntation/core-api/rosebush.rst for details.
What about "Document Rosebush hash table - overview, implementation details/internals, and API
docs"?
> +Overview
> +========
> +
> +Rosebush is a hashtable, different from the rhashtable. It is scalable
> +(one spinlock per bucket), resizing in two dimensions (number and size
> +of buckets), and concurrent (can be iterated under the RCU read lock).
> +It is designed to minimise dependent cache misses, which can stall a
> +modern CPU for thousands of instructions.
> +
> +Objects stored in a rosebush do not have an embedded linked list.
> +They can therefore be placed into the same rosebush multiple times and
> +be placed in multiple rosebushes. It is also possible to store pointers
> +which have special meaning like ERR_PTR(). It is not possible to store
> +a NULL pointer in a rosebush, as this is the return value that indicates
"..., however, as this ..."
> +the iteration has finished.
> +
> +The user of the rosebush is responsible for calculating their own hash.
> +A high quality hash is desirable to keep the scalable properties of
> +the rosebush, but a hash with poor distribution in the lower bits will
> +not lead to a catastrophic breakdown. It may lead to excessive memory
"..., but rather it may lead to ..."
What does catastrophic breakdown mean anyway?
> +consumption and a lot of CPU time spent during lookup.
> +
> +Rosebush is not yet IRQ or BH safe. It can be iterated in interrupt
"This means that ..."
> +context, but not modified.
> +
> <snipped>...
> +IRQ / BH safety
> +---------------
> +
> +If we decide to make the rosebush modifiable in IRQ context, we need
> +to take the locks in an irq-safe way; we need to figure out how to
> +allocate the top level table without vmalloc(), and we need to manage
> +without kvfree_rcu_mightsleep(). These all have solutions, but those
> +solutions have a cost that isn't worth paying until we have users.
Use cases?
Thanks.
--
An old man doll... just what I always wanted! - Clara
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2024-07-02 1:04 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-25 21:17 [PATCH v2 0/5] Rosebush, a new hash table Matthew Wilcox (Oracle)
2024-06-25 21:17 ` [PATCH v2 1/5] tools: Add kernel stubs needed for rosebush Matthew Wilcox (Oracle)
2024-06-25 21:17 ` [PATCH v2 2/5] rosebush: Add new data structure Matthew Wilcox (Oracle)
2024-06-25 23:36 ` Dr. David Alan Gilbert
2024-06-26 13:16 ` Matthew Wilcox
2024-06-26 13:07 ` Matthew Wilcox
2024-06-29 19:45 ` Markus Elfring
2024-07-01 1:32 ` Matthew Wilcox
2024-07-01 5:21 ` [v2 " Markus Elfring
2024-07-01 14:18 ` Paul E. McKenney
2024-07-02 1:04 ` Bagas Sanjaya [this message]
2024-06-25 21:17 ` [PATCH v2 3/5] rosebush: Add test suite Matthew Wilcox (Oracle)
2024-06-28 15:18 ` Pankaj Raghav (Samsung)
2024-06-29 5:13 ` Jeff Johnson
2024-06-25 21:17 ` [PATCH v2 4/5] tools: Add support for running rosebush tests in userspace Matthew Wilcox (Oracle)
2024-06-29 5:15 ` Jeff Johnson
2024-06-25 21:18 ` [PATCH v2 5/5] dcache: Convert to use rosebush Matthew Wilcox (Oracle)
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=ZoNSDQfohcDHAcU9@archie.me \
--to=bagasdotme@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maple-tree@lists.infradead.org \
--cc=willy@infradead.org \
/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