From: Akinobu Mita <akinobu.mita@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org
Subject: Re: [POC] recoverable fault injection
Date: Thu, 22 Nov 2012 20:40:31 +0900 [thread overview]
Message-ID: <CAC5umyibe0tb+HLxx3dbT7gF_nVAAHso1Y0Qb4Q_+y0KNrnvFg@mail.gmail.com> (raw)
In-Reply-To: <1353541455.20173.10.camel@jlt4.sipsolutions.net>
2012/11/22 Johannes Berg <johannes@sipsolutions.net>:
> This idea has been floating around in my head for a long time now ...
>
> I was thinking: what if we could do fault injection during regular
> testing, at least on those code paths that are not supposed to have side
> effects when they fail? Now obviously this isn't all code paths, and
> many probably erroneously *do* have side effects even if they're not
> supposed to, but it does apply to a number of code paths.
It sounds interesting. I have never thought of this idea.
> So I decided to play with this, and the result it the patch below. It
> adds a new knob "recoverable-only" to the slab and page_alloc fault
> attributes. If enabled, then a single fault can be injected if the task
> executing it is in a "recoverable section", this is implemented by some
> new fields in struct task_struct and the (very ugly!) macro
> FAULT_INJECT_CALL_RECOVERABLE_FUNCTION.
I suggest introducing a pair of function like:
void fault_recoverable_enable(unsigned long fault_ids);
void fault_recoverable_disable();
fault_recoverable_enable() sets current task's recoverable state to the
value specified with the argument. fault_recoverable_disable() resets
the recoverable state.
I think this can be more readable than FAULT_INJECT_CALL_RECOVERABLE_FUNCTION
macro. In case of nl80211_remain_on_channel(), you can just put
them in exit and entrance:
fault_recoverable_enable(FAULT_ATTR_SLAB | FAULT_ATTR_PAGE_ALLOC);
...
fault_recoverable_disable();
return err;
next prev parent reply other threads:[~2012-11-22 18:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-21 23:44 [POC] recoverable fault injection Johannes Berg
2012-11-22 11:40 ` Akinobu Mita [this message]
2012-11-22 11:52 ` Johannes Berg
2012-11-22 13:29 ` Akinobu Mita
2012-11-22 13:41 ` Johannes Berg
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=CAC5umyibe0tb+HLxx3dbT7gF_nVAAHso1Y0Qb4Q_+y0KNrnvFg@mail.gmail.com \
--to=akinobu.mita@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).