Received: by 2002:ac0:b7d5:0:0:0:0:0 with SMTP id v21csp12862ime; Thu, 28 Jul 2022 15:11:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR5DO3U/5OuSbZcaAByCrctsWTdip8u8oDrcuCPm5igxtDZLgTRdNUcBgMt3SgUYWDv+NcIn X-Received: by 2002:a17:902:e747:b0:16c:3ffd:61e4 with SMTP id p7-20020a170902e74700b0016c3ffd61e4mr952313plf.12.1659046315465; Thu, 28 Jul 2022 15:11:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659046315; cv=none; d=google.com; s=arc-20160816; b=aSMxlddMFJ2vt2BGFnfZB8Q2rV8VJnjfhZLVl0zqu+p+i9jFlQzu+e7FyoIR3WDMtt x4dCC5XiVwHeiz5UiwUSNiXIP230g40/Dgyd1rB4n9/ciU+ABqHBkaOjsa7yqKNu4Rff QKrABE9ZaFGjzXN21LkaynJneEz8BF7Y4iFfzpp98AoTF2zAl8OiLYMDO4CuChl7L0OJ Kwa1tzoBqHgJJvgnpCC+Gx/CsR0JiLRG3q/RCro2WAvOQEAtGAACrtcm8kWp+0Ez2qDE 14UFryChbazD3XqwQmrGcg5vcvEjorZPZtIkghwp340N191isdLqp7WMNKTEK7x1pih4 XC7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=0lIhra6yGQrlkyIbM2bnb9XhkYHXW96sQs23+tnYMHU=; b=lpTzlJdCoWi3SKfnSi3an2wHjR2g2YcnMMZsvNamY5EKozksEuOVZQQSscgDQYksoY FaepZS9EBPmHinpm99pwSnsYsSUwtPHX9gYSlON0ncVg80Qf0n/zF9ySC86iPw7ntyUz oAP8YFBT+9iFNN+WYdeIm+zFq/Y4bDkNshjeKpLgYpwvKmQVSfppwMZPtNMb1ewnDPks 5p7pfoRZGWTe9CdVWfY0oUeXbbvxwX8S1F1drVyi2ieomFJFWUAPJJsqrzUYeuxxweC4 Q6d/v06d5Ip2wbYIxVAwjveCOeyYJmmWjaoGatcnHXA8an/19WriqCH+uvT8C3/oelVT Wh0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bMTdPhbS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q4-20020a17090311c400b0016bdd5f7092si2444017plh.414.2022.07.28.15.11.41; Thu, 28 Jul 2022 15:11:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bMTdPhbS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231233AbiG1Vjb (ORCPT + 99 others); Thu, 28 Jul 2022 17:39:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbiG1Vj2 (ORCPT ); Thu, 28 Jul 2022 17:39:28 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D372152470; Thu, 28 Jul 2022 14:39:24 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id e8-20020a17090a280800b001f2fef7886eso3452529pjd.3; Thu, 28 Jul 2022 14:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc; bh=0lIhra6yGQrlkyIbM2bnb9XhkYHXW96sQs23+tnYMHU=; b=bMTdPhbS4m1DiyFWNkkBtZa1qNMP0zCUSede5bxmA3r7760mQ3YV3FcYK0DUHenJXn 1wA0avWFIn0aX1lTswRj4MICETJAiKoPkD7IIneoaJ9Cr6a+pERInxXKcjPByREiIom7 nJKbTeYpyMRnBzxz2TmUMuotGG7kViVgVm9vTC3n7TaalPpopl+QoL2njeOUfEkPIiEP iov33KDjYhfXS+Qb+rXWVtJnPldHSKC1iLQrMuMbJWbMOcAxTf1cDl35Rnotadymwqp9 TylyVen9uEcpdDbAqQHCOxFPFze21b0ZJ8us7LrmsVP1+4NzXD5hAQE8ZLJdmROwzBgY m6ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc; bh=0lIhra6yGQrlkyIbM2bnb9XhkYHXW96sQs23+tnYMHU=; b=3aUqsWGvxffLhIrnG3xnywQipcG2nkcALOCI3Jd/vTnEeX3BIC042UdGbKt5l8DiK3 OjNajz/0RJ/4Rz3mQOFCN2+aU1r4mASucMu9iv8+qitHORmrkahBHT3bcP3zVeaE5o3q ufCAhU7Qoit4/Le2w8VTOciHS0AaS8HBcAak/NYtzU12IEw2dYvge9/zm7f9/Kocz0Cq 7qt+ngZrq/iLlNoY5coMDASAR6rWXg6IsdHITVuPLjd6MFoJFKQbC7byGkRqWgs0UJO4 WDECo6mXcAo2Skwy3XyWy84Qs0BSbNPCutdPk9A+ydZkuZ3j/qztfLw0oDWCSnIHoe74 Ti9w== X-Gm-Message-State: ACgBeo2HfiS2tI47uGONR2d1Mus8mSuoHCIT8m15CV4z1vdgeS2xrERK ANqApFbt/34pN+wxpxEKqE0= X-Received: by 2002:a17:902:ab0f:b0:16d:b340:bf8f with SMTP id ik15-20020a170902ab0f00b0016db340bf8fmr844650plb.140.1659044364093; Thu, 28 Jul 2022 14:39:24 -0700 (PDT) Received: from localhost ([2620:10d:c090:400::5:23b6]) by smtp.gmail.com with ESMTPSA id w71-20020a62824a000000b005252defb016sm1230951pfd.122.2022.07.28.14.39.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jul 2022 14:39:21 -0700 (PDT) Sender: Tejun Heo Date: Thu, 28 Jul 2022 11:39:19 -1000 From: Tejun Heo To: Waiman Long Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Zefan Li , Johannes Weiner , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] cgroup/cpuset: Keep current cpus list if cpus affinity was explicitly set Message-ID: References: <20220728005815.1715522-1-longman@redhat.com> <1ae1cc6c-dca9-4958-6b22-24a5777c5e8d@redhat.com> <606ed69e-8ad0-45d5-9de7-48739df7f48d@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Waiman. On Thu, Jul 28, 2022 at 05:04:19PM -0400, Waiman Long wrote: > > So, the patch you proposed is making the code remember one special aspect of > > user requested configuration - whether it configured it or not, and trying > > to preserve that particular state as cpuset state changes. It addresses the > > immediate problem but it is a very partial approach. Let's say a task wanna > > be affined to one logical thread of each core and set its mask to 0x5555. > > Now, let's say cpuset got enabled and enforced 0xff and affined the task to > > 0xff. After a while, the cgroup got more cpus allocated and its cpuset now > > has 0xfff. Ideally, what should happen is the task now having the effective > > mask of 0x555. In practice, tho, it either would get 0xf55 or 0x55 depending > > on which way we decide to misbehave. > > OK, I see what you want to accomplish. To fully address this issue, we will > need to have a new cpumask variable in the the task structure which will be > allocated if sched_setaffinity() is ever called. I can rework my patch to > use this approach. Yeah, we'd need to track what user requested separately from the currently effective cpumask. Let's make sure that the scheduler folks are on board before committing to the idea tho. Peter, Ingo, what do you guys think? Thanks. -- tejun