linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] docs: fault-injection: fix defaults
@ 2022-03-25 17:38 Dylan Yudaken
  2022-03-25 19:24 ` Jonathan Corbet
  0 siblings, 1 reply; 3+ messages in thread
From: Dylan Yudaken @ 2022-03-25 17:38 UTC (permalink / raw)
  To: Akinobu Mita, Jonathan Corbet, linux-doc; +Cc: Dylan Yudaken

ignore-gfp-wait and ignore-gfp-highmem defaults are actually true (Y) in
both failslab and fail_page_alloc, not false as the docs suggest. See
page_alloc.c:3762 and failslab.c:13

At the same time use 'Y' instead of '1' in the example scripts just for
consistency. (though 1 would work)

Signed-off-by: Dylan Yudaken <dylany@fb.com>
---
 Documentation/fault-injection/fault-injection.rst | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/fault-injection/fault-injection.rst b/Documentation/fault-injection/fault-injection.rst
index 4a25c5eb6f07..8b4e1ce26d01 100644
--- a/Documentation/fault-injection/fault-injection.rst
+++ b/Documentation/fault-injection/fault-injection.rst
@@ -132,7 +132,7 @@ configuration of fault-injection capabilities.
 
 	Format: { 'Y' | 'N' }
 
-	default is 'N', setting it to 'Y' won't inject failures into
+	default is 'Y', setting it to 'Y' won't inject failures into
 	highmem/user allocations.
 
 - /sys/kernel/debug/failslab/ignore-gfp-wait:
@@ -140,7 +140,7 @@ configuration of fault-injection capabilities.
 
 	Format: { 'Y' | 'N' }
 
-	default is 'N', setting it to 'Y' will inject failures
+	default is 'Y', setting it to 'Y' will inject failures
 	only into non-sleep allocations (GFP_ATOMIC allocations).
 
 - /sys/kernel/debug/fail_page_alloc/min-order:
@@ -280,7 +280,7 @@ Application Examples
     printf %#x -1 > /sys/kernel/debug/$FAILTYPE/times
     echo 0 > /sys/kernel/debug/$FAILTYPE/space
     echo 2 > /sys/kernel/debug/$FAILTYPE/verbose
-    echo 1 > /sys/kernel/debug/$FAILTYPE/ignore-gfp-wait
+    echo Y > /sys/kernel/debug/$FAILTYPE/ignore-gfp-wait
 
     faulty_system()
     {
@@ -334,8 +334,8 @@ Application Examples
     printf %#x -1 > /sys/kernel/debug/$FAILTYPE/times
     echo 0 > /sys/kernel/debug/$FAILTYPE/space
     echo 2 > /sys/kernel/debug/$FAILTYPE/verbose
-    echo 1 > /sys/kernel/debug/$FAILTYPE/ignore-gfp-wait
-    echo 1 > /sys/kernel/debug/$FAILTYPE/ignore-gfp-highmem
+    echo Y > /sys/kernel/debug/$FAILTYPE/ignore-gfp-wait
+    echo Y > /sys/kernel/debug/$FAILTYPE/ignore-gfp-highmem
     echo 10 > /sys/kernel/debug/$FAILTYPE/stacktrace-depth
 
     trap "echo 0 > /sys/kernel/debug/$FAILTYPE/probability" SIGINT SIGTERM EXIT

base-commit: f443e374ae131c168a065ea1748feac6b2e76613
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] docs: fault-injection: fix defaults
  2022-03-25 17:38 [PATCH] docs: fault-injection: fix defaults Dylan Yudaken
@ 2022-03-25 19:24 ` Jonathan Corbet
  2022-03-25 20:59   ` Dylan Yudaken
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Corbet @ 2022-03-25 19:24 UTC (permalink / raw)
  To: Dylan Yudaken, Akinobu Mita, linux-doc; +Cc: Dylan Yudaken

Dylan Yudaken <dylany@fb.com> writes:

> ignore-gfp-wait and ignore-gfp-highmem defaults are actually true (Y) in
> both failslab and fail_page_alloc, not false as the docs suggest. See
> page_alloc.c:3762 and failslab.c:13
>
> At the same time use 'Y' instead of '1' in the example scripts just for
> consistency. (though 1 would work)
>
> Signed-off-by: Dylan Yudaken <dylany@fb.com>
> ---
>  Documentation/fault-injection/fault-injection.rst | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/fault-injection/fault-injection.rst b/Documentation/fault-injection/fault-injection.rst
> index 4a25c5eb6f07..8b4e1ce26d01 100644
> --- a/Documentation/fault-injection/fault-injection.rst
> +++ b/Documentation/fault-injection/fault-injection.rst
> @@ -132,7 +132,7 @@ configuration of fault-injection capabilities.
>  
>  	Format: { 'Y' | 'N' }
>  
> -	default is 'N', setting it to 'Y' won't inject failures into
> +	default is 'Y', setting it to 'Y' won't inject failures into
>  	highmem/user allocations.

So the associated help text should perhaps have its sense changed too -
what happens if you set it to "N"?  The help text would be more useful,
IMO, if it read something like "set to 'N' if you want errors injected
into GFP_HIGHUSER allocations" (or whatever GFP flags actually apply
here). 

>  - /sys/kernel/debug/failslab/ignore-gfp-wait:
> @@ -140,7 +140,7 @@ configuration of fault-injection capabilities.
>  
>  	Format: { 'Y' | 'N' }
>  
> -	default is 'N', setting it to 'Y' will inject failures
> +	default is 'Y', setting it to 'Y' will inject failures
>  	only into non-sleep allocations (GFP_ATOMIC allocations).

This is a little better in general, but still would be improved by
telling the reader what they get if they change the default.

Thanks,

jon

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] docs: fault-injection: fix defaults
  2022-03-25 19:24 ` Jonathan Corbet
@ 2022-03-25 20:59   ` Dylan Yudaken
  0 siblings, 0 replies; 3+ messages in thread
From: Dylan Yudaken @ 2022-03-25 20:59 UTC (permalink / raw)
  To: corbet@lwn.net, akinobu.mita@gmail.com, linux-doc@vger.kernel.org

On Fri, 2022-03-25 at 13:24 -0600, Jonathan Corbet wrote:
> Dylan Yudaken <dylany@fb.com> writes:
> 
> > ignore-gfp-wait and ignore-gfp-highmem defaults are actually true
> > (Y) in
> > both failslab and fail_page_alloc, not false as the docs suggest.
> > See
> > page_alloc.c:3762 and failslab.c:13
> > 
> > At the same time use 'Y' instead of '1' in the example scripts just
> > for
> > consistency. (though 1 would work)
> > 
> > Signed-off-by: Dylan Yudaken <dylany@fb.com>
> > ---
> >  Documentation/fault-injection/fault-injection.rst | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/Documentation/fault-injection/fault-injection.rst
> > b/Documentation/fault-injection/fault-injection.rst
> > index 4a25c5eb6f07..8b4e1ce26d01 100644
> > --- a/Documentation/fault-injection/fault-injection.rst
> > +++ b/Documentation/fault-injection/fault-injection.rst
> > @@ -132,7 +132,7 @@ configuration of fault-injection capabilities.
> >  
> >         Format: { 'Y' | 'N' }
> >  
> > -       default is 'N', setting it to 'Y' won't inject failures
> > into
> > +       default is 'Y', setting it to 'Y' won't inject failures
> > into
> >         highmem/user allocations.
> 
> So the associated help text should perhaps have its sense changed too
> -
> what happens if you set it to "N"?  The help text would be more
> useful,
> IMO, if it read something like "set to 'N' if you want errors
> injected
> into GFP_HIGHUSER allocations" (or whatever GFP flags actually apply
> here). 
> 
> >  - /sys/kernel/debug/failslab/ignore-gfp-wait:
> > @@ -140,7 +140,7 @@ configuration of fault-injection capabilities.
> >  
> >         Format: { 'Y' | 'N' }
> >  
> > -       default is 'N', setting it to 'Y' will inject failures
> > +       default is 'Y', setting it to 'Y' will inject failures
> >         only into non-sleep allocations (GFP_ATOMIC allocations).
> 
> This is a little better in general, but still would be improved by
> telling the reader what they get if they change the default.

Makes sense. I'll submit v2 with that but it might be a couple weeks
when I get time (and I first have to understand what they actually get
when changing the default).

> 
> Thanks,
> 
> jon


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-25 20:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-25 17:38 [PATCH] docs: fault-injection: fix defaults Dylan Yudaken
2022-03-25 19:24 ` Jonathan Corbet
2022-03-25 20:59   ` Dylan Yudaken

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).