mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@steeleye.com>
To: mingo@elte.hu
Cc: linux-kernel@vger.kernel.org
Subject: [BK PATCH 2.5.6-pre2] fix task migration code boot hang
Date: Wed, 27 Feb 2002 15:17:12 -0600	[thread overview]
Message-ID: <200202272117.g1RLHCB05891@localhost.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 269 bytes --]

The task migration code of change set 1.373 actually only works on 
architectures where the physical and logical CPU numberings are the same. It 
they aren't, the boot sequence hangs forever. The attached fixes the code to 
work on all architectures.

James Bottomley


[-- Attachment #2: migrate.diff --]
[-- Type: text/plain , Size: 2802 bytes --]

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.425   -> 1.426  
#	      kernel/sched.c	1.51    -> 1.52   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/02/27	jejb@malley.hansenpartnership.com	1.426
# Fix new SMP migration thread code (introduced in change set 1.373)
# 
# - make migration_mask a logical bitmap with correct conversions.
# --------------------------------------------
#
diff -Nru a/kernel/sched.c b/kernel/sched.c
--- a/kernel/sched.c	Wed Feb 27 15:04:46 2002
+++ b/kernel/sched.c	Wed Feb 27 15:04:46 2002
@@ -1555,7 +1555,8 @@
 	down(&req.sem);
 }
 
-static volatile unsigned long migration_mask;
+/* NOTE: migration_mask is a bitmap of logical CPUs */
+static volatile unsigned long migration_mask = 0;
 
 static int migration_thread(void * unused)
 {
@@ -1585,7 +1586,8 @@
 
 	for (;;) {
 		preempt_disable();
-		if (test_and_clear_bit(smp_processor_id(), &migration_mask))
+		if (test_and_clear_bit(cpu_number_map(smp_processor_id()),
+				       &migration_mask))
 			current->cpus_allowed = 1 << smp_processor_id();
 		if (test_thread_flag(TIF_NEED_RESCHED))
 			schedule();
@@ -1656,7 +1658,7 @@
 	migration_mask = (1 << smp_num_cpus) - 1;
 
 	for (cpu = 0; cpu < smp_num_cpus; cpu++)
-		while (!cpu_rq(cpu)->migration_thread)
+		while (!cpu_rq(cpu_logical_map(cpu))->migration_thread)
 			schedule_timeout(2);
 	if (migration_mask)
 		BUG();
This BitKeeper patch contains the following changesets:
+
## Wrapped with gzip_uu ##


begin 664 bkpatch1387
M'XL(`(1+?3P``[55VX[;-A!]%K]BB@"%E<0R24F6[<+!-INT#=(DQB;[;-#2
MV%)6(A62MFO`'Y^1O,E>DF+;H)4(4Y?A.3-G#N5'<.G0SH*/^''%'L$?QOE9
MT*BZQD-4U9'SB'2)46X:>GUA#+T>-=K+4;=B]/SU:&<.:H-V**.44<A"^;R$
M'5HW"T04?WWB#RW.@HN7OU_^^>L%8_,YG)=*;_`]>IC/F3=VI^K"G2E?UD9'
MWBKM&O2J8SY^#3U*SB6=J<ABGHZ/8LR3[)B+0@B5""RX3";CA'6YG37;>F/5
M#J.!-AK#;T!D)M)DS"=''O-LREZ`B!(Y!BY'-&0&(IFEXQG/AIQ^.9PP3\H0
MDD/=*NLU%5I6;9<E/!$PY.PY_+>UG+,<?JO^`HU[>/]F`4U%5?G*:/"E155`
M;@J$0:6]-<4VQP(J#7E/`H[$I29D<4@@-(;0J"N\@5@VREV!@MILJES5L*I\
MHUK85[XD6&LQ]S3KKIL4[2+V&E*1"+:X:1X;_LN#,:XX>_:`2E=H-=8CEY=8
M1/EMJ:;Q])AD,I;'=+62L<AD/N9%C-/XX19]'U9FA)S&G#HPX:+WYMVXAPWZ
M(^FRIM(;<X:UQZC<_DUJJ90\%M,CGZ33I/=H*N]:-)W%_)];-(5A_+]8--^2
M7;2O#_?=53EH2ZL<&5.Y6U[+V^VUWR*@[\X>R66$XYIVV5J3HW/&+JMB$)X0
M#JY;1:%OD9"\@37MB6U+FZ"WN2<M06G:#34J2S<$9=;W<W&&XI7O%Q&W`XNM
M1=+)WTZK]_G)"^]@:/?](.,N[MGB!ZS_0J3I!`1[U<^2C1[#VW<?7LZ^(YKZ
MLANIC"_)G2\N'3P>,><I-H>=J6FN$;;:51M-NE`O-_>QYL!_Z8@GU\23CC@(
MJC4,/#J_)-66O6I+(AQ0_4N];59H:74[^+8=X5-:'`1P.GZ^2Q:&Q#1.ISW3
M:0Z"?=GE./BI@[:?>H;K@GH*N@_#X;,;H--W+;SY-R&Y\RNW;>9K*5?K9)6P
)SZ-TOJZW!@``
`
end

             reply	other threads:[~2002-02-27 21:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-27 21:17 James Bottomley [this message]
2002-02-27 21:29 ` Ingo Molnar

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=200202272117.g1RLHCB05891@localhost.localdomain \
    --to=james.bottomley@steeleye.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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®