From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 909B5C4346E for ; Thu, 24 Sep 2020 08:54:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4AD7623772 for ; Thu, 24 Sep 2020 08:54:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727316AbgIXIyr (ORCPT ); Thu, 24 Sep 2020 04:54:47 -0400 Received: from out30-44.freemail.mail.aliyun.com ([115.124.30.44]:35356 "EHLO out30-44.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727274AbgIXIyq (ORCPT ); Thu, 24 Sep 2020 04:54:46 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R661e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=xlpang@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0U9xKTdd_1600937682; Received: from xunleideMacBook-Pro.local(mailfrom:xlpang@linux.alibaba.com fp:SMTPD_---0U9xKTdd_1600937682) by smtp.aliyun-inc.com(127.0.0.1); Thu, 24 Sep 2020 16:54:43 +0800 Reply-To: xlpang@linux.alibaba.com Subject: Re: [PATCH RESEND] sched/fair: Fix wrong cpu selecting from isolated domain To: Vincent Guittot , Xunlei Pang Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Jiang Biao , Wetp Zhang , linux-kernel References: <1600930127-76857-1-git-send-email-xlpang@linux.alibaba.com> From: Xunlei Pang Message-ID: Date: Thu, 24 Sep 2020 16:54:42 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/24/20 3:18 PM, Vincent Guittot wrote: > On Thu, 24 Sep 2020 at 08:48, Xunlei Pang wrote: >> >> We've met problems that occasionally tasks with full cpumask >> (e.g. by putting it into a cpuset or setting to full affinity) >> were migrated to our isolated cpus in production environment. >> >> After some analysis, we found that it is due to the current >> select_idle_smt() not considering the sched_domain mask. >> >> Steps to reproduce on my 31-CPU hyperthreads machine: >> 1. with boot parameter: "isolcpus=domain,2-31" >> (thread lists: 0,16 and 1,17) >> 2. cgcreate -g cpu:test; cgexec -g cpu:test "test_threads" >> 3. some threads will be migrated to the isolated cpu16~17. >> >> Fix it by checking the valid domain mask in select_idle_smt(). >> >> Fixes: 10e2f1acd010 ("sched/core: Rewrite and improve select_idle_siblings()) >> Reported-by: Wetp Zhang >> Reviewed-by: Jiang Biao >> Signed-off-by: Xunlei Pang > > Reviewed-by: Vincent Guittot > Thanks, Vincent :-)