From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A18F20ED for ; Wed, 18 Dec 2024 07:19:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734506392; cv=none; b=r3/HYDDOh9o1wSWmmnhto0Ovm8iAv1LKkz+7dnXBhcGF9LUSx3abfAQFkj0Y8OjzUnLGEJZFcmoEAkQXkvJjiZdywvbspGvU55sQEoZeELMrAeG+7gWlmwgTmFMk252BBqkX2Kg6ag5URjBrGj5RNDpVwbWuseWCEUrrVaL/UeE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734506392; c=relaxed/simple; bh=RivJOUif4EtXDrBan4hw2sSddAQ601xw9YjGx7qIW8E=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qQ0MsxKGHLWB3TWP8y2axOov3Ek2EiWPc6lf2l7u/ZedGlsix+30m8a9GNtpeA5MVTIO5ifnAL1Vq2ZD2RZG/bz7RmwzNspLimMYYkZ9u05HZo+2qZznkYWIjZOgMdVKht3Ld9xSRfzVQjcsQEcxi04mOuHRKHfqW0j/4pAlyiQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=ZFTj/ZRX; arc=none smtp.client-ip=209.85.210.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="ZFTj/ZRX" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-725dc290c00so359909b3a.0 for ; Tue, 17 Dec 2024 23:19:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1734506390; x=1735111190; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=jyMzWBrz0IQAW0YNRAPfVzKwnBvKPCLiP+I9SgueOgQ=; b=ZFTj/ZRXl/RJu/tApK1/jTsSJXrdFCrragCdLBgn6n00yEhshBlsdprS0uZ5xtfOm1 hM1tbZ50NcKspgpo36ZQHEjCwfqAuaIOI+VQC/5HqFoHP/8PG+wq6U62kmv60+jwVnvW +G35h4JV2vxZG28a0adt3py7hxyGxIrB8Xs6wvFygoJGWvldGzUInqvX5ei/HvlZNDvW 4rWcbpIaQNACyAsZZv1LCc9rkDFqWp3HfR7ajIY8iBF8Wr03oeRH4froc/TpP00Z8StJ 94RvaiN0pQMnWmMaiPrAkzC//rv6IK3rKm5rW4msK5CavltqQBfSnem9Q/7J7Xdi181R 7v5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734506390; x=1735111190; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=jyMzWBrz0IQAW0YNRAPfVzKwnBvKPCLiP+I9SgueOgQ=; b=gb5I6vcnIiOcoVONYlLxpZ78e6gJZ+kjX/65eaZ3Hrk7j6kjuodJUJ8MHRXxBOScGL /B3/Z+K3uulZkuof+mb3QCmO55w7EU6bom5UKjfOMZG+8/nQLeJCYWr+TF+WKAF7c7sJ 1+iZHTq/CdMAqrikFI2zOzjSTOjK5g1yVMA+Sj+BxF1NUyV/ABZZarWsxS35Cg+iz3Nh 12FSugR1TssF8xh2dwhDPCmZS1vl9kxa1cCZ8WfdI2ucG2HTVS5y4TqTYvfu0bRfy43S 9qjyRAF9wMFJoZOd1plXjlhtTCma25fipXxvAm3zIaw86G+O1YAP5VDwLBdZUPsCQ6OL ODMQ== X-Forwarded-Encrypted: i=1; AJvYcCWSbqQ5uikcnQpGnX/8Iu5qk/RIbrR/xcKH43w2EwRPVj0Lu3EMkA6jkVopLuGoVDg6obZ1h32anMNxpOc=@vger.kernel.org X-Gm-Message-State: AOJu0YziwufUDm7SLcQ5pHAT7Dris8Fq/xYOZIhaXxiONqGS7RpQLNvn QYoGUOuDTyoUYGXTTPnfQFeJUil8EFr5MgFe6FJa1L7pu3njq2heEroQeQ/UKZo= X-Gm-Gg: ASbGncuLJLDSjAcOjxhCOwvnsurMt9qr5dwRe8HvV6bbT2tZwNYgdFq+5ZlZLQh370T QIO2T7FhO1XBPnN2xhEu15EP44rLbjG5eleyqVrvjSlgAtCigQB+jN1VOxKl9YALY9IU4twT/0F 7gwkkQKrKo+4m2wqsZJUWsnmlh48JyJMxCZWxa5ghDRDKeiWE/wWvnEy1NnQCKyidftxjcPoT3S 6PGgES8DfNwaHfrZ/zWT0fdixylOQcEJsCWBJ3SsnUMpyBC7bmc9gg5pz4V2S3ukm4ybXxFjRb+ YQ== X-Google-Smtp-Source: AGHT+IFL1S5NbZKKXXWylT2aahzncSTJXZD5o5M0ETQv18UDfHN9zGM9ODF9eVCLSED2OMIUaM671A== X-Received: by 2002:a05:6a21:7887:b0:1e1:e1c0:1c05 with SMTP id adf61e73a8af0-1e4e77338a6mr8691043637.9.1734506389793; Tue, 17 Dec 2024 23:19:49 -0800 (PST) Received: from [10.4.165.108] ([139.177.225.243]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-801d5a90b93sm6845168a12.5.2024.12.17.23.19.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Dec 2024 23:19:49 -0800 (PST) Message-ID: <1c7a042e-65e9-4774-a769-55b3c01af181@bytedance.com> Date: Wed, 18 Dec 2024 15:19:43 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [External] Re: [PATCH 2/3] sched/fair: Ignore isolated cpus in update_numa_stat To: K Prateek Nayak , mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com Cc: chengming.zhou@linux.dev, linux-kernel@vger.kernel.org References: <20241216122357.1276382-1-zhouchuyi@bytedance.com> <20241216122357.1276382-3-zhouchuyi@bytedance.com> <92168453-ecf0-4849-970d-4c19a5a610dc@amd.com> From: Chuyi Zhou In-Reply-To: <92168453-ecf0-4849-970d-4c19a5a610dc@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hello Prateek 在 2024/12/18 14:26, K Prateek Nayak 写道: > Hello Chuyi, > > On 12/16/2024 5:53 PM, Chuyi Zhou wrote: >> [..snip..] @@ -2125,6 +2125,11 @@ static void update_numa_stats(struct >> task_numa_env *env, >>       for_each_cpu(cpu, cpumask_of_node(nid)) { > > Looking at sched_init_domains(), we only build sched domains only for > active CPUs in housekeeping_cpumask(HK_TYPE_DOMAIN) so similar to the > question on Patch 3, can we get away with just modifying this outer loop > to: > >     for_each_cpu_and(cpu, cpumask_of_node(nid), > housekeeping_cpumask(HK_TYPE_DOMAIN)) { >         ... >     } > > Thoughts? > We now have two ways of using isolated CPUs. One is the isolcpus= kernel command line. 'isolcpus=0-7' would exclude 0-7 cpus from housekeeping_cpumask without further restrictions on tasks' cpumasks. A typical case that could lead to errors is when a task's CPU mask covers all the CPUs in the system, causing the task to potentially be migrated to or woken up on CPUs 0-7. Commit 23d04d8 resolves a similar issue in task wakeup. The other is the isolated cpuset partition: mkdir blue echo 5-8 > blue/cpuset.cpus echo "isolated" > blue/cpuset.cpus.partition The 5-8 cpus now is also a isolated domain, but 5-8 would not be excluded from housekeeping_cpumask. The tasks' cpumask in blue cgroup would be restricted to 5-8. I thinks in update_numa_stats(), only using housekeeping_cpumask(HK_TYPE_DOMAIN) is not enough because it cannot skip those isolated cpuset partitions. Thanks.