Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2220053iob; Thu, 5 May 2022 19:30:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybIvdpvAWBVXSURMRdF9/qd2g20SeAAw/g+vaxcwsEnSzf6K5d8hodZ5TwUOnprT89Dnvu X-Received: by 2002:a17:907:9494:b0:6f3:edd4:cd55 with SMTP id dm20-20020a170907949400b006f3edd4cd55mr991731ejc.768.1651804228134; Thu, 05 May 2022 19:30:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651804228; cv=none; d=google.com; s=arc-20160816; b=h2XicxqZHZ3Ol7F/i+Rh6anIVqXkeCEQ8acYxhoZrAwQbAA1jARtZtOHunOPBDefR4 uNRrH6sU3m4r1pp9lL3WUHyA1H467Ovolo0pbRC5NM5C3uTFNoW/n+AuEYEsnsM7/82+ NWccjx0OeAmyr9FexsZehSG1YsRcDNO4/C01L9iwV9KZ4HsOZL3NUZrDVqFcaLpXsjvr 8Hwo7Mzp8t/MO2t7yKzG1ccBE4hLhRDiEb6Q/Nor5RCjlJAPrVRMBRsi603kSy2jaWdq i0TNuSDXdeHayd5fc7cuCux/arWUXPOtkK9ms/XDJfzkzIPe4YXQrqTe+rudKZ5iXdKQ eMeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=A/CHAf2jvhDCdKp394HpPEU/UHXmBVMIuCgm7VdwCAk=; b=I04IJEtN/Uu9VDxcw6GYzqdEPvGQKQbODC6nod58y0fHXGmoTClxrPoNNasEc2ANRU wQmK4WmqjF3GZNEVIfNAmkeX74/94q8G4gbvotXi5AEMDAnf/Oxc5Iwd4Drqlv22r7yc lbVTatZSsWDroLHGGaT/jsoOSoht3ep1FBVxcRt5hGwugqWDRrWwy5aSfFUGJWspNQFP rgVWVkA/Dup4fwgb1fpszrpZcNDY8W5RDDVV8P2/OLOS2Ap7JlvU16nPrcb3ZkK1VPHh +bBhJP38bN77CMEFZCH/mIjFEysXQfiZMrk1LeggKbi2EX8TaIrU6pZUA/oDRhEZPeDh zsDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eyadiAhy; 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 p6-20020a170906228600b006e82ffe65b6si3750931eja.935.2022.05.05.19.30.04; Thu, 05 May 2022 19:30:28 -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=eyadiAhy; 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 S1377227AbiEDSkG (ORCPT + 99 others); Wed, 4 May 2022 14:40:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377331AbiEDSjq (ORCPT ); Wed, 4 May 2022 14:39:46 -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 D7C7B271D for ; Wed, 4 May 2022 11:33:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651689202; 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: in-reply-to:in-reply-to:references:references; bh=A/CHAf2jvhDCdKp394HpPEU/UHXmBVMIuCgm7VdwCAk=; b=eyadiAhyFXMl6xR/aZLfJ9dB+YYlFmTCIZtDAWYt387hJ8m7F7GT2EgXRDwTtWN+UycDwS MizNA7oTcMq7lDFQNUBQkf9TB6RPWisxV5YyOG0ZLEMv6YWAkqSipyZJOuP236Zok1dLvy DUcXnJ37arHXxX7bpvRb6ZWNtX72wkQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-191-0y36m28zN3OwZyQaO0WW8Q-1; Wed, 04 May 2022 14:33:16 -0400 X-MC-Unique: 0y36m28zN3OwZyQaO0WW8Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 30619397969A; Wed, 4 May 2022 18:33:12 +0000 (UTC) Received: from [10.18.17.215] (dhcp-17-215.bos.redhat.com [10.18.17.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7701140CF8EF; Wed, 4 May 2022 18:33:11 +0000 (UTC) Content-Type: multipart/mixed; boundary="------------jCz2Xk9HZ5nWhl7YWm0gKoKD" Message-ID: Date: Wed, 4 May 2022 14:33:11 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v10 0/8] cgroup/cpuset: Major cpu partition code restructuring Content-Language: en-US To: =?UTF-8?Q?Michal_Koutn=c3=bd?= Cc: Tejun Heo , Zefan Li , Johannes Weiner , Jonathan Corbet , Shuah Khan , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, Andrew Morton , Roman Gushchin , Phil Auld , Peter Zijlstra , Juri Lelli , Frederic Weisbecker , Marcelo Tosatti References: <20220503162149.1764245-1-longman@redhat.com> <20220504112801.GB15266@blackbody.suse.cz> From: Waiman Long In-Reply-To: <20220504112801.GB15266@blackbody.suse.cz> X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Spam-Status: No, score=-5.9 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,T_SCC_BODY_TEXT_LINE 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 This is a multi-part message in MIME format. --------------jCz2Xk9HZ5nWhl7YWm0gKoKD Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 5/4/22 07:28, Michal Koutný wrote: > Hello. > > On Tue, May 03, 2022 at 12:21:41PM -0400, Waiman Long wrote: >> v10: >> - Relax constraints for changes made to "cpuset.cpus" >> and "cpuset.cpus.partition" as suggested. Now almost all changes >> are allowed. > I see there were also some other changes from v9 (like the first patches > of series). > Any chance you have a public git repo with both versions for a > convenient range-diff? That is true. Both patches 1 and 2 are new and the changes are pretty straight forward. Patch 1 of v9 has been merged with a latent bug. Patch 4 of this series is a replacement of patch 3 "cgroup/cpuset: Refining features and constraints of a  partition" of v9. The other patches are similar to their versions in v9 with some adjustment based on the different code base. I don't have a public repo. Attached is the file diff between v9 and v10 in cpuset.c with some other unrelated cpuset patches included. Cheers, Longman --------------jCz2Xk9HZ5nWhl7YWm0gKoKD Content-Type: text/x-patch; charset=UTF-8; name="cpuset.c.v9.diff" Content-Disposition: attachment; filename="cpuset.c.v9.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2tlcm5lbC9jZ3JvdXAvY3B1c2V0LmMgYi9rZXJuZWwvY2dyb3VwL2Nw dXNldC5jCmluZGV4IDg3MDNhODQ1MmMzMy4uOTBlZTBlNGQ4ZDdlIDEwMDY0NAotLS0gYS9r ZXJuZWwvY2dyb3VwL2NwdXNldC5jCisrKyBiL2tlcm5lbC9jZ3JvdXAvY3B1c2V0LmMKQEAg LTcxLDcgKzcxLDcgQEAgREVGSU5FX1NUQVRJQ19LRVlfRkFMU0UoY3B1c2V0c19lbmFibGVk X2tleSk7CiAKIC8qCiAgKiBUaGVyZSBjb3VsZCBiZSBhYm5vcm1hbCBjcHVzZXQgY29uZmln dXJhdGlvbnMgZm9yIGNwdSBvciBtZW1vcnkKLSAqIG5vZGUgYmluZGluZywgYWRkIHRoaXMg a2V5IHRvIHByb3ZpZGUgYSBxdWljayBsb3ctY29zdCBqdWRnZW1lbnQKKyAqIG5vZGUgYmlu ZGluZywgYWRkIHRoaXMga2V5IHRvIHByb3ZpZGUgYSBxdWljayBsb3ctY29zdCBqdWRnbWVu dAogICogb2YgdGhlIHNpdHVhdGlvbi4KICAqLwogREVGSU5FX1NUQVRJQ19LRVlfRkFMU0Uo Y3B1c2V0c19pbnNhbmVfY29uZmlnX2tleSk7CkBAIC05MywxNiArOTMsMjAgQEAgZW51bSBw cnNfZXJyY29kZSB7CiAJUEVSUl9JTlZDUFVTLAogCVBFUlJfSU5WUEFSRU5ULAogCVBFUlJf Tk9UUEFSVCwKKwlQRVJSX05PVEVYQ0wsCiAJUEVSUl9OT0NQVVMsCiAJUEVSUl9IT1RQTFVH LAorCVBFUlJfQ1BVU0VNUFRZLAogfTsKIAogc3RhdGljIGNvbnN0IGNoYXIgKiBjb25zdCBw ZXJyX3N0cmluZ3NbXSA9IHsKLQlbUEVSUl9JTlZDUFVTXSAgID0gIkludmFsaW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