netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH] tags: Fix DEFINE_PER_CPU expansions
@ 2016-03-01 10:26 Peter Zijlstra
  2016-03-01 16:36 ` David Miller
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Peter Zijlstra @ 2016-03-01 10:26 UTC (permalink / raw)
  To: linux-kernel, Andrew Morton
  Cc: rjw, konrad.wilk, Ingo Molnar, paulmck, tj, davem, linux-acpi, netdev


$ make tags
  GEN     tags
ctags: Warning: drivers/acpi/processor_idle.c:64: null expansion of name pattern "\1"
ctags: Warning: drivers/xen/events/events_2l.c:41: null expansion of name pattern "\1"
ctags: Warning: kernel/locking/lockdep.c:151: null expansion of name pattern "\1"
ctags: Warning: kernel/rcu/rcutorture.c:133: null expansion of name pattern "\1"
ctags: Warning: kernel/rcu/rcutorture.c:135: null expansion of name pattern "\1"
ctags: Warning: kernel/workqueue.c:323: null expansion of name pattern "\1"
ctags: Warning: net/ipv4/syncookies.c:53: null expansion of name pattern "\1"
ctags: Warning: net/ipv6/syncookies.c:44: null expansion of name pattern "\1"
ctags: Warning: net/rds/page.c:45: null expansion of name pattern "\1"

Which are all the result of the DEFINE_PER_CPU pattern:

scripts/tags.sh:200:	'/\<DEFINE_PER_CPU([^,]*, *\([[:alnum:]_]*\)/\1/v/'
scripts/tags.sh:201:	'/\<DEFINE_PER_CPU_SHARED_ALIGNED([^,]*, *\([[:alnum:]_]*\)/\1/v/'

The below cures them. All except the workqueue one are within reasonable
distance of the 80 char limit. TJ do you have any preference on how to
fix the wq one, or shall we just not care its too long?

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 drivers/acpi/processor_idle.c  | 4 ++--
 drivers/xen/events/events_2l.c | 5 +++--
 kernel/locking/lockdep.c       | 3 +--
 kernel/rcu/rcutorture.c        | 6 ++----
 kernel/workqueue.c             | 3 +--
 net/ipv4/syncookies.c          | 3 +--
 net/ipv6/syncookies.c          | 3 +--
 net/rds/page.c                 | 4 ++--
 8 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 175c86bee3a9..9ca2b2fefd76 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -61,8 +61,8 @@ module_param(latency_factor, uint, 0644);
 
 static DEFINE_PER_CPU(struct cpuidle_device *, acpi_cpuidle_device);
 
-static DEFINE_PER_CPU(struct acpi_processor_cx * [CPUIDLE_STATE_MAX],
-								acpi_cstate);
+static
+DEFINE_PER_CPU(struct acpi_processor_cx * [CPUIDLE_STATE_MAX], acpi_cstate);
 
 static int disabled_by_idle_boot_param(void)
 {
diff --git a/drivers/xen/events/events_2l.c b/drivers/xen/events/events_2l.c
index 7dd46312c180..403fe3955393 100644
--- a/drivers/xen/events/events_2l.c
+++ b/drivers/xen/events/events_2l.c
@@ -38,8 +38,9 @@
 /* Find the first set bit in a evtchn mask */
 #define EVTCHN_FIRST_BIT(w) find_first_bit(BM(&(w)), BITS_PER_EVTCHN_WORD)
 
-static DEFINE_PER_CPU(xen_ulong_t [EVTCHN_2L_NR_CHANNELS/BITS_PER_EVTCHN_WORD],
-		      cpu_evtchn_mask);
+#define EVTCHN_MASK_SIZE (EVTCHN_2L_NR_CHANNELS/BITS_PER_EVTCHN_WORD)
+
+static DEFINE_PER_CPU(xen_ulong_t [EVTCHN_MASK_SIZE], cpu_evtchn_mask);
 
 static unsigned evtchn_2l_max_channels(void)
 {
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 3261214323fa..9599bc7742a9 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -148,8 +148,7 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock)
 }
 
 #ifdef CONFIG_LOCK_STAT
-static DEFINE_PER_CPU(struct lock_class_stats[MAX_LOCKDEP_KEYS],
-		      cpu_lock_stats);
+static DEFINE_PER_CPU(struct lock_class_stats[MAX_LOCKDEP_KEYS], cpu_lock_stats);
 
 static inline u64 lockstat_clock(void)
 {
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index d2988d047d66..4d5cc6aa7e1e 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -130,10 +130,8 @@ static struct rcu_torture __rcu *rcu_torture_current;
 static unsigned long rcu_torture_current_version;
 static struct rcu_torture rcu_tortures[10 * RCU_TORTURE_PIPE_LEN];
 static DEFINE_SPINLOCK(rcu_torture_lock);
-static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1],
-		      rcu_torture_count) = { 0 };
-static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1],
-		      rcu_torture_batch) = { 0 };
+static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], rcu_torture_count) = { 0 };
+static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], rcu_torture_batch) = { 0 };
 static atomic_t rcu_torture_wcount[RCU_TORTURE_PIPE_LEN + 1];
 static atomic_t n_rcu_torture_alloc;
 static atomic_t n_rcu_torture_alloc_fail;
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 7ff5dc7d2ac5..16e13d8628a3 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -320,8 +320,7 @@ static bool wq_debug_force_rr_cpu = false;
 module_param_named(debug_force_rr_cpu, wq_debug_force_rr_cpu, bool, 0644);
 
 /* the per-cpu worker pools */
-static DEFINE_PER_CPU_SHARED_ALIGNED(struct worker_pool [NR_STD_WORKER_POOLS],
-				     cpu_worker_pools);
+static DEFINE_PER_CPU_SHARED_ALIGNED(struct worker_pool [NR_STD_WORKER_POOLS], cpu_worker_pools);
 
 static DEFINE_IDR(worker_pool_idr);	/* PR: idr of all pools */
 
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index 643a86c49020..2d5589b61e9f 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -50,8 +50,7 @@ static u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS] __read_mostly;
 #define TSBITS	6
 #define TSMASK	(((__u32)1 << TSBITS) - 1)
 
-static DEFINE_PER_CPU(__u32 [16 + 5 + SHA_WORKSPACE_WORDS],
-		      ipv4_cookie_scratch);
+static DEFINE_PER_CPU(__u32 [16 + 5 + SHA_WORKSPACE_WORDS], ipv4_cookie_scratch);
 
 static u32 cookie_hash(__be32 saddr, __be32 daddr, __be16 sport, __be16 dport,
 		       u32 count, int c)
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c
index 2906ef20795e..aae3e5ca63ea 100644
--- a/net/ipv6/syncookies.c
+++ b/net/ipv6/syncookies.c
@@ -41,8 +41,7 @@ static __u16 const msstab[] = {
 	9000 - 60,
 };
 
-static DEFINE_PER_CPU(__u32 [16 + 5 + SHA_WORKSPACE_WORDS],
-		      ipv6_cookie_scratch);
+static DEFINE_PER_CPU(__u32 [16 + 5 + SHA_WORKSPACE_WORDS], ipv6_cookie_scratch);
 
 static u32 cookie_hash(const struct in6_addr *saddr, const struct in6_addr *daddr,
 		       __be16 sport, __be16 dport, u32 count, int c)
diff --git a/net/rds/page.c b/net/rds/page.c
index 5a14e6d6a926..616f21f4e7d7 100644
--- a/net/rds/page.c
+++ b/net/rds/page.c
@@ -42,8 +42,8 @@ struct rds_page_remainder {
 	unsigned long	r_offset;
 };
 
-static DEFINE_PER_CPU_SHARED_ALIGNED(struct rds_page_remainder,
-				     rds_page_remainders);
+static
+DEFINE_PER_CPU_SHARED_ALIGNED(struct rds_page_remainder, rds_page_remainders);
 
 /*
  * returns 0 on success or -errno on failure.

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

* Re: [RFC][PATCH] tags: Fix DEFINE_PER_CPU expansions
  2016-03-01 10:26 [RFC][PATCH] tags: Fix DEFINE_PER_CPU expansions Peter Zijlstra
@ 2016-03-01 16:36 ` David Miller
  2016-03-01 16:37 ` Tejun Heo
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2016-03-01 16:36 UTC (permalink / raw)
  To: peterz
  Cc: linux-kernel, akpm, rjw, konrad.wilk, mingo, paulmck, tj,
	linux-acpi, netdev

From: Peter Zijlstra <peterz@infradead.org>
Date: Tue, 1 Mar 2016 11:26:25 +0100

> 
> $ make tags
>   GEN     tags
> ctags: Warning: drivers/acpi/processor_idle.c:64: null expansion of name pattern "\1"
> ctags: Warning: drivers/xen/events/events_2l.c:41: null expansion of name pattern "\1"
> ctags: Warning: kernel/locking/lockdep.c:151: null expansion of name pattern "\1"
> ctags: Warning: kernel/rcu/rcutorture.c:133: null expansion of name pattern "\1"
> ctags: Warning: kernel/rcu/rcutorture.c:135: null expansion of name pattern "\1"
> ctags: Warning: kernel/workqueue.c:323: null expansion of name pattern "\1"
> ctags: Warning: net/ipv4/syncookies.c:53: null expansion of name pattern "\1"
> ctags: Warning: net/ipv6/syncookies.c:44: null expansion of name pattern "\1"
> ctags: Warning: net/rds/page.c:45: null expansion of name pattern "\1"
> 
> Which are all the result of the DEFINE_PER_CPU pattern:
> 
> scripts/tags.sh:200:	'/\<DEFINE_PER_CPU([^,]*, *\([[:alnum:]_]*\)/\1/v/'
> scripts/tags.sh:201:	'/\<DEFINE_PER_CPU_SHARED_ALIGNED([^,]*, *\([[:alnum:]_]*\)/\1/v/'
> 
> The below cures them. All except the workqueue one are within reasonable
> distance of the 80 char limit. TJ do you have any preference on how to
> fix the wq one, or shall we just not care its too long?
> 
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>

For the networking bits:

Acked-by: David S. Miller <davem@davemloft.net>

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

* Re: [RFC][PATCH] tags: Fix DEFINE_PER_CPU expansions
  2016-03-01 10:26 [RFC][PATCH] tags: Fix DEFINE_PER_CPU expansions Peter Zijlstra
  2016-03-01 16:36 ` David Miller
@ 2016-03-01 16:37 ` Tejun Heo
  2016-03-01 18:18   ` Peter Zijlstra
  2016-03-01 16:56 ` Paul E. McKenney
  2016-03-01 21:39 ` Rafael J. Wysocki
  3 siblings, 1 reply; 9+ messages in thread
From: Tejun Heo @ 2016-03-01 16:37 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: linux-kernel, Andrew Morton, rjw, konrad.wilk, Ingo Molnar,
	paulmck, davem, linux-acpi, netdev

Hello, Peter.

On Tue, Mar 01, 2016 at 11:26:25AM +0100, Peter Zijlstra wrote:
> 
> $ make tags
>   GEN     tags
> ctags: Warning: drivers/acpi/processor_idle.c:64: null expansion of name pattern "\1"
> ctags: Warning: drivers/xen/events/events_2l.c:41: null expansion of name pattern "\1"
> ctags: Warning: kernel/locking/lockdep.c:151: null expansion of name pattern "\1"
> ctags: Warning: kernel/rcu/rcutorture.c:133: null expansion of name pattern "\1"
> ctags: Warning: kernel/rcu/rcutorture.c:135: null expansion of name pattern "\1"
> ctags: Warning: kernel/workqueue.c:323: null expansion of name pattern "\1"
> ctags: Warning: net/ipv4/syncookies.c:53: null expansion of name pattern "\1"
> ctags: Warning: net/ipv6/syncookies.c:44: null expansion of name pattern "\1"
> ctags: Warning: net/rds/page.c:45: null expansion of name pattern "\1"
> 
> Which are all the result of the DEFINE_PER_CPU pattern:
> 
> scripts/tags.sh:200:	'/\<DEFINE_PER_CPU([^,]*, *\([[:alnum:]_]*\)/\1/v/'
> scripts/tags.sh:201:	'/\<DEFINE_PER_CPU_SHARED_ALIGNED([^,]*, *\([[:alnum:]_]*\)/\1/v/'
> 
> The below cures them. All except the workqueue one are within reasonable
> distance of the 80 char limit. TJ do you have any preference on how to
> fix the wq one, or shall we just not care its too long?

Urgh... I really hate the fact that we're putting on arbitrary
formatting constraints to compensate for shortcomings in an
out-of-line utility.  Can't it do multiline regex?

Thanks.

-- 
tejun

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

* Re: [RFC][PATCH] tags: Fix DEFINE_PER_CPU expansions
  2016-03-01 10:26 [RFC][PATCH] tags: Fix DEFINE_PER_CPU expansions Peter Zijlstra
  2016-03-01 16:36 ` David Miller
  2016-03-01 16:37 ` Tejun Heo
@ 2016-03-01 16:56 ` Paul E. McKenney
  2016-03-01 21:34   ` Peter Zijlstra
  2016-03-01 21:39 ` Rafael J. Wysocki
  3 siblings, 1 reply; 9+ messages in thread
From: Paul E. McKenney @ 2016-03-01 16:56 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: linux-kernel, Andrew Morton, rjw, konrad.wilk, Ingo Molnar, tj,
	davem, linux-acpi, netdev

On Tue, Mar 01, 2016 at 11:26:25AM +0100, Peter Zijlstra wrote:
> 
> $ make tags
>   GEN     tags
> ctags: Warning: drivers/acpi/processor_idle.c:64: null expansion of name pattern "\1"
> ctags: Warning: drivers/xen/events/events_2l.c:41: null expansion of name pattern "\1"
> ctags: Warning: kernel/locking/lockdep.c:151: null expansion of name pattern "\1"
> ctags: Warning: kernel/rcu/rcutorture.c:133: null expansion of name pattern "\1"
> ctags: Warning: kernel/rcu/rcutorture.c:135: null expansion of name pattern "\1"
> ctags: Warning: kernel/workqueue.c:323: null expansion of name pattern "\1"
> ctags: Warning: net/ipv4/syncookies.c:53: null expansion of name pattern "\1"
> ctags: Warning: net/ipv6/syncookies.c:44: null expansion of name pattern "\1"
> ctags: Warning: net/rds/page.c:45: null expansion of name pattern "\1"
> 
> Which are all the result of the DEFINE_PER_CPU pattern:
> 
> scripts/tags.sh:200:	'/\<DEFINE_PER_CPU([^,]*, *\([[:alnum:]_]*\)/\1/v/'
> scripts/tags.sh:201:	'/\<DEFINE_PER_CPU_SHARED_ALIGNED([^,]*, *\([[:alnum:]_]*\)/\1/v/'
> 
> The below cures them. All except the workqueue one are within reasonable
> distance of the 80 char limit. TJ do you have any preference on how to
> fix the wq one, or shall we just not care its too long?
> 
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>

For rcutorture, the initializers are zero.  Would it make more sense to
remove the initializers completely in favor of C's default initialization
as shown below?

							Thanx, Paul

------------------------------------------------------------------------

commit 9bd8e9f0c56cfc19ca5b68a73edd80b16bec4af8
Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Date:   Tue Mar 1 08:52:19 2016 -0800

    rcutorture: Remove redundant initialization to zero
    
    The current code initializes the global per-CPU variables
    rcu_torture_count and rcu_torture_batch to zero.  However, C does this
    initialization by default, and explicit initialization of per-CPU
    variables now needs a different syntax if "make tags" is to work.
    This commit therefore removes the initialization.
    
    Reported-by: Peter Zijlstra <peterz@infradead.org>
    Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 1c2dc23ae07d..f5fd9acc0f9b 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -131,9 +131,9 @@ static unsigned long rcu_torture_current_version;
 static struct rcu_torture rcu_tortures[10 * RCU_TORTURE_PIPE_LEN];
 static DEFINE_SPINLOCK(rcu_torture_lock);
 static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1],
-		      rcu_torture_count) = { 0 };
+		      rcu_torture_count);
 static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1],
-		      rcu_torture_batch) = { 0 };
+		      rcu_torture_batch);
 static atomic_t rcu_torture_wcount[RCU_TORTURE_PIPE_LEN + 1];
 static atomic_t n_rcu_torture_alloc;
 static atomic_t n_rcu_torture_alloc_fail;


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

* Re: [RFC][PATCH] tags: Fix DEFINE_PER_CPU expansions
  2016-03-01 16:37 ` Tejun Heo
