Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29111312rwd; Wed, 5 Jul 2023 07:21:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlEF5DMFrz+UKIOGzBGLpjv/tbsbuXU0MdfraXdh4FAPjPKN7g161wcQyoLk/rYzvKptOFsj X-Received: by 2002:a17:90a:1a13:b0:263:d248:3265 with SMTP id 19-20020a17090a1a1300b00263d2483265mr6805546pjk.29.1688566873172; Wed, 05 Jul 2023 07:21:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688566873; cv=none; d=google.com; s=arc-20160816; b=iwm4OCZAZVO3wc1a3lHVvGV+ItpfM7a6zGKTwdeNJXDer1mtzuOtM/cw6BB1ytq1+F WIZ9XF5Yx1Eh+8Y4H67C8C3bVpbY9huZkUwrT7IXKd65SnCCwlcWgZS2eCISCQdxzAMI y9/Qx/WsFZSw4jS79BAzJssHBQJ03OLm3sNfWg79RQXM0jphfOHitCApGtJXMk2c0FGx RrdX/k1oRKXn1e49I5YdZqwHiOXRr9pMvYXOLRYK+CqKrlvcbzmlL6x1SHThxHD690S6 j2GT8u8JPuZvJxvAvrOQLC1R0xF7g+wX98vXjY2xJPN28OcQbH3UTdgO4cDJX6M2gQKW 6O6A== 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=R2sLPj5y08qFr+M1Bva5r6C6XJl5+/tytL41ww+T+U4=; fh=67fvHl98XBGsnlxJdYyuDUwqUcJqRJxhorXVlXe4xiI=; b=D2unvH4125zfEaKrQjb2nwEiQOjopr9cVtlyg7Rho0LqPMEXPb7IWjLxftXp/AZMPe 4YcXAZzQBGrcZ7XWHqBC9yljcXAbpFWBB6WSWvad0ocmYfy3221Qk7HqTOvuwzZP0jdg jM0QGQlSFuRkq2w48klHYGeuA4a2t1BL/GT+jLd0UW5Peod+edOl4QO14NL8GWzznZBw MALkecgQ1dlNUJBPB9tDi987LHCqUBMEo1Mqb+Dh1R3cVZJquGt/d86pivu2kpXkFDNd vGTwxo+nQFiFKBtSYxcMumB51ReDIfPf0wsHaFONoq1d/mrC/WzDMhZR2dIBGgMvudl1 P4sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ObVnmY0A; 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 m10-20020a17090a7f8a00b002563db5c4b0si1647590pjl.184.2023.07.05.07.20.58; Wed, 05 Jul 2023 07:21:13 -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=ObVnmY0A; 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 S232468AbjGEOI1 (ORCPT + 99 others); Wed, 5 Jul 2023 10:08:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230385AbjGEOI0 (ORCPT ); Wed, 5 Jul 2023 10:08:26 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AAB6E57 for ; Wed, 5 Jul 2023 07:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688566059; 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=R2sLPj5y08qFr+M1Bva5r6C6XJl5+/tytL41ww+T+U4=; b=ObVnmY0AmTEYjoQ5yBEzkMNHuexBFHiufgLwYsAHQ6QEbQJd8VTaUcXTsY/UDdBITr1wYs D0X0ML0IqvX89meMSCFZjbozgEFYUuAfYyb5vk8TQP4MWu6/wr9q3cc3NKctDTzHPTABUL N9Y4Q9lv1bE/1Ius0iIjP8foHFtCIs8= 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-88-Mo6YzF_LPKKUxyUHEo39JQ-1; Wed, 05 Jul 2023 10:07:36 -0400 X-MC-Unique: Mo6YzF_LPKKUxyUHEo39JQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A810E299E74B; Wed, 5 Jul 2023 14:07:35 +0000 (UTC) Received: from [10.22.8.133] (unknown [10.22.8.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id DDB3A1121314; Wed, 5 Jul 2023 14:07:34 +0000 (UTC) Message-ID: <244e207a-95d5-2ff3-d0ec-c974538032af@redhat.com> Date: Wed, 5 Jul 2023 10:07:34 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH] sched/core: Use empty mask to reset cpumasks in sched_setaffinity() Content-Language: en-US To: Peter Zijlstra Cc: Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org, Phil Auld , Brent Rowsell , Peter Hunt References: <20230628211637.1679348-1-longman@redhat.com> <20230703102604.GC4253@hirez.programming.kicks-ass.net> <5bc41342-5ba6-68e9-8315-9e5cef65d102@redhat.com> <20230705093752.GW4253@hirez.programming.kicks-ass.net> From: Waiman Long In-Reply-To: <20230705093752.GW4253@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Spam-Status: No, score=-2.2 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_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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 On 7/5/23 05:37, Peter Zijlstra wrote: > On Mon, Jul 03, 2023 at 10:55:02AM -0400, Waiman Long wrote: > >> Our OpenShift team has actually hit a problem with the recent persistent >> user provided cpu affinity change because they are relying on the fact that >> moving a task to a different cpuset will reset cpu affinity to the cpuset >> default which is no longer true. That is the main reason behind this patch >> to provide a way to reset cpu affinity to the cpuset default. > Where is the sched_setaffinity() in that story? > > So somewhere this thing did a sched_setaffinity() and then starts > playing with cpusets. Instead of adding more sched_setaffinity() calls, > can't it just remove some? I don't know the full picture. From what I understand, there is a master control process that limit its cpu affinity to just a limited set of housekeeping CPUs. It then spawn child processes to be run in different containers. The control process doesn't need to change its cpu affinity. In the past, putting the child processes in a different container (cpuset) will reset its affinity to that of the cpuset. That is not true anymore because user_cpus_ptr is inherited in the forked child process. I have thought about 2 ways to address that. Either we introduce a new clone flag to disable the inheritance of users_cpu_ptr or a way to reset the cpu affinity to the default which is what this patch does. Cheers, Longman