Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758653AbYF1WRP (ORCPT ); Sat, 28 Jun 2008 18:17:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752285AbYF1WQ6 (ORCPT ); Sat, 28 Jun 2008 18:16:58 -0400 Received: from wa-out-1112.google.com ([209.85.146.177]:15986 "EHLO wa-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752177AbYF1WQ5 (ORCPT ); Sat, 28 Jun 2008 18:16:57 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=qTHDx1LpQLXJyvrYdjaHbXodljhbcrcu/kFIGuVlKVsvGoQZDGhHnvLnW2MsdGrljy 0E5PnV4xXf/3Fmh7zL3QbMXPDHBsX0p87SQec5UBR7dfhEEDHQUbZRzR0sChLb2+1I9H Ghwr6L0NYeZl2GKDLto0r+eLJWGSh3XyulaRk= Message-ID: Date: Sun, 29 Jun 2008 00:16:56 +0200 From: "Dmitry Adamushko" To: "Heiko Carstens" Subject: Re: [BUG] CFS vs cpu hotplug Cc: "Ingo Molnar" , "Peter Zijlstra" , "Avi Kivity" , linux-kernel@vger.kernel.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_12082_18711558.1214691416233" References: <20080619161949.GA11062@osiris.ibm.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7689 Lines: 133 ------=_Part_12082_18711558.1214691416233 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello, it seems to be related to migrate_dead_tasks(). Firstly I added traces to see all tasks being migrated with migrate_live_tasks() and migrate_dead_tasks(). On my setup the problem pops up (the one with "se == NULL" in the loop of pick_next_task_fair()) shortly after the traces indicate that some has been migrated with migrate_dead_tasks()). btw., I can reproduce it much faster now with just a plain cpu down/up loop. [disclaimer] Well, unless I'm really missing something important in this late hour [/desclaimer] pick_next_task() is not something appropriate for migrate_dead_tasks() :-) the following change seems to eliminate the problem on my setup (although, I kept it running only for a few minutes to get a few messages indicating migrate_dead_tasks() does move tasks and the system is still ok) [ quick hack ] @@ -5887,6 +5907,7 @@ static void migrate_dead_tasks(unsigned int dead_cpu) next = pick_next_task(rq, rq->curr); if (!next) break; + next->sched_class->put_prev_task(rq, next); migrate_dead(dead_cpu, next); } just in case, all the changes I've used for this test are attached "as is". p.s. perhaps I won't be able to verify it carefully till tomorrow's late evening. -- Best regards, Dmitry Adamushko ------=_Part_12082_18711558.1214691416233 Content-Type: text/x-diff; name=migration-experiment.patch Content-Transfer-Encoding: base64 X-Attachment-Id: f_fi0rskq50 Content-Disposition: attachment; filename=migration-experiment.patch ZGlmZiAtLWdpdCBhL2tlcm5lbC9jcHUuYyBiL2tlcm5lbC9jcHUuYwppbmRleCBjNzdiYzNhLi5k YjkyYzAxIDEwMDY0NAotLS0gYS9rZXJuZWwvY3B1LmMKKysrIGIva2VybmVsL2NwdS5jCkBAIC0x NSw2ICsxNSw4IEBACiAjaW5jbHVkZSA8bGludXgvc3RvcF9tYWNoaW5lLmg+CiAjaW5jbHVkZSA8 bGludXgvbXV0ZXguaD4KIAorZXh0ZXJuIGludCBzY2hlZF9jaGVja19vZmZsaW5lX2NwdShpbnQg Y3B1KTsKKwogLyogU2VyaWFsaXplcyB0aGUgdXBkYXRlcyB0byBjcHVfb25saW5lX21hcCwgY3B1 X3ByZXNlbnRfbWFwICovCiBzdGF0aWMgREVGSU5FX01VVEVYKGNwdV9hZGRfcmVtb3ZlX2xvY2sp OwogCkBAIC0yNDcsNyArMjQ5LDcgQEAgc3RhdGljIGludCBfX3JlZiBfY3B1X2Rvd24odW5zaWdu ZWQgaW50IGNwdSwgaW50IHRhc2tzX2Zyb3plbikKIAogCS8qIFRoaXMgYWN0dWFsbHkga2lsbHMg dGhlIENQVS4gKi8K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BFUlJPUjogKHRhc2spICVkIC0g JXNcbiIsIHAtPnBpZCwgcC0+Y29tbSk7CisJCQlyZXQgPSAxOworCQl9IGVsc2UgeworCQkJc3Ry dWN0IGNmc19ycSAqY2ZzX3JxX2NoaWxkID0gZ3JvdXBfY2ZzX3JxKHNlKTsKKworCQkJaWYgKGNm c19ycV9jaGlsZC0+bnJfcnVubmluZyB8fCBjZnNfcnFfY2hpbGQtPmxvYWQud2VpZ2h0KSB7CisJ CQkJcHJpbnRrKCIqIEVSUk9SOiAoZ3JvdXApICVsZCAtICVsZFxuIiwKKwkJCQkJY2ZzX3JxX2No aWxkLT5ucl9ydW5uaW5nLCBjZnNfcnFfY2hpbGQtPmxvYWQud2VpZ2h0KTsKKwkJCQljaGVja19j ZnNfdHJlZShjZnNfcnFfY2hpbGQpOworCQkJCXJldCA9IDE7CisJCQl9CisJCX0KKworCQluZXh0 ID0gbmV4dC0+bmV4dDsKKwl9IHdoaWxlIChuZXh0ICE9ICZjZnNfcnEtPnRhc2tzKTsKKworCXJl dHVybiByZXQ7Cit9CisKICNpZmRlZiBDT05GSUdfRkFJUl9HUk9VUF9TQ0hFRAogc3RhdGljIGlu dCBjZnNfcnFfYmVzdF9wcmlvKHN0cnVjdCBjZnNfcnEgKmNmc19ycSkKIHsK ------=_Part_12082_18711558.1214691416233-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/