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 8D5E0C19F2A for ; Mon, 1 Aug 2022 15:41:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232759AbiHAPl4 (ORCPT ); Mon, 1 Aug 2022 11:41:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231226AbiHAPlx (ORCPT ); Mon, 1 Aug 2022 11:41:53 -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 860DC2A72E for ; Mon, 1 Aug 2022 08:41:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659368511; 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; bh=6aGAsmftLF/0dvg9tasEyfV88rlFwnKcqNhuGDzyxe4=; b=H9alO73+1jg9xAuRK+5yRhXxiLEA3apU9186ezlO0fcJ+gy4X++oasUHfyxA5xffjyWdHM jGRHcDRdplC+yNUT5zwxDsaQI9HBqtElBfy7giMzrSwRKV1NEdDojVYSsCjuMApCflbkCJ VlbTzxtGetv/R0vyBdz8q8aKVGtESPQ= 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-407-xB1oEN01MyuRFgU_OYbiIQ-1; Mon, 01 Aug 2022 11:41:48 -0400 X-MC-Unique: xB1oEN01MyuRFgU_OYbiIQ-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 B8890805B9A; Mon, 1 Aug 2022 15:41:47 +0000 (UTC) Received: from llong.com (unknown [10.22.17.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id F24F7492C3B; Mon, 1 Aug 2022 15:41:46 +0000 (UTC) From: Waiman Long To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Tejun Heo , Zefan Li , Johannes Weiner , Will Deacon Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Waiman Long Subject: [PATCH v2 0/2] sched, cgroup/cpuset: Keep user set cpus affinity Date: Mon, 1 Aug 2022 11:41:22 -0400 Message-Id: <20220801154124.2011987-1-longman@redhat.com> MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v2: - Rework the v1 patch by extending the semantics of user_cpus_ptr to store user set cpus affinity and keeping to it as much as possible. The user_cpus_ptr field is added by commit b90ca8badbd1 ("sched: Introduce task_struct::user_cpus_ptr to track requested affinity") which uses it narrowly to allow keeping cpus affinity intact with asymmetric cpu setup. This patchset extends user_cpus_ptr to store user set cpus affinity via sched_setaffinity() API. With that information avaiable, it will enable cpuset to keep cpus afinity as close to what the user wants as possible within the cpu list constraint of the current cpuset. Waiman Long (2): sched: Use user_cpus_ptr for saving user provided cpumask in sched_setaffinity() cgroup/cpuset: Keep user set cpus affinity include/linux/sched.h | 1 + kernel/cgroup/cpuset.c | 24 ++++++++++++-- kernel/sched/core.c | 71 ++++++++++++++++++++++++++++++------------ kernel/sched/sched.h | 1 - 4 files changed, 74 insertions(+), 23 deletions(-) -- 2.31.1