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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5353C04A68 for ; Thu, 28 Jul 2022 19:21:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232841AbiG1TVg (ORCPT ); Thu, 28 Jul 2022 15:21:36 -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 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