public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@us.ibm.com>
To: Dipankar Sarma <dipankar@in.ibm.com>
Cc: linux-kernel@vger.kernel.org, shemminger@osdl.org,
	manfred@colorfullife.com, bunk@stusta.de
Subject: Re: [RFC,PATCH 2/4] Deprecate synchronize_kernel, GPL replacement
Date: Sun, 3 Apr 2005 11:50:16 -0700	[thread overview]
Message-ID: <20050403185016.GB1481@us.ibm.com> (raw)
In-Reply-To: <20050403085650.GA4563@in.ibm.com>

On Sun, Apr 03, 2005 at 02:26:50PM +0530, Dipankar Sarma wrote:
> On Sat, Apr 02, 2005 at 10:21:50PM -0800, Paul E. McKenney wrote:
> > The synchronize_kernel() primitive is used for quite a few different
> > purposes: waiting for RCU readers, waiting for NMIs, waiting for interrupts,
> > and so on.  This makes RCU code harder to read, since synchronize_kernel()
> > might or might not have matching rcu_read_lock()s.  This patch creates
> > a new synchronize_rcu() that is to be used for RCU readers and a new
> > synchronize_sched() that is used for the rest.  These two new primitives
> > currently have the same implementation, but this is might well change
> > with additional real-time support.  Both new primitives are GPL-only,
> > the old primitive is deprecated.
> > 
> > Signed-off-by: <paulmck@us.ibm.com>
> > ---
> > Depends on earlier "Add deprecated_for_modules" patch.
> > 
> > +/*
> > + * Deprecated, use synchronize_rcu() or synchronize_sched() instead.
> > + */
> > +void synchronize_kernel(void)
> > +{
> > +	synchronize_rcu();
> > +}
> > +
> 
> We should probably mark it deprecated - 
> 
> void __deprecated synchronize_kernel(void)
> {
> 	synchronize_rcu();
> }

Hello, Dipankar,

That was the first thing I tried.  ;-)

When I did that, I got a "deprecated" warning from gcc on the
EXPORT_SYMBOL() later in that same file.  After futzing around a
bit, I hit on the compromise of marking the rcupdate.h declaration
of synchronize_kernel() as "__deprecated_for_modules".

That said, you are quite right that it would be better if gcc also gave
the "deprecated" warning for use of synchronize_kernel() within in-tree
non-module code.  I suppose I could do something like the following
before the #includes in rcupdate.c:

	#define SUPPRESS_DEPRECATION_OF_SYNCHRONIZE_KERNEL

and then something like this in rcupdate.h:

	#ifdef SUPPRESS_DEPRECATION_OF_SYNCHRONIZE_KERNEL
	extern void synchronize_kernel(void);
	#else /* #ifdef SUPPRESS_DEPRECATION_OF_SYNCHRONIZE_KERNEL */
	extern __deprecated void synchronize_kernel(void);
	#endif /* #else #ifdef SUPPRESS_DEPRECATION_OF_SYNCHRONIZE_KERNEL */

but this seemed a bit ugly at the time.  Maybe it is worthwhile.

I couldn't find any way to suppress the "deprecated" warning that is
generated by the "&sym" in the last line of the __EXPORT_SYMBOL()
macro.  Anyone know a way of doing this?  There doesn't seem to me
to be any point to giving the warning on the EXPORT_SYMBOL() -- and
it does clutter up compiler output with useless "deprecated" warnings.

						Thanx, Paul

  reply	other threads:[~2005-04-03 18:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-03  6:21 [RFC,PATCH 2/4] Deprecate synchronize_kernel, GPL replacement Paul E. McKenney
2005-04-03  8:56 ` Dipankar Sarma
2005-04-03 18:50   ` Paul E. McKenney [this message]
2005-04-03 22:26     ` Arnd Bergmann
2005-04-04 21:13       ` Paul E. McKenney
2005-04-03 14:11 ` Michael Ellerman
2005-04-03 18:54   ` Paul E. McKenney

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=20050403185016.GB1481@us.ibm.com \
    --to=paulmck@us.ibm.com \
    --cc=bunk@stusta.de \
    --cc=dipankar@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=shemminger@osdl.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