@ 2016-03-01 18:18   ` Peter Zijlstra
  2016-03-01 18:49     ` Tejun Heo
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Zijlstra @ 2016-03-01 18:18 UTC (permalink / raw)
  To: Tejun Heo
  Cc: linux-kernel, Andrew Morton, rjw, konrad.wilk, Ingo Molnar,
	paulmck, davem, linux-acpi, netdev

On Tue, Mar 01, 2016 at 11:37:07AM -0500, Tejun Heo wrote:
> Hello, Peter.
> 
> On Tue, Mar 01, 2016 at 11:26:25AM +0100, Peter Zijlstra wrote:
> > 
> > $ make tags
> >   GEN     tags
> > ctags: Warning: drivers/acpi/processor_idle.c:64: null expansion of name pattern "\1"
> > ctags: Warning: drivers/xen/events/events_2l.c:41: null expansion of name pattern "\1"
> > ctags: Warning: kernel/locking/lockdep.c:151: null expansion of name pattern "\1"
> > ctags: Warning: kernel/rcu/rcutorture.c:133: null expansion of name pattern "\1"
> > ctags: Warning: kernel/rcu/rcutorture.c:135: null expansion of name pattern "\1"
> > ctags: Warning: kernel/workqueue.c:323: null expansion of name pattern "\1"
> > ctags: Warning: net/ipv4/syncookies.c:53: null expansion of name pattern "\1"
> > ctags: Warning: net/ipv6/syncookies.c:44: null expansion of name pattern "\1"
> > ctags: Warning: net/rds/page.c:45: null expansion of name pattern "\1"
> > 
> > Which are all the result of the DEFINE_PER_CPU pattern:
> > 
> > scripts/tags.sh:200:	'/\<DEFINE_PER_CPU([^,]*, *\([[:alnum:]_]*\)/\1/v/'
> > scripts/tags.sh:201:	'/\<DEFINE_PER_CPU_SHARED_ALIGNED([^,]*, *\([[:alnum:]_]*\)/\1/v/'
> > 
> > The below cures them. All except the workqueue one are within reasonable
> > distance of the 80 char limit. TJ do you have any preference on how to
> > fix the wq one, or shall we just not care its too long?
> 
> Urgh... I really hate the fact that we're putting on arbitrary
> formatting constraints to compensate for shortcomings in an
> out-of-line utility.

Yes it does.

I'm not too bothered if you don't want to fix this, I just figured I'd
have a stab at fixing all this, since I regularly run 'make tags' and
got tired of seeing the warns.

> Can't it do multiline regex?

Apparently not:

  https://sourceforge.net/p/ctags/feature-requests/38/

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

* Re: [RFC][PATCH] tags: Fix DEFINE_PER_CPU expansions
  2016-03-01 18:18   ` Peter Zijlstra
@ 2016-03-01 18:49     ` Tejun Heo
  0 siblings, 0 replies; 9+ messages in thread
From: Tejun Heo @ 2016-03-01 18:49 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: linux-kernel, Andrew Morton, rjw, konrad.wilk, Ingo Molnar,
	paulmck, davem, linux-acpi, netdev

Hello,

On Tue, Mar 01, 2016 at 07:18:42PM +0100, Peter Zijlstra wrote:
> > Urgh... I really hate the fact that we're putting on arbitrary
> > formatting constraints to compensate for shortcomings in an
> > out-of-line utility.
> 
> Yes it does.
> 
> I'm not too bothered if you don't want to fix this, I just figured I'd
> have a stab at fixing all this, since I regularly run 'make tags' and
> got tired of seeing the warns.

I use cscope so haven't noticed them.

> > Can't it do multiline regex?
> 
> Apparently not:
> 
>   https://sourceforge.net/p/ctags/feature-requests/38/

That's unfortunate.  Ah well, it's only several spots and isn't a big
deal one way or the other.  Occasional >80 lines are fine by me.
Please feel free to add

 Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun

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

* Re: [RFC][PATCH] tags: Fix DEFINE_PER_CPU expansions
  2016-03-01 16:56 ` Paul E. McKenney
@ 2016-03-01 21:34   ` Peter Zijlstra
  2016-03-01 22:01     ` Paul E. McKenney
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Zijlstra @ 2016-03-01 21:34 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: linux-kernel, Andrew Morton, rjw, konrad.wilk, Ingo Molnar, tj,
	davem, linux-acpi, netdev

On Tue, Mar 01, 2016 at 08:56:50AM -0800, Paul E. McKenney wrote:
> +++ b/kernel/rcu/rcutorture.c
> @@ -131,9 +131,9 @@ static unsigned long rcu_torture_current_version;
>  static struct rcu_torture rcu_tortures[10 * RCU_TORTURE_PIPE_LEN];
>  static DEFINE_SPINLOCK(rcu_torture_lock);
>  static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1],
> -		      rcu_torture_count) = { 0 };
> +		      rcu_torture_count);

So the problem I was fixing is that the ctags regex needs the second
argument for the DEFINE_PER_CPU() macro on the same line.

So it would still need to be:

static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], rcu_torture_count);

>  static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1],
> -		      rcu_torture_batch) = { 0 };
> +		      rcu_torture_batch);
>  static atomic_t rcu_torture_wcount[RCU_TORTURE_PIPE_LEN + 1];
>  static atomic_t n_rcu_torture_alloc;
>  static atomic_t n_rcu_torture_alloc_fail;
> 

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

* Re: [RFC][PATCH] tags: Fix DEFINE_PER_CPU expansions
  2016-03-01 10:26 [RFC][PATCH] tags: Fix DEFINE_PER_CPU expansions Peter Zijlstra
                   ` (2 preceding siblings ...)
  2016-03-01 16:56 ` Paul E. McKenney
@ 2016-03-01 21:39 ` Rafael J. Wysocki
  3 siblings, 0 replies; 9+ messages in thread
From: Rafael J. Wysocki @ 2016-03-01 21:39 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Linux Kernel Mailing List, Andrew Morton, Rafael J. Wysocki,
	Konrad Rzeszutek Wilk, Ingo Molnar, Paul McKenney, Tejun Heo,
	David Miller, ACPI Devel Maling List, netdev

On Tue, Mar 1, 2016 at 11:26 AM, Peter Zijlstra <peterz@infradead.org> wrote:
>
> $ make tags
>   GEN     tags
> ctags: Warning: drivers/acpi/processor_idle.c:64: null expansion of name pattern "\1"
> ctags: Warning: drivers/xen/events/events_2l.c:41: null expansion of name pattern "\1"
> ctags: Warning: kernel/locking/lockdep.c:151: null expansion of name pattern "\1"
> ctags: Warning: kernel/rcu/rcutorture.c:133: null expansion of name pattern "\1"
> ctags: Warning: kernel/rcu/rcutorture.c:135: null expansion of name pattern "\1"
> ctags: Warning: kernel/workqueue.c:323: null expansion of name pattern "\1"
> ctags: Warning: net/ipv4/syncookies.c:53: null expansion of name pattern "\1"
> ctags: Warning: net/ipv6/syncookies.c:44: null expansion of name pattern "\1"
> ctags: Warning: net/rds/page.c:45: null expansion of name pattern "\1"
>
> Which are all the result of the DEFINE_PER_CPU pattern:
>
> scripts/tags.sh:200:    '/\<DEFINE_PER_CPU([^,]*, *\([[:alnum:]_]*\)/\1/v/'
> scripts/tags.sh:201:    '/\<DEFINE_PER_CPU_SHARED_ALIGNED([^,]*, *\([[:alnum:]_]*\)/\1/v/'
>
> The below cures them. All except the workqueue one are within reasonable
> distance of the 80 char limit. TJ do you have any preference on how to
> fix the wq one, or shall we just not care its too long?
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
>  drivers/acpi/processor_idle.c  | 4 ++--
>  drivers/xen/events/events_2l.c | 5 +++--
>  kernel/locking/lockdep.c       | 3 +--
>  kernel/rcu/rcutorture.c        | 6 ++----
>  kernel/workqueue.c             | 3 +--
>  net/ipv4/syncookies.c          | 3 +--
>  net/ipv6/syncookies.c          | 3 +--
>  net/rds/page.c                 | 4 ++--
>  8 files changed, 13 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
> index 175c86bee3a9..9ca2b2fefd76 100644
> --- a/drivers/acpi/processor_idle.c
> +++ b/drivers/acpi/processor_idle.c
> @@ -61,8 +61,8 @@ module_param(latency_factor, uint, 0644);
>
>  static DEFINE_PER_CPU(struct cpuidle_device *, acpi_cpuidle_device);
>
> -static DEFINE_PER_CPU(struct acpi_processor_cx * [CPUIDLE_STATE_MAX],
> -                                                               acpi_cstate);
> +static
> +DEFINE_PER_CPU(struct acpi_processor_cx * [CPUIDLE_STATE_MAX], acpi_cstate);
>
>  static int disabled_by_idle_boot_param(void)
>  {

For the above:

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

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

* Re: [RFC][PATCH] tags: Fix DEFINE_PER_CPU expansions
  2016-03-01 21:34   ` Peter Zijlstra
@ 2016-03-01 22:01     ` Paul E. McKenney
  0 siblings, 0 replies; 9+ messages in thread
From: Paul E. McKenney @ 2016-03-01 22:01 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: linux-kernel, Andrew Morton, rjw, konrad.wilk, Ingo Molnar, tj,
	davem, linux-acpi, netdev

On Tue, Mar 01, 2016 at 10:34:44PM +0100, Peter Zijlstra wrote:
> On Tue, Mar 01, 2016 at 08:56:50AM -0800, Paul E. McKenney wrote:
> > +++ b/kernel/rcu/rcutorture.c
> > @@ -131,9 +131,9 @@ static unsigned long rcu_torture_current_version;
> >  static struct rcu_torture rcu_tortures[10 * RCU_TORTURE_PIPE_LEN];
> >  static DEFINE_SPINLOCK(rcu_torture_lock);
> >  static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1],
> > -		      rcu_torture_count) = { 0 };
> > +		      rcu_torture_count);
> 
> So the problem I was fixing is that the ctags regex needs the second
> argument for the DEFINE_PER_CPU() macro on the same line.
> 
> So it would still need to be:
> 
> static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], rcu_torture_count);
> 
> >  static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1],
> > -		      rcu_torture_batch) = { 0 };
> > +		      rcu_torture_batch);
> >  static atomic_t rcu_torture_wcount[RCU_TORTURE_PIPE_LEN + 1];
> >  static atomic_t n_rcu_torture_alloc;
> >  static atomic_t n_rcu_torture_alloc_fail;

Ah, like this, then.

							Thanx, Paul

------------------------------------------------------------------------

commit 55d4929acdc66f00f27d79bfe273eeda01ec899f
Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Date:   Tue Mar 1 08:52:19 2016 -0800

    rcutorture: Remove redundant initialization to zero
    
    The current code initializes the global per-CPU variables
    rcu_torture_count and rcu_torture_batch to zero.  However, C does this
    initialization by default, and explicit initialization of per-CPU
    variables now needs a different syntax if "make tags" is to work.
    This commit therefore removes the initialization.
    
    Reported-by: Peter Zijlstra <peterz@infradead.org>
    Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 1c2dc23ae07d..e75557368c04 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -130,10 +130,8 @@ static struct rcu_torture __rcu *rcu_torture_current;
 static unsigned long rcu_torture_current_version;
 static struct rcu_torture rcu_tortures[10 * RCU_TORTURE_PIPE_LEN];
 static DEFINE_SPINLOCK(rcu_torture_lock);
-static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1],
-		      rcu_torture_count) = { 0 };
-static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1],
-		      rcu_torture_batch) = { 0 };
+static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], rcu_torture_count);
+static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], rcu_torture_batch);
 static atomic_t rcu_torture_wcount[RCU_TORTURE_PIPE_LEN + 1];
 static atomic_t n_rcu_torture_alloc;
 static atomic_t n_rcu_torture_alloc_fail;

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

end of thread, other threads:[~2016-03-01 22:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-01 10:26 [RFC][PATCH] tags: Fix DEFINE_PER_CPU expansions Peter Zijlstra
2016-03-01 16:36 ` David Miller
2016-03-01 16:37 ` Tejun Heo
2016-03-01 18:18   ` Peter Zijlstra
2016-03-01 18:49     ` Tejun Heo
2016-03-01 16:56 ` Paul E. McKenney
2016-03-01 21:34   ` Peter Zijlstra
2016-03-01 22:01     ` Paul E. McKenney
2016-03-01 21:39 ` Rafael J. Wysocki

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