All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rehas Sachdeva <aquannie@gmail.com>
To: outreachy-kernel@googlegroups.com
Cc: mawilcox@microsoft.com, riel@surriel.com
Subject: [TASKS] Report for project: radix tree test suite
Date: Tue, 18 Oct 2016 00:18:19 +0530	[thread overview]
Message-ID: <20161017184819.GA4830@toblerone> (raw)

Here is what I read about Kernel radix trees:

There are two implementations.
One is in <include/linux/idr.h> and <lib/idr.c>, the other in
<include/linux/radix-tree.h> and <lib/radix-tree.c>. Both provide a mapping
from a number (unsigned long) to an arbitrary pointer (void *), though
radix-tree also allows up to two "tags" to be stored with each entry.

At each level, starting from most significant 6 bits at the root, we use the
next 6 bits of the key to choose the slot at that node. At the last level, we
have the desired value (user pointer), otherwise we have a pointer to a next
level node.

I took a look at the implementation of insert, delete, lookup, preload and
tag processing functions.

Radix tree is used for checking presence of pages in cache, finding pages with
dirty/ under writeback tag etc, many places where we want resizable arrays like
drivers, example NVM Express, File Systems like NFS, interrupt controllers.

Project: radix tree test suite

The Radix Tree Test Suite was first merged into Linux 4.6. It can be enhanced
in the following ways:
(From the project introduction)
-Providing test coverage by adding missing tests. We can use tools like gcov
for this.
-Adding performance measures.
-Make it share common test infrastructure, macros, for example using
tools/include.

I looked at many patches, about tests for insertion and lookup, tests for
multiorder entries, about using common kernel macros, to allow option for less
testing time, or ad-hoc tests for corner cases and benchmark test for iterators.
I think they are a good starting point to learn about what is expected from this
project.

Some more thoughts:
-Running tests in parallel (I did see single_thread_tests for regression tests)
-I could also look at other types of tests, performance benchmarks in other
parts of the kernel, used for other data structures and see if we can
incorporate them/similar ones into radix tree test suite.
-If IDR is re-written on Radix tree core, we might need test suite to be part
generic to both, and part specific.

Timeline for project - radix tree test suite:
- Get a deeper understanding of Radix tree implementation, clear any doubts about it.(1 week)
- Try gcov, and look for other ways/scripts to identify corner cases or functions that need coverage, Add missing tests identified. (2-3 weeks)
- Use more common, generic kernel code instead of specific, example from tools/include. (1-2 weeks)
- Add performance/Benchmark tests based on memory, time usage etc. (1-2 weeks)
- Document the changes. Any other cleanups/refactoring/modifications required to radix_tree or test suite. (1-2 weeks).
- Buffer time for unexpected delays, or necessary work unidentified in the beginning. (1-2 weeks).


                 reply	other threads:[~2016-10-17 18:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20161017184819.GA4830@toblerone \
    --to=aquannie@gmail.com \
    --cc=mawilcox@microsoft.com \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=riel@surriel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.