public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Nyberg <alexn@dsv.su.se>
To: Ray Bryant <raybry@sgi.com>
Cc: Ray Bryant <raybry@austin.rr.com>, Andrew Morton <akpm@osdl.org>,
	lse-tech@lists.sourceforge.net,
	"Martin J. Bligh" <mbligh@aracnet.com>,
	Zwane Mwaikambo <zwane@linuxpower.ca>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] lockmeter: fixes
Date: Sun, 19 Sep 2004 13:15:06 +0200	[thread overview]
Message-ID: <1095592506.619.8.camel@boxen> (raw)
In-Reply-To: <20040916230344.23023.79384.49263@tomahawk.engr.sgi.com>

> Andrew,
> 
> The first patch in this series is a replacement patch for the prempt-fix
> patch I sent earlier this morning.  There was a missing paren in that
> previous version.
> 
> Adding this to 2.6.9-rc2-mm1 (just after lockmeter-2.patch) fixes the
> preempt compile problem on ia64, at least.  However, I then started 
> getting a missing symbol for generic_raw_read_trylock.  Hence the second
> patch of this series.

Hi Ray

I need the following to compile on x86-64, works fine otherwise.


--- mm/kernel/lockmeter.c.orig	2004-09-19 12:49:52.000000000 +0200
+++ mm/kernel/lockmeter.c	2004-09-19 12:50:25.000000000 +0200
@@ -1510,3 +1510,13 @@ int __lockfunc _spin_trylock_bh(spinlock
 	return 0;
 }
 EXPORT_SYMBOL(_spin_trylock_bh);
+
+int in_lock_functions(unsigned long addr)
+{
+	/* Linker adds these: start and end of __lockfunc functions */
+	extern char __lock_text_start[], __lock_text_end[];
+
+	return addr >= (unsigned long)__lock_text_start
+		&& addr < (unsigned long)__lock_text_end;
+}
+EXPORT_SYMBOL(in_lock_functions);
--- mm/include/asm-x86_64/spinlock.h.orig	2004-09-19 12:31:32.000000000 +0200
+++ mm/include/asm-x86_64/spinlock.h	2004-09-19 13:04:56.117109248 +0200
@@ -232,16 +232,6 @@ static inline void _raw_write_lock(rwloc
 #define _raw_read_unlock(rw)		asm volatile("lock ; incl %0" :"=m" ((rw)->lock) : : "memory")
 #define _raw_write_unlock(rw)	asm volatile("lock ; addl $" RW_LOCK_BIAS_STR ",%0":"=m" ((rw)->lock) : : "memory")
 
-static inline int _raw_read_trylock(rwlock_t *lock)
-{
-	atomic_t *count = (atomic_t *)lock;
-	atomic_dec(count);
-	if (atomic_read(count) < RW_LOCK_BIAS)
-		return 1;
-	atomic_inc(count);
-	return 0;
-}
-
 static inline int _raw_write_trylock(rwlock_t *lock)
 {
 	atomic_t *count = (atomic_t *)lock;
@@ -262,6 +252,16 @@ static inline int _raw_read_trylock(rwlo
 	atomic_inc(count);
 	return 0;
 }
+#else
+static inline int _raw_read_trylock(rwlock_t *lock)
+{
+	atomic_t *count = (atomic_t *)lock;
+	atomic_dec(count);
+	if (atomic_read(count) < RW_LOCK_BIAS)
+		return 1;
+	atomic_inc(count);
+	return 0;
+}
 #endif
 
 #if defined(CONFIG_LOCKMETER) && defined(CONFIG_HAVE_DEC_LOCK)
 


  parent reply	other threads:[~2004-09-19 11:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-16 23:03 [PATCH 0/3] lockmeter: fixes Ray Bryant
2004-09-16 23:03 ` [PATCH 1/3] lockmeter: fixed-up: lockmeter fixes for preempt case Ray Bryant
2004-09-16 23:04 ` [PATCH 2/3] lockmeter: lockmeter fix for generic_read_trylock Ray Bryant
2004-09-16 19:20   ` Zwane Mwaikambo
2004-09-16 23:38     ` Ray Bryant
2004-09-16 23:04 ` [PATCH 3/3] lockmeter: lockmeter fix for inline in_lock_functions() Ray Bryant
2004-09-17  7:31 ` [PATCH 0/3] lockmeter: fixes Christoph Hellwig
2004-09-17 18:52   ` Ray Bryant
2004-09-17 19:31     ` Christoph Hellwig
2004-09-19 11:15 ` Alexander Nyberg [this message]
2004-09-19 22:39   ` Ray Bryant

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=1095592506.619.8.camel@boxen \
    --to=alexn@dsv.su.se \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lse-tech@lists.sourceforge.net \
    --cc=mbligh@aracnet.com \
    --cc=raybry@austin.rr.com \
    --cc=raybry@sgi.com \
    --cc=zwane@linuxpower.ca \
    /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