Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1611388

Re: [PATCH v2] fault-inject: support systematic fault injection

From Andrew Morton <akpm@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2] fault-inject: support systematic fault injection
Date 2017-03-28 23:50 +0200
Message-ID <tq7a2-5nl-19@gated-at.bofh.it> (permalink)
References <tpZ2O-83l-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 28 Mar 2017 15:01:28 +0200 Dmitry Vyukov <dvyukov@google.com> wrote:

> Add /proc/self/task/<current-tid>/fail-nth file that allows failing
> 0-th, 1-st, 2-nd and so on calls systematically.
> Excerpt from the added documentation:
> 
> ===
> Write to this file of integer N makes N-th call in the current task fail
> (N is 0-based). Read from this file returns a single char 'Y' or 'N'
> that says if the fault setup with a previous write to this file was
> injected or not, and disables the fault if it wasn't yet injected.
> Note that this file enables all types of faults (slab, futex, etc).
> This setting takes precedence over all other generic settings like
> probability, interval, times, etc. But per-capability settings
> (e.g. fail_futex/ignore-private) take precedence over it.
> This feature is intended for systematic testing of faults in a single
> system call. See an example below.
> ===
> 
> Why adding new setting:
> 1. Existing settings are global rather than per-task.
>    So parallel testing is not possible.
> 2. attr->interval is close but it depends on attr->count
>    which is non reset to 0, so interval does not work as expected.
> 3. Trying to model this with existing settings requires manipulations
>    of all of probability, interval, times, space, task-filter and
>    unexposed count and per-task make-it-fail files.
> 4. Existing settings are per-failure-type, and the set of failure
>    types is potentially expanding.
> 5. make-it-fail can't be changed by unprivileged user and aggressive
>    stress testing better be done from an unprivileged user.
>    Similarly, this would require opening the debugfs files to the
>    unprivileged user, as he would need to reopen at least times file
>    (not possible to pre-open before dropping privs).
> 
> The proposed interface solves all of the above (see the example).

Seems reasonable.

> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -1897,6 +1897,7 @@ struct task_struct {
>  #endif
>  #ifdef CONFIG_FAULT_INJECTION
>  	int make_it_fail;
> +	int fail_nth;
>  #endif

Nit: fail_nth should really be unsigned.  And make_it_fail could be
made a single bit which shares storage with brk_randomized (for
example).

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2] fault-inject: support systematic fault injection Dmitry Vyukov <dvyukov@google.com> - 2017-03-28 15:10 +0200
  Re: [PATCH v2] fault-inject: support systematic fault injection Andrew Morton <akpm@linux-foundation.org> - 2017-03-28 23:50 +0200
  Re: [PATCH v2] fault-inject: support systematic fault injection Akinobu Mita <akinobu.mita@gmail.com> - 2017-03-29 01:50 +0200
  Re: [PATCH v2] fault-inject: support systematic fault injection Andrew Morton <akpm@linux-foundation.org> - 2017-03-31 01:10 +0200
  Re: [PATCH v2] fault-inject: support systematic fault injection Akinobu Mita <akinobu.mita@gmail.com> - 2017-04-04 17:00 +0200
  Re: [PATCH v2] fault-inject: support systematic fault injection Michal Hocko <mhocko@kernel.org> - 2017-04-06 20:40 +0200
    Re: [PATCH v2] fault-inject: support systematic fault injection Akinobu Mita <akinobu.mita@gmail.com> - 2017-04-07 18:50 +0200
      Re: [PATCH v2] fault-inject: support systematic fault injection Dmitry Vyukov <dvyukov@google.com> - 2017-04-08 19:50 +0200
        Re: [PATCH v2] fault-inject: support systematic fault injection Akinobu Mita <akinobu.mita@gmail.com> - 2017-04-09 12:50 +0200

csiph-web