public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>,
	mingo@elte.hu, KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Nicholas Miell <nmiell@comcast.net>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	laijs@cn.fujitsu.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, josh@joshtriplett.org,
	dvhltc@us.ibm.com, niv@us.ibm.com, tglx@linutronix.de,
	peterz@infradead.org, Valdis.Kletnieks@vt.edu,
	dhowells@redhat.com, Nick Piggin <npiggin@suse.de>,
	Chris Friesen <cfriesen@nortel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] introduce sys_membarrier(): process-wide memory barrier (v10)
Date: Mon, 5 Apr 2010 13:40:21 -0700	[thread overview]
Message-ID: <20100405204021.GH2525@linux.vnet.ibm.com> (raw)
In-Reply-To: <20100405191057.GB13309@Krystal>

On Mon, Apr 05, 2010 at 03:10:57PM -0400, Mathieu Desnoyers wrote:
> * Randy Dunlap (randy.dunlap@oracle.com) wrote:
> > On Mon, 5 Apr 2010 13:57:37 -0400 Mathieu Desnoyers wrote:

[ . . . ]

> > > +#else /* #ifdef CONFIG_SMP */
> > 
> > I don't know that we have a known convention for that, but I would use:
> > 
> > #else /* not CONFIG_SMP */
> > 
> > or
> > 
> > #else /* !CONFIG_SMP */
> > 
> > > +
> > > +SYSCALL_DEFINE1(membarrier, unsigned int, flags)
> > > +{
> > > +	return 0;
> > > +}
> > > +
> > > +#endif /* #else #ifdef CONFIG_SMP */
> > 
> > and:
> > 
> > #endif /* CONFIG_SMP */
> > 
> > The "#else #ifdef" is both ugly and too wordy IMO.

The extra words make it very clear that we are in at the end of the #else
clause of a #ifdef with the given condition.  With "#endif /* CONFIG_SMP
*/", is the immediately preceding code compiled under CONFIG_SMP or
!CONFIG_SMP?  You have to dig back and see whether or not there is a
#else clause.

But there is no accounting for taste.  ;-)

							Thanx, Paul

> OK. I merely followed the coding style of the code added to sched.c by Paul
> McKenney. But you are right, the rest of sched.c does as you say:
> 
> #else /* !CONFIG_SMP */
> 
> #endif /* CONFIG_SMP */
> 
> Will fix.
> 
> Thanks !
> 
> Mathieu
> 
> > 
> > > +
> > >  #ifndef CONFIG_SMP
> > >  
> > >  int rcu_expedited_torture_stats(char *page)
> > 
> > 
> > ---
> > ~Randy
> > 
> 
> -- 
> Mathieu Desnoyers
> Operating System Efficiency R&D Consultant
> EfficiOS Inc.
> http://www.efficios.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

  reply	other threads:[~2010-04-05 20:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-05 17:57 [PATCH] introduce sys_membarrier(): process-wide memory barrier (v10) Mathieu Desnoyers
2010-04-05 18:38 ` Randy Dunlap
2010-04-05 19:10   ` Mathieu Desnoyers
2010-04-05 20:40     ` Paul E. McKenney [this message]
2010-04-05 20:23       ` Randy Dunlap
2010-04-05 21:39         ` Paul E. McKenney
2010-04-05 22:01           ` Mathieu Desnoyers
2010-04-05 21:08     ` Josh Triplett
2010-04-05 22:08       ` Mathieu Desnoyers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100405204021.GH2525@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=akpm@linux-foundation.org \
    --cc=cfriesen@nortel.com \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=dvhltc@us.ibm.com \
    --cc=josh@joshtriplett.org \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@elte.hu \
    --cc=niv@us.ibm.com \
    --cc=nmiell@comcast.net \
    --cc=npiggin@suse.de \
    --cc=peterz@infradead.org \
    --cc=randy.dunlap@oracle.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox