Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2829536lqz; Wed, 3 Apr 2024 09:40:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVZK/N29bvRlXU2FS6YG3148C9UhMNbX/isu8XHncL6i46M90budbPNsYVfC6fFHptK1jMXYe8jCFrYAZEQA0vZnH4yiKs6cQrU6z2KRQ== X-Google-Smtp-Source: AGHT+IH0LGBLz4b2/q3mRup9inyWdwJARIERUA8k3I+LRFaCgByVpXKtOsbLZR8ZUPIbRFQAxBI0 X-Received: by 2002:a17:902:e549:b0:1e2:a077:1c8e with SMTP id n9-20020a170902e54900b001e2a0771c8emr1250801plf.26.1712162439874; Wed, 03 Apr 2024 09:40:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712162439; cv=pass; d=google.com; s=arc-20160816; b=VNujrF4M9SgIOTy+FO/dNDIOlBLqUBrcQWwb52MQn/VPaGpxoZJ3RUdmnisBMDMMsr l33/SkFs9gJt4EuLLZxCYM+qrM7OlDz/EbllCTaW1lQfCsZzO/Q9GlBMVIlOODRF3YYF I2/ORh2W37qPz6i4DBHuTY4RIfCmWvOrDT1kuJEepEuN1FJij/Wj/VFDbU94JV4tlOEV ERqZ+qsQRp5RUXNQDF4VzRjH73a4ZYsY3n2Y/EkoZkeZdYcUTMUbnvpHq3e2iACAwy33 tWouqb8x69KhpHIS4PoCFpe9uW/VX/QaNXQQz/JIKGHptR16C3al0JCJVqOll+J0gL+5 WBmg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=OQm7KJ2wxSLm5O0upddCNpxjqnodHhe0dn1TWqhcwVM=; fh=AWxK+G7IQj1tUkV1i7yzb4klKWFhlVqNoVLXKgOmwVY=; b=0SeeR118/pa81OqHQjgB+r3OdlZ3Z6vBcMctyoKeixbF7qeHi4eAoDumkPeBLnDlqX kz+mTB5Ricp9rqAuqGzrITWIeOzTotEdZdKXK6adDiY6mytDmsKGWQPjydoyT7NRNfXK dJaq/drAghlseWRw1gFfij5b7ygClB0VXgx5sVa+rd4O7qejrj5x6FU/xP26b3AkQJSr B9YcMBqW/WAfY3kk0udBXzCrKG3kZvvAq2F0VLe7rY4RFv4oKsPXYzLivhGpZovQeeDD EYyAkvVV7ORZzV35ahCjJGGF8GQe59Mg3Ff/4xfr3AqDgvcg4PaxiSZTmpxDtEvIZa2m r84A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CbUxIIGF; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-130180-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130180-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id p21-20020a1709028a9500b001e2a42cad09si187866plo.461.2024.04.03.09.40.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 09:40:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130180-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CbUxIIGF; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-130180-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130180-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 41DF2B24D7B for ; Wed, 3 Apr 2024 16:17:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 559DF14E2F9; Wed, 3 Apr 2024 16:17:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CbUxIIGF" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 05CAD14E2EC for ; Wed, 3 Apr 2024 16:17:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712161054; cv=none; b=ubpq+K+sM1/6F2to7GFUUP3ce3BRSHcvEfs6QYDv33NIYel8e+v0zv2bgzIuFv6dUlOsyq0x2jQToDC91/mooEKnzz4SWoAg4xOrzw+UFnOuFudweVm11UHQKA3BUPTyr8ahPdbOv/5sLPBgOhFH7HG0/Jg3CDQi3hWmQkODIkE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712161054; c=relaxed/simple; bh=/oHz60YmomB8xtLx1SmFXh+ChYzmFb8LPQK3p7ehSUc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=D7K3faTDhP0wamg/XoBXQgXH6pzdhqVh6BP6fyk6xwRChoi/q206AHWY+qHtoGuIGOww9xOf3mLPxyQfdNF3N6OmEVFyVb1u/dV7KBDDgBaWiCpBK17Y+4jUlNJU+Vmhgx5uzqW3uDuYCFECLhpOEubg/TWI3Eu+9ppjsd2c0MU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=CbUxIIGF; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712161052; 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=OQm7KJ2wxSLm5O0upddCNpxjqnodHhe0dn1TWqhcwVM=; b=CbUxIIGFlyZJ/hf6mrsde4gwXpm70JgMw+Pc/du55q7b2fA+zHik8nieCx0bL2A2F3kmo3 kHtWEqn5cykaMpGGtT8ngWM4ALu2CI2+G6dcLuUKJODuy0EDXC2pX7WfF2F13qM4o6u8tf pgEfyxqtcqlVH2+sY+BtvgNZjOBWH98= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-500-Om4XmBmcMYm1F04UhbtY7A-1; Wed, 03 Apr 2024 12:17:30 -0400 X-MC-Unique: Om4XmBmcMYm1F04UhbtY7A-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-6963cd45fddso25623116d6.1 for ; Wed, 03 Apr 2024 09:17:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712161050; x=1712765850; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OQm7KJ2wxSLm5O0upddCNpxjqnodHhe0dn1TWqhcwVM=; b=S59aMSxvz64FZ6EFsf8wo4jk0yFylzKaf0sAEV3O4sAI0IBiALTswd2ogk0pnaEV/j cl1MSvv8i1bLZzgIezcncwjvdN8wkKP7bMefx4I/GPgzapK5s2cHh65zJrmXNlb7TMZd ca004Qk227MFSpuvL025V7DfLDXc98G10uQgqTrlP+T83JiFrU+uvahyMn3brJD58VP1 dC7POZkTl2QDnn0S52SeXq92ZQTWNsRZOZ9kgYmsbqd2stI9rkb8DeuB+Q3JPCFJkr4v 9q0d6q/stZInBf2x8SZqMpXLo7q1TMNIKWarNE4OvNWulQ3zChJwhKSJZ+wJIaavIbdz tbhA== X-Forwarded-Encrypted: i=1; AJvYcCUi8lkKTKMT6JLrkrmFsmvebmI7Gj6U2VYE10NqCtO93Po8I0/eEAO6DZfxvjB1ZJ5OkSwia2DFGhY8OQpPgBJVWQzmKEy+WlsCapdb X-Gm-Message-State: AOJu0YwAzveX2imzDZgIDa33U1Ezb8CF1ejy8y+KAqREQXzOAhDQ4Knf hVwbU8GZpjXiHjLZl0uS6CHiuizurO8H7ZRwBzjjNaih39L9uf0FoaySO59FbldLqDFcdKz3e3b eynRB5iPbRMepQuHJLyvsGHIfmwBL6jcS7yPqKBbKfHglzAdzi+0Jkl4ORxDYzg== X-Received: by 2002:a05:6214:4a5b:b0:696:926e:dfe3 with SMTP id ph27-20020a0562144a5b00b00696926edfe3mr4445023qvb.22.1712161049921; Wed, 03 Apr 2024 09:17:29 -0700 (PDT) X-Received: by 2002:a05:6214:4a5b:b0:696:926e:dfe3 with SMTP id ph27-20020a0562144a5b00b00696926edfe3mr4444998qvb.22.1712161049636; Wed, 03 Apr 2024 09:17:29 -0700 (PDT) Received: from vschneid-thinkpadt14sgen2i.remote.csb (213-44-141-166.abo.bbox.fr. [213.44.141.166]) by smtp.gmail.com with ESMTPSA id oo14-20020a056214450e00b00690c9256676sm6614401qvb.49.2024.04.03.09.17.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 09:17:29 -0700 (PDT) From: Valentin Schneider To: Waiman Long , Michal =?utf-8?Q?Koutn=C3=BD?= Cc: Tejun Heo , Zefan Li , Johannes Weiner , Thomas Gleixner , Peter Zijlstra , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Shuah Khan , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-pm@vger.kernel.org, linux-kselftest@vger.kernel.org, Frederic Weisbecker , "Paul E. McKenney" , Ingo Molnar , Anna-Maria Behnsen , Alex Shi , Vincent Guittot , Barry Song Subject: Re: [PATCH 1/2] cgroup/cpuset: Make cpuset hotplug processing synchronous In-Reply-To: <620d1b70-cfbc-4b76-ad04-b3be559afd56@redhat.com> References: <20240401145858.2656598-1-longman@redhat.com> <20240401145858.2656598-2-longman@redhat.com> <548efd52-e45f-41fa-a477-bc5112d7b00c@redhat.com> <7e62b37d-6c9c-4e55-a01a-175695475cb5@redhat.com> <620d1b70-cfbc-4b76-ad04-b3be559afd56@redhat.com> Date: Wed, 03 Apr 2024 18:17:25 +0200 Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/04/24 10:47, Waiman Long wrote: > On 4/3/24 10:26, Valentin Schneider wrote: >> IIUC that was Thomas' suggestion [1], but I can't tell yet how bad it wo= uld >> be to change cgroup_lock() to also do a cpus_read_lock(). > > Changing the locking order is certainly doable. I have taken a cursory > look at it and at least the following files need to be changed: > > =C2=A0kernel/bpf/cgroup.c > =C2=A0kernel/cgroup/cgroup.c > =C2=A0kernel/cgroup/legacy_freezer.c > =C2=A0mm/memcontrol.c > > That requires a lot more testing to make sure that there won't be a > regression. Given that the call to cgroup_transfer_tasks() should be > rare these days as it will only apply in the case of cgroup v1 under > certain condtion, I am not sure this requirement justifies making such > extensive changes. So I kind of defer it until we reach a consensus that > it is the right thing to do. > Yeah if we can avoid it initially I'd be up for it. Just one thing that came to mind - there's no flushing of the cpuset_migrate_tasks_workfn() work, so the scheduler might move tasks itself before the cpuset does via: balance_push() ->__balance_push_cpu_stop() -> select_fallback_rq() But, given the current placement of cpuset_wait_for_hotplug(), I believe that's something we can already have, so we should be good. > Cheers, > Longman