Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp694206imn; Thu, 28 Jul 2022 12:56:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR6zaUfr5GlDs/giXzPRM6mzqKuj2j4S3S7A98iWFVkAPyZsj97OVe17iwh3+AqwQO7yHSYJ X-Received: by 2002:a17:90b:1e03:b0:1f2:518a:8f78 with SMTP id pg3-20020a17090b1e0300b001f2518a8f78mr966865pjb.217.1659038175733; Thu, 28 Jul 2022 12:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659038175; cv=none; d=google.com; s=arc-20160816; b=O4LWB8YYXs1jG1GTCpJlgLe/FgudQb5/BofyzqGmDLW+R2T19sqs+AXUgCRCZHK8xj 9YK6KFKn1bcti4YY79gHT5OM970BQcq9wmnjr2fP/WZCLNiolKBM0j33yKEsNonWbRT4 z2+7OJwudMwNc1M2yYT6G9vKR+0ZKsbtSco3QhpuS/brtGB7mLSjLbjeBHj+Htsk2RWT zH1wfy6MXBSzJZ+t2xvGf/XhsJzH6Sojjp4UuSbMyrZhi4m2LC4gmB2c4uqUkON1zipJ oCyP/O69nm77a/2dM3r/d5+/IGElCm6waZZiuTVoKYo4W6xxF5gCMMSeprZp6qfQ6suc RMeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=zpAAXgdBuqbloSbXAkh13drsVm6WLwNgqwukGGREVlE=; b=mcg6OmAYiB1FG5deydHG3jvriU8oe49xBf8eXOco+sKCAY8XNovOl2T0Vzi9qyeblX TxH4WVdafYRexCKpnSN36JyPF9W2zyFXUul8cUSJg7y5eOMXsucXQAFkL1qaotxmE4om gaIe7akXSqaIGGbJizTPgtQHIxqoAOubij7/5hTmpS9/q0JdxxH75vFRVDxohq9r+2Bp J3Rxs6SeyWPtNGs4/+PwRejzbJgLvAT0r67zc5fDSPg0W9BK8HPbCDpRrShlh8r+H7RB SNfTsF7ZPVu0k13oS7stHWsDTuyNeXPcGSMeeqi3X8EWrVsSUAMql8RshXYhFvYc+/N2 nu6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KHZch7hJ; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t17-20020a056a00139100b0050dfedd9c62si1679787pfg.292.2022.07.28.12.55.59; Thu, 28 Jul 2022 12:56:15 -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=@redhat.com header.s=mimecast20190719 header.b=KHZch7hJ; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232519AbiG1TVf (ORCPT + 99 others); Thu, 28 Jul 2022 15:21:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229570AbiG1TVe (ORCPT ); Thu, 28 Jul 2022 15:21:34 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 704DF1A05E for ; Thu, 28 Jul 2022 12:21:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659036092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zpAAXgdBuqbloSbXAkh13drsVm6WLwNgqwukGGREVlE=; b=KHZch7hJ0on2vocLX9+l/uVQU0lBI3+nSeec8YG2W6I252NjFdRp1ipqoSWHlBL3FnyYXq nPwcu7sdoPjxW0WEUnEI1lkmbIXdo8BvjFksbBImI41laGmuHQFSXRihxS2oBwcV8oapB9 +xnK60knnWthxPmYoWY3LpzDhVbAYhU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-591-jSAs81R-P-yYNJnPyJpCMg-1; Thu, 28 Jul 2022 15:21:28 -0400 X-MC-Unique: jSAs81R-P-yYNJnPyJpCMg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A82A2185A79C; Thu, 28 Jul 2022 19:21:27 +0000 (UTC) Received: from [10.22.9.86] (unknown [10.22.9.86]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9EB8492C3B; Thu, 28 Jul 2022 19:21:26 +0000 (UTC) Message-ID: <606ed69e-8ad0-45d5-9de7-48739df7f48d@redhat.com> Date: Thu, 28 Jul 2022 15:21:26 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 1/2] cgroup/cpuset: Keep current cpus list if cpus affinity was explicitly set Content-Language: en-US To: Tejun Heo 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 References: <20220728005815.1715522-1-longman@redhat.com> <1ae1cc6c-dca9-4958-6b22-24a5777c5e8d@redhat.com> From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 On 7/28/22 15:02, Tejun Heo wrote: > Hello, > > On Thu, Jul 28, 2022 at 02:57:28PM -0400, Waiman Long wrote: >> There can be a counter argument that if a user found out that there is not >> enough cpus in a cpuset to meet its performance target, one can always >> increase the number of cpus in the cpuset. Generalizing this behavior to all >> the tasks irrespective if they have explicitly set cpus affinity before will >> disallow this use case. > This is nasty. That is a nasty example, I know. There may be users depending on the existing behavior even if they don't know it. So I am a bit hesitant to change the default behavior like that. On the other hand, tasks that have explicitly set its cpu affinity certainly don't want to have unexpected change to that. > The real solution here is separating out what user requested > and the mask that cpuset (or cpu hotplug) needs to apply on top. ie. > remember what the user requested in a separate cpumask and compute the > intersection into p->cpus_maks whenever something changes and apply > fallbacks on that final mask. Multiple parties updating the same variable is > never gonna lead to anything consistent and we're patching up for whatever > the immediate use case seems to need at the moment. That said, I'm not > necessarily against patching it up but if you're interested in delving into > it deeper, that'd be great. I believe the current code is already restricting what cpu affinity that a user can request by limiting to those allowed by the current cpuset. Hotplug is another issue that may need to be addressed. I will update my patch to make it handle hotplug in a more graceful way. Thanks, Longman