linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yasunori Goto <y-goto@jp.fujitsu.com>
To: Linux Kernel ML <linux-kernel@vger.kernel.org>,
	linux-ia64@vger.kernel.org, linux-mm <linux-mm@kvack.org>,
	Benjamin LaHaise <bcrl@kvack.org>
Cc: Andrew Morton <akpm@osdl.org>, "Luck, Tony" <tony.luck@intel.com>
Subject: 2.6.15-rc5-mm2 can't boot on ia64 due to changing on_each_cpu().
Date: Thu, 15 Dec 2005 11:37:37 +0900	[thread overview]
Message-ID: <20051215103344.241C.Y-GOTO@jp.fujitsu.com> (raw)

Hello.

I met a trouble in 2.6.15-rc5-mm2 on my ia64 box. (Tiger4)
The trouble was kernel panic at early boot time due to calling
strange instruction "break 0" at smp_flush_tlb_all().

I investigated its cause and realized that gcc warned following 
messages.
  "arch/ia64/kernel/smp.c:228 Warning: function called through a non-
   compatible type"
  "arch/ia64/kernel/smp.c:228: note: if this code is reached,
   the program will abort"
  "arch/ia64/kernel/smp.c:251 Warning: function called through a non-
   compatible type"
  "arch/ia64/kernel/smp.c:251: note: if this code is reached,
   the program will abort"

The line 228 and 251 are calling on_each_cpu(). And the last
instruction of this function was "break 0" indeed.

void
smp_flush_tlb_all (void)
{
	on_each_cpu((void (*)(void *))local_flush_tlb_all, NULL, 1, 1);
}


void
smp_flush_tlb_mm (struct mm_struct *mm)
{
             :
             :
	 */
	on_each_cpu((void (*)(void *))local_finish_flush_tlb_mm, mm, 1, 1);
}

When I removed following patch which is in 2.6.15-rc5-mm2,
which changes on_each_cpu() from static inline function to macro,
then there was no warning, and kernel could boot up.
So, I guess that gcc was not able to solve a bit messy cast
for calling function "local_flush_tlb_all()" due to its change.

Thanks.

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

From: Benjamin LaHaise <bcrl@kvack.org>

An inline function in smp.h introduces messy ordering requirements on
thread_info by way of using an inline function instead of macro.  Convert
on_each_cpu to a macro in order to avoid a big include mess.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 include/linux/smp.h |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diff -puN include/linux/smp.h~untangle-smph-vs-thread_info include/linux/smp.h
--- 25/include/linux/smp.h~untangle-smph-vs-thread_info	Fri Dec  9 15:16:46 2005
+++ 25-akpm/include/linux/smp.h	Fri Dec  9 15:16:46 2005
@@ -57,19 +57,20 @@ extern int smp_call_function (void (*fun
 			      int retry, int wait);
 
 /*
- * Call a function on all processors
+ * Call a function on all processors.
+ * This needs to be a macro to allow for arch specific dependances on
+ * sched.h in preempt_*().
  */
-static inline int on_each_cpu(void (*func) (void *info), void *info,
-			      int retry, int wait)
-{
-	int ret = 0;
-
-	preempt_disable();
-	ret = smp_call_function(func, info, retry, wait);
-	func(info);
-	preempt_enable();
-	return ret;
-}
+#define on_each_cpu(func, info, retry, wait)			\
+({								\
+	int _ret = 0;						\
+								\
+	preempt_disable();					\
+	_ret = smp_call_function(func, info, retry, wait);	\
+	(func)(info);						\
+	preempt_enable();					\
+	_ret;							\
+})
 
 #define MSG_ALL_BUT_SELF	0x8000	/* Assume <32768 CPU's */
 #define MSG_ALL			0x8001
_

-- 
Yasunori Goto 


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

             reply	other threads:[~2005-12-15  2:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-15  2:37 Yasunori Goto [this message]
2005-12-15  2:56 ` Andrew Morton
2005-12-15  3:00   ` Benjamin LaHaise
2005-12-15  5:24     ` Kenji Kaneshige
2005-12-15  6:34       ` Yasunori Goto
2005-12-15 15:41         ` Matthew Wilcox
2005-12-15 14:28       ` Benjamin LaHaise
2005-12-15 17:24 Luck, Tony

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=20051215103344.241C.Y-GOTO@jp.fujitsu.com \
    --to=y-goto@jp.fujitsu.com \
    --cc=akpm@osdl.org \
    --cc=bcrl@kvack.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=tony.luck@intel.com \
    /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