From mboxrd@z Thu Jan 1 00:00:00 1970 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 47D64223DE9 for ; Tue, 31 Mar 2026 03:15:23 +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=1774926924; cv=none; b=ueeJhM/+crMyLiOeBRHEcP3oNaiYvFN27mO0eDjzfcJObU43ubXMG7USt/vuHPq/FABSfKApkknNxRolZaCYLYmgF/1m+VObtt93XwL/9njVIcdP66GmPXp9UEpHAecC49W2TBYde8rgiT77R2M5v1XfQA/zpAslo0pBknqWLH0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774926924; c=relaxed/simple; bh=1d0YQx4hPQaBwhAKQsz2LmvPvOWFGCJTu42IJkX9DoM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=chTynoZI5fF797jvAa+xtgNjMq5DAfcbtw9qSf0Q2P9+xq1QlOAiq1kHi53kuwcOaTblCtAjkJpIKXv0vCoqRvEP8a8eA5/7c32wLGvgJLd/9jVvkoO1TAEMI+AOaKlT6/Qzyy7Sw5XAyhQiqwrJZjPcmWncx/SwdQ8RzzzNs0w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=MGlfDsTs; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MGlfDsTs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774926922; 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=b8rlkQrzrOJfJRtM4z+1sXBieFpqYV94XKbvw/yLgf4=; b=MGlfDsTsd+Vzj51NpQ9vjz1BCn7181HqKDPSqaoc5bQRBYtdG3Nm0GmyC6sQrWdta7yoP1 r1HJ62qVL3NCB+9uyPj4G8GAgKzONFIB5o4zVRQi/8QAJk3A2OM2wq/73i8S7Exlc0XI8S YsXKWfBgsQGrg9WLE2hi/1gmHzdOkD0= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-652-_6U7yy2FO-m0us9VVSsDzg-1; Mon, 30 Mar 2026 23:15:18 -0400 X-MC-Unique: _6U7yy2FO-m0us9VVSsDzg-1 X-Mimecast-MFC-AGG-ID: _6U7yy2FO-m0us9VVSsDzg_1774926917 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A0719180047F; Tue, 31 Mar 2026 03:15:16 +0000 (UTC) Received: from [10.22.64.128] (unknown [10.22.64.128]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0A80E1800361; Tue, 31 Mar 2026 03:15:14 +0000 (UTC) Message-ID: Date: Mon, 30 Mar 2026 23:15:14 -0400 Precedence: bulk X-Mailing-List: cgroups@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/3] cgroup/cpuset: Skip security check for hotplug induced v1 task migration To: Tejun Heo Cc: Chen Ridong , Chen Ridong , Johannes Weiner , =?UTF-8?Q?Michal_Koutn=C3=BD?= , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260329173958.2634925-1-longman@redhat.com> <20260329173958.2634925-3-longman@redhat.com> <83e3d0fd-ab1c-4078-ae0a-e902e92fcdb6@redhat.com> Content-Language: en-US From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 On 3/30/26 2:21 PM, Tejun Heo wrote: > Hello, > > On Mon, Mar 30, 2026 at 12:15:01PM -0400, Waiman Long wrote: > ... >>> If there are many tasks in the cpuset that has no CPUs, they will be migrated >>> one by one. I'm afraid that only the first task will succeed, and the rest will >>> fail because the flag is cleared after processing the first one. >> The setsched_check flag is used in the cgroup_taskset_for_each() loop below. >> That loop is going to iterate all the tasks to be migrated and so the flag >> will apply to all of them. So it is not just the first one. > During migration, a taskset is used to group tasks in a thread group if > cgroup_migrate() called with %true @threadgroup. That doens't really apply > here. cgroup_transfer_tasks() doesn't set @threadgroup and even if it were > to set set, there can just be multiple procesess. Besides, it's rather odd > for it be a one-shot param that gets cleared deep in the stack. Wouldn't it > make more sense to make whoever sets it to be responsible for clearing it? Apparently, I have misunderstood how cgroup_transfer_tasks() works. Right, it calls cgroup_migrate_execute() on a process-by-process basis. So I shouldn't clear the flag in the first call. As for clearing the flag, I think we can do it in the CPU hot-add situation or when the cpuset.cpus is modified. Thanks, Longman