Re: [RFC] rcu: doc: update example about stale data

2018-10-30 Thread Joel Fernandes
On Tue, Oct 30, 2018 at 04:50:39PM -0700, Paul E. McKenney wrote:
> On Sun, Oct 28, 2018 at 06:16:31PM -0700, Joel Fernandes wrote:
> > On Sun, Oct 28, 2018 at 10:21:42AM -0700, Paul E. McKenney wrote:
> > > On Sat, Oct 27, 2018 at 07:16:53PM -0700, Joel Fernandes (Google) wrote:
> > > > The RCU example for 'rejecting stale data' on system-call auditting
> > > > stops iterating through the rules if a deleted one is found. It makes
> > > > more sense to continue looking at other rules once a deleted one is
> > > > rejected. Although the original example is fine, this makes it more
> > > > meaningful.
> > > > 
> > > > Signed-off-by: Joel Fernandes (Google) 
> > > 
> > > Does the actual audit code that this was copied from now include the
> > > continue statement?  If so, please update the commit log to state that
> > > and then I will take the resulting patch.  (This example was inspired
> > > by a long-ago version of the actual audit code.)
> > 
> > The document talks of a situation that could be but is not really in the
> > implementation. It says "If the system-call audit module were to ever need 
> > to
> > reject stale data". So its not really something implemented. I was just
> > correcting the example you had there since it made more sense to me to
> > continue looking for other rules in the list once a rule was shown to be
> > stale. It just makes the example more correct.
> > 
> > But I'm Ok if you want to leave that alone ;-) Hence, the RFC tag to this
> > patch ;-)
> 
> Well, I do agree that there are situations where you need to keep
> going.  But in the common case where only one instance of a given key
> is allowed, and where the list is either (1) sorted and/or (2) added
> to at the beginning, if you find a deleted element with a given key,
> you are guaranteed that you won't find another with that key even if
> you continue scanning the list.  After all, if you did find a deleted
> element, the duplicate either is not on the list in the sorted case
> or is behind you in the add-at-front case.
> 
> And in the more complex cases where persistent searching is required,
> you usually have to restart the search instead of continuing it.  Besides,
> things like the Issaquah Challenge don't seem to belong in introductory
> documentation on RCU.  ;-)

Ok, agreed. Lets drop this :)

-Joel



Re: [RFC] rcu: doc: update example about stale data

2018-10-30 Thread Joel Fernandes
On Tue, Oct 30, 2018 at 04:50:39PM -0700, Paul E. McKenney wrote:
> On Sun, Oct 28, 2018 at 06:16:31PM -0700, Joel Fernandes wrote:
> > On Sun, Oct 28, 2018 at 10:21:42AM -0700, Paul E. McKenney wrote:
> > > On Sat, Oct 27, 2018 at 07:16:53PM -0700, Joel Fernandes (Google) wrote:
> > > > The RCU example for 'rejecting stale data' on system-call auditting
> > > > stops iterating through the rules if a deleted one is found. It makes
> > > > more sense to continue looking at other rules once a deleted one is
> > > > rejected. Although the original example is fine, this makes it more
> > > > meaningful.
> > > > 
> > > > Signed-off-by: Joel Fernandes (Google) 
> > > 
> > > Does the actual audit code that this was copied from now include the
> > > continue statement?  If so, please update the commit log to state that
> > > and then I will take the resulting patch.  (This example was inspired
> > > by a long-ago version of the actual audit code.)
> > 
> > The document talks of a situation that could be but is not really in the
> > implementation. It says "If the system-call audit module were to ever need 
> > to
> > reject stale data". So its not really something implemented. I was just
> > correcting the example you had there since it made more sense to me to
> > continue looking for other rules in the list once a rule was shown to be
> > stale. It just makes the example more correct.
> > 
> > But I'm Ok if you want to leave that alone ;-) Hence, the RFC tag to this
> > patch ;-)
> 
> Well, I do agree that there are situations where you need to keep
> going.  But in the common case where only one instance of a given key
> is allowed, and where the list is either (1) sorted and/or (2) added
> to at the beginning, if you find a deleted element with a given key,
> you are guaranteed that you won't find another with that key even if
> you continue scanning the list.  After all, if you did find a deleted
> element, the duplicate either is not on the list in the sorted case
> or is behind you in the add-at-front case.
> 
> And in the more complex cases where persistent searching is required,
> you usually have to restart the search instead of continuing it.  Besides,
> things like the Issaquah Challenge don't seem to belong in introductory
> documentation on RCU.  ;-)

Ok, agreed. Lets drop this :)

-Joel



Re: [RFC] rcu: doc: update example about stale data

2018-10-30 Thread Paul E. McKenney
On Sun, Oct 28, 2018 at 06:16:31PM -0700, Joel Fernandes wrote:
> On Sun, Oct 28, 2018 at 10:21:42AM -0700, Paul E. McKenney wrote:
> > On Sat, Oct 27, 2018 at 07:16:53PM -0700, Joel Fernandes (Google) wrote:
> > > The RCU example for 'rejecting stale data' on system-call auditting
> > > stops iterating through the rules if a deleted one is found. It makes
> > > more sense to continue looking at other rules once a deleted one is
> > > rejected. Although the original example is fine, this makes it more
> > > meaningful.
> > > 
> > > Signed-off-by: Joel Fernandes (Google) 
> > 
> > Does the actual audit code that this was copied from now include the
> > continue statement?  If so, please update the commit log to state that
> > and then I will take the resulting patch.  (This example was inspired
> > by a long-ago version of the actual audit code.)
> 
> The document talks of a situation that could be but is not really in the
> implementation. It says "If the system-call audit module were to ever need to
> reject stale data". So its not really something implemented. I was just
> correcting the example you had there since it made more sense to me to
> continue looking for other rules in the list once a rule was shown to be
> stale. It just makes the example more correct.
> 
> But I'm Ok if you want to leave that alone ;-) Hence, the RFC tag to this
> patch ;-)

Well, I do agree that there are situations where you need to keep
going.  But in the common case where only one instance of a given key
is allowed, and where the list is either (1) sorted and/or (2) added
to at the beginning, if you find a deleted element with a given key,
you are guaranteed that you won't find another with that key even if
you continue scanning the list.  After all, if you did find a deleted
element, the duplicate either is not on the list in the sorted case
or is behind you in the add-at-front case.

And in the more complex cases where persistent searching is required,
you usually have to restart the search instead of continuing it.  Besides,
things like the Issaquah Challenge don't seem to belong in introductory
documentation on RCU.  ;-)

Thanx, Paul



Re: [RFC] rcu: doc: update example about stale data

2018-10-30 Thread Paul E. McKenney
On Sun, Oct 28, 2018 at 06:16:31PM -0700, Joel Fernandes wrote:
> On Sun, Oct 28, 2018 at 10:21:42AM -0700, Paul E. McKenney wrote:
> > On Sat, Oct 27, 2018 at 07:16:53PM -0700, Joel Fernandes (Google) wrote:
> > > The RCU example for 'rejecting stale data' on system-call auditting
> > > stops iterating through the rules if a deleted one is found. It makes
> > > more sense to continue looking at other rules once a deleted one is
> > > rejected. Although the original example is fine, this makes it more
> > > meaningful.
> > > 
> > > Signed-off-by: Joel Fernandes (Google) 
> > 
> > Does the actual audit code that this was copied from now include the
> > continue statement?  If so, please update the commit log to state that
> > and then I will take the resulting patch.  (This example was inspired
> > by a long-ago version of the actual audit code.)
> 
> The document talks of a situation that could be but is not really in the
> implementation. It says "If the system-call audit module were to ever need to
> reject stale data". So its not really something implemented. I was just
> correcting the example you had there since it made more sense to me to
> continue looking for other rules in the list once a rule was shown to be
> stale. It just makes the example more correct.
> 
> But I'm Ok if you want to leave that alone ;-) Hence, the RFC tag to this
> patch ;-)

Well, I do agree that there are situations where you need to keep
going.  But in the common case where only one instance of a given key
is allowed, and where the list is either (1) sorted and/or (2) added
to at the beginning, if you find a deleted element with a given key,
you are guaranteed that you won't find another with that key even if
you continue scanning the list.  After all, if you did find a deleted
element, the duplicate either is not on the list in the sorted case
or is behind you in the add-at-front case.

And in the more complex cases where persistent searching is required,
you usually have to restart the search instead of continuing it.  Besides,
things like the Issaquah Challenge don't seem to belong in introductory
documentation on RCU.  ;-)

Thanx, Paul



Re: [RFC] rcu: doc: update example about stale data

2018-10-28 Thread Joel Fernandes
On Sun, Oct 28, 2018 at 10:21:42AM -0700, Paul E. McKenney wrote:
> On Sat, Oct 27, 2018 at 07:16:53PM -0700, Joel Fernandes (Google) wrote:
> > The RCU example for 'rejecting stale data' on system-call auditting
> > stops iterating through the rules if a deleted one is found. It makes
> > more sense to continue looking at other rules once a deleted one is
> > rejected. Although the original example is fine, this makes it more
> > meaningful.
> > 
> > Signed-off-by: Joel Fernandes (Google) 
> 
> Does the actual audit code that this was copied from now include the
> continue statement?  If so, please update the commit log to state that
> and then I will take the resulting patch.  (This example was inspired
> by a long-ago version of the actual audit code.)

The document talks of a situation that could be but is not really in the
implementation. It says "If the system-call audit module were to ever need to
reject stale data". So its not really something implemented. I was just
correcting the example you had there since it made more sense to me to
continue looking for other rules in the list once a rule was shown to be
stale. It just makes the example more correct.

But I'm Ok if you want to leave that alone ;-) Hence, the RFC tag to this
patch ;-)

- Joel
 


Re: [RFC] rcu: doc: update example about stale data

2018-10-28 Thread Joel Fernandes
On Sun, Oct 28, 2018 at 10:21:42AM -0700, Paul E. McKenney wrote:
> On Sat, Oct 27, 2018 at 07:16:53PM -0700, Joel Fernandes (Google) wrote:
> > The RCU example for 'rejecting stale data' on system-call auditting
> > stops iterating through the rules if a deleted one is found. It makes
> > more sense to continue looking at other rules once a deleted one is
> > rejected. Although the original example is fine, this makes it more
> > meaningful.
> > 
> > Signed-off-by: Joel Fernandes (Google) 
> 
> Does the actual audit code that this was copied from now include the
> continue statement?  If so, please update the commit log to state that
> and then I will take the resulting patch.  (This example was inspired
> by a long-ago version of the actual audit code.)

The document talks of a situation that could be but is not really in the
implementation. It says "If the system-call audit module were to ever need to
reject stale data". So its not really something implemented. I was just
correcting the example you had there since it made more sense to me to
continue looking for other rules in the list once a rule was shown to be
stale. It just makes the example more correct.

But I'm Ok if you want to leave that alone ;-) Hence, the RFC tag to this
patch ;-)

- Joel
 


Re: [RFC] rcu: doc: update example about stale data

2018-10-28 Thread Paul E. McKenney
On Sat, Oct 27, 2018 at 09:44:31PM -0700, Joel Fernandes wrote:
> On Sat, Oct 27, 2018 at 7:16 PM, Joel Fernandes (Google)
>  wrote:
> > The RCU example for 'rejecting stale data' on system-call auditting
> > stops iterating through the rules if a deleted one is found. It makes
> > more sense to continue looking at other rules once a deleted one is
> > rejected. Although the original example is fine, this makes it more
> > meaningful.
> 
> Sorry, I messed up the patch title, it is supposed to be 'doc: rcu:
> ...'. I can resend it if you want.

Hmmm...  There doesn't seem to be any consistent standard for documentation
patches.  I see "Documentation: networking:", "docs:", "doc:" (which is
what I normally use), "doc:doc-guide:", "Documentation/process:",
"doc/devicetree:", "media: doc:", and who knows what all else.

Including "Documentation" seems excessive.  I guess I am OK with
"doc: rcu:", but either just plain "doc:" or "doc/rcu:" would be fine
with me as well.

Thanx, Paul



Re: [RFC] rcu: doc: update example about stale data

2018-10-28 Thread Paul E. McKenney
On Sat, Oct 27, 2018 at 09:44:31PM -0700, Joel Fernandes wrote:
> On Sat, Oct 27, 2018 at 7:16 PM, Joel Fernandes (Google)
>  wrote:
> > The RCU example for 'rejecting stale data' on system-call auditting
> > stops iterating through the rules if a deleted one is found. It makes
> > more sense to continue looking at other rules once a deleted one is
> > rejected. Although the original example is fine, this makes it more
> > meaningful.
> 
> Sorry, I messed up the patch title, it is supposed to be 'doc: rcu:
> ...'. I can resend it if you want.

Hmmm...  There doesn't seem to be any consistent standard for documentation
patches.  I see "Documentation: networking:", "docs:", "doc:" (which is
what I normally use), "doc:doc-guide:", "Documentation/process:",
"doc/devicetree:", "media: doc:", and who knows what all else.

Including "Documentation" seems excessive.  I guess I am OK with
"doc: rcu:", but either just plain "doc:" or "doc/rcu:" would be fine
with me as well.

Thanx, Paul



Re: [RFC] rcu: doc: update example about stale data

2018-10-28 Thread Paul E. McKenney
On Sat, Oct 27, 2018 at 07:16:53PM -0700, Joel Fernandes (Google) wrote:
> The RCU example for 'rejecting stale data' on system-call auditting
> stops iterating through the rules if a deleted one is found. It makes
> more sense to continue looking at other rules once a deleted one is
> rejected. Although the original example is fine, this makes it more
> meaningful.
> 
> Signed-off-by: Joel Fernandes (Google) 

Does the actual audit code that this was copied from now include the
continue statement?  If so, please update the commit log to state that
and then I will take the resulting patch.  (This example was inspired
by a long-ago version of the actual audit code.)

Thanx, Paul

> ---
>  Documentation/RCU/listRCU.txt | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/Documentation/RCU/listRCU.txt b/Documentation/RCU/listRCU.txt
> index adb5a3782846..09e9a4fc723e 100644
> --- a/Documentation/RCU/listRCU.txt
> +++ b/Documentation/RCU/listRCU.txt
> @@ -250,8 +250,7 @@ as follows:
>   spin_lock(>lock);
>   if (e->deleted) {
>   spin_unlock(>lock);
> - rcu_read_unlock();
> - return AUDIT_BUILD_CONTEXT;
> + continue;
>   }
>   rcu_read_unlock();
>   return state;
> -- 
> 2.19.1.568.g152ad8e336-goog
> 



Re: [RFC] rcu: doc: update example about stale data

2018-10-28 Thread Paul E. McKenney
On Sat, Oct 27, 2018 at 07:16:53PM -0700, Joel Fernandes (Google) wrote:
> The RCU example for 'rejecting stale data' on system-call auditting
> stops iterating through the rules if a deleted one is found. It makes
> more sense to continue looking at other rules once a deleted one is
> rejected. Although the original example is fine, this makes it more
> meaningful.
> 
> Signed-off-by: Joel Fernandes (Google) 

Does the actual audit code that this was copied from now include the
continue statement?  If so, please update the commit log to state that
and then I will take the resulting patch.  (This example was inspired
by a long-ago version of the actual audit code.)

Thanx, Paul

> ---
>  Documentation/RCU/listRCU.txt | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/Documentation/RCU/listRCU.txt b/Documentation/RCU/listRCU.txt
> index adb5a3782846..09e9a4fc723e 100644
> --- a/Documentation/RCU/listRCU.txt
> +++ b/Documentation/RCU/listRCU.txt
> @@ -250,8 +250,7 @@ as follows:
>   spin_lock(>lock);
>   if (e->deleted) {
>   spin_unlock(>lock);
> - rcu_read_unlock();
> - return AUDIT_BUILD_CONTEXT;
> + continue;
>   }
>   rcu_read_unlock();
>   return state;
> -- 
> 2.19.1.568.g152ad8e336-goog
> 



Re: [RFC] rcu: doc: update example about stale data

2018-10-27 Thread Joel Fernandes
On Sat, Oct 27, 2018 at 7:16 PM, Joel Fernandes (Google)
 wrote:
> The RCU example for 'rejecting stale data' on system-call auditting
> stops iterating through the rules if a deleted one is found. It makes
> more sense to continue looking at other rules once a deleted one is
> rejected. Although the original example is fine, this makes it more
> meaningful.

Sorry, I messed up the patch title, it is supposed to be 'doc: rcu:
...'. I can resend it if you want.

thanks,

- Joel


Re: [RFC] rcu: doc: update example about stale data

2018-10-27 Thread Joel Fernandes
On Sat, Oct 27, 2018 at 7:16 PM, Joel Fernandes (Google)
 wrote:
> The RCU example for 'rejecting stale data' on system-call auditting
> stops iterating through the rules if a deleted one is found. It makes
> more sense to continue looking at other rules once a deleted one is
> rejected. Although the original example is fine, this makes it more
> meaningful.

Sorry, I messed up the patch title, it is supposed to be 'doc: rcu:
...'. I can resend it if you want.

thanks,

- Joel


[RFC] rcu: doc: update example about stale data

2018-10-27 Thread Joel Fernandes (Google)
The RCU example for 'rejecting stale data' on system-call auditting
stops iterating through the rules if a deleted one is found. It makes
more sense to continue looking at other rules once a deleted one is
rejected. Although the original example is fine, this makes it more
meaningful.

Signed-off-by: Joel Fernandes (Google) 
---
 Documentation/RCU/listRCU.txt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Documentation/RCU/listRCU.txt b/Documentation/RCU/listRCU.txt
index adb5a3782846..09e9a4fc723e 100644
--- a/Documentation/RCU/listRCU.txt
+++ b/Documentation/RCU/listRCU.txt
@@ -250,8 +250,7 @@ as follows:
spin_lock(>lock);
if (e->deleted) {
spin_unlock(>lock);
-   rcu_read_unlock();
-   return AUDIT_BUILD_CONTEXT;
+   continue;
}
rcu_read_unlock();
return state;
-- 
2.19.1.568.g152ad8e336-goog



[RFC] rcu: doc: update example about stale data

2018-10-27 Thread Joel Fernandes (Google)
The RCU example for 'rejecting stale data' on system-call auditting
stops iterating through the rules if a deleted one is found. It makes
more sense to continue looking at other rules once a deleted one is
rejected. Although the original example is fine, this makes it more
meaningful.

Signed-off-by: Joel Fernandes (Google) 
---
 Documentation/RCU/listRCU.txt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Documentation/RCU/listRCU.txt b/Documentation/RCU/listRCU.txt
index adb5a3782846..09e9a4fc723e 100644
--- a/Documentation/RCU/listRCU.txt
+++ b/Documentation/RCU/listRCU.txt
@@ -250,8 +250,7 @@ as follows:
spin_lock(>lock);
if (e->deleted) {
spin_unlock(>lock);
-   rcu_read_unlock();
-   return AUDIT_BUILD_CONTEXT;
+   continue;
}
rcu_read_unlock();
return state;
-- 
2.19.1.568.g152ad8e336-goog