mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Walker <dwalker@mvista.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Remy Bohmer <linux@bohmer.net>, Ingo Molnar <mingo@elte.hu>,
	LKML <linux-kernel@vger.kernel.org>,
	RT <linux-rt-users@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [RT] seqlocks: use of PICK_FUNCTION breaks kernel compile when CONFIG_GENERIC_TIME is NOT set
Date: Mon, 22 Oct 2007 11:53:03 -0700	[thread overview]
Message-ID: <1193079183.5028.65.camel@imap.mvista.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0710171133490.26554@gandalf.stny.rr.com>

On Wed, 2007-10-17 at 11:34 -0400, Steven Rostedt wrote:

> 
> Hmm, what about a __seq_irqsave_raw and __seq_nop?
> 
> That way it spells out that irqs are NOT touched if it is not a raw lock.

I took out the nop , and just did a save flags which makes sense.. There
is still more cleanup to do in that regard.

Signed-off-by: Daniel Walker <dwalker@mvista.com>

---
 include/linux/seqlock.h |   26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

Index: linux-2.6.23/include/linux/seqlock.h
===================================================================
--- linux-2.6.23.orig/include/linux/seqlock.h
+++ linux-2.6.23/include/linux/seqlock.h
@@ -92,8 +92,11 @@ static inline void __write_seqlock(seqlo
 
 static __always_inline unsigned long __write_seqlock_irqsave(seqlock_t *sl)
 {
+	unsigned long flags;
+
+	local_save_flags(flags);
 	__write_seqlock(sl);
-	return 0;
+	return flags;
 }
 
 static inline void __write_sequnlock(seqlock_t *sl)
@@ -280,26 +283,27 @@ do {								\
 	PICK_SEQ_OP(__write_sequnlock_irq_raw, __write_sequnlock, lock)
 
 static __always_inline
-unsigned long __read_seqbegin_irqsave_raw(raw_seqlock_t *sl)
+unsigned long __seq_irqsave_raw(raw_seqlock_t *sl)
 {
 	unsigned long flags;
 
 	local_irq_save(flags);
-	__read_seqbegin_raw(sl);
 	return flags;
 }
 
-static __always_inline unsigned long __read_seqbegin_irqsave(seqlock_t *sl)
+static __always_inline unsigned long __seq_irqsave(seqlock_t *sl)
 {
-	__read_seqbegin(sl);
-	return 0;
+	unsigned long flags;
+
+	local_save_flags(flags);
+	return flags;
 }
 
-#define read_seqbegin_irqsave(lock, flags)			\
-do {								\
-	flags = PICK_SEQ_OP_RET(__read_seqbegin_irqsave_raw,	\
-		__read_seqbegin_irqsave, lock);			\
-} while (0)
+#define read_seqbegin_irqsave(lock, flags)				\
+({									\
+	flags = PICK_SEQ_OP_RET(__seq_irqsave_raw, __seq_irqsave, lock);\
+	read_seqbegin(lock);						\
+})
 
 static __always_inline int
 __read_seqretry_irqrestore(seqlock_t *sl, unsigned iv, unsigned long flags)



  reply	other threads:[~2007-10-22 18:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1192632502.17527.129.camel@imap.mvista.com>
2007-10-17 15:10 ` Steven Rostedt
2007-10-17 15:24   ` Daniel Walker
2007-10-17 15:34     ` Steven Rostedt
2007-10-22 18:53       ` Daniel Walker [this message]
2007-10-16  8:35 Remy Bohmer
2007-10-16 16:52 ` Daniel Walker
2007-10-17 14:07   ` Remy Bohmer

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=1193079183.5028.65.camel@imap.mvista.com \
    --to=dwalker@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=linux@bohmer.net \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®