[PATCH 5/7] actor: Unobfuscate ACTOR_MAX_LOOPS

2013-06-11 Thread Chris Leech
From: Adam Jackson 

Signed-off-by: Adam Jackson 
---
 usr/actor.c | 2 +-
 usr/actor.h | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/usr/actor.c b/usr/actor.c
index e4e8a24..c084176 100644
--- a/usr/actor.c
+++ b/usr/actor.c
@@ -240,7 +240,7 @@ actor_poll(void)
/* don't check wait list every single poll.
 * get new time. Shift it to make 10s of msecs approx
 * if new time is not same as old time */
-   if (scheduler_loops++ > ACTOR_MAX_LOOPS) {
+   if (scheduler_loops++ > 1) {
/* try coming in about every 100 msecs */
current_time = actor_jiffies;
scheduler_loops = 0;
diff --git a/usr/actor.h b/usr/actor.h
index 704224d..4c1ae60 100644
--- a/usr/actor.h
+++ b/usr/actor.h
@@ -23,7 +23,6 @@
 #include "list.h"
 
 #define ACTOR_RESOLUTION   250 /* in millis */
-#define ACTOR_MAX_LOOPS1
 
 typedef enum actor_state_e {
 ACTOR_INVALID,
-- 
1.8.1.4

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at http://groups.google.com/group/open-iscsi?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Antw: [PATCH 5/7] actor: Unobfuscate ACTOR_MAX_LOOPS

2013-06-11 Thread Ulrich Windl
Hi!

While most of your changes seem reasonable, this one (if ACTOR_MAX_LOOPS will 
ever be different from 1) may be discussable. One rule of software negineering 
says: "never use a literal constant (except when defining a symbolic one ;-)"

Regards,
Ulrich

>>> Chris Leech  schrieb am 12.06.2013 um 07:24 in Nachricht
<1371014686-22334-6-git-send-email-cle...@redhat.com>:
> From: Adam Jackson 
> 
> Signed-off-by: Adam Jackson 
> ---
>  usr/actor.c | 2 +-
>  usr/actor.h | 1 -
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/usr/actor.c b/usr/actor.c
> index e4e8a24..c084176 100644
> --- a/usr/actor.c
> +++ b/usr/actor.c
> @@ -240,7 +240,7 @@ actor_poll(void)
>   /* don't check wait list every single poll.
>* get new time. Shift it to make 10s of msecs approx
>* if new time is not same as old time */
> - if (scheduler_loops++ > ACTOR_MAX_LOOPS) {
> + if (scheduler_loops++ > 1) {
>   /* try coming in about every 100 msecs */
>   current_time = actor_jiffies;
>   scheduler_loops = 0;
> diff --git a/usr/actor.h b/usr/actor.h
> index 704224d..4c1ae60 100644
> --- a/usr/actor.h
> +++ b/usr/actor.h
> @@ -23,7 +23,6 @@
>  #include "list.h"
>  
>  #define ACTOR_RESOLUTION 250 /* in millis */
> -#define ACTOR_MAX_LOOPS  1
>  
>  typedef enum actor_state_e {
>  ACTOR_INVALID,
> -- 
> 1.8.1.4
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "open-iscsi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to open-iscsi+unsubscr...@googlegroups.com.
> To post to this group, send email to open-iscsi@googlegroups.com.
> Visit this group at http://groups.google.com/group/open-iscsi?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.



-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at http://groups.google.com/group/open-iscsi?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Antw: [PATCH 5/7] actor: Unobfuscate ACTOR_MAX_LOOPS

2013-06-12 Thread Chris Leech
On Wed, Jun 12, 2013 at 08:31:09AM +0200, Ulrich Windl wrote:
> Hi!
> 
> While most of your changes seem reasonable, this one (if
> ACTOR_MAX_LOOPS will ever be different from 1) may be discussable. One
> rule of software negineering says: "never use a literal constant
> (except when defining a symbolic one ;-)"

This patch is just a step towards justifying the next one, where the
scheduler_loops is removed completely.

Point taken on the timespec code added in patch 7 though, I should clean
that up.

Chris

> >>> Chris Leech  schrieb am 12.06.2013 um 07:24 in 
> >>> Nachricht
> <1371014686-22334-6-git-send-email-cle...@redhat.com>:
> > From: Adam Jackson 
> > 
> > Signed-off-by: Adam Jackson 
> > ---
> >  usr/actor.c | 2 +-
> >  usr/actor.h | 1 -
> >  2 files changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/usr/actor.c b/usr/actor.c
> > index e4e8a24..c084176 100644
> > --- a/usr/actor.c
> > +++ b/usr/actor.c
> > @@ -240,7 +240,7 @@ actor_poll(void)
> > /* don't check wait list every single poll.
> >  * get new time. Shift it to make 10s of msecs approx
> >  * if new time is not same as old time */
> > -   if (scheduler_loops++ > ACTOR_MAX_LOOPS) {
> > +   if (scheduler_loops++ > 1) {
> > /* try coming in about every 100 msecs */
> > current_time = actor_jiffies;
> > scheduler_loops = 0;
> > diff --git a/usr/actor.h b/usr/actor.h
> > index 704224d..4c1ae60 100644
> > --- a/usr/actor.h
> > +++ b/usr/actor.h
> > @@ -23,7 +23,6 @@
> >  #include "list.h"
> >  
> >  #define ACTOR_RESOLUTION   250 /* in millis */
> > -#define ACTOR_MAX_LOOPS1
> >  
> >  typedef enum actor_state_e {
> >  ACTOR_INVALID,

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at http://groups.google.com/group/open-iscsi?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.