Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp598430rdb; Tue, 5 Dec 2023 14:16:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IFG6Q2VMv2Qht+0MMAHUe9ffTf6hAo64X1SriPiLmeLWfCC7w97p4GDcjipUe9nqxPTtLoZ X-Received: by 2002:a17:902:7281:b0:1d0:bba7:4f95 with SMTP id d1-20020a170902728100b001d0bba74f95mr2248066pll.51.1701814611267; Tue, 05 Dec 2023 14:16:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701814611; cv=none; d=google.com; s=arc-20160816; b=HqvQjwzf3fQVjs0qVocTqZQY5S14OSbrkM0To6ju9oYVqHUrKv8iQn00ad1JG/9Zt/ Nwb+NHItpUnOJ/vNKRRy8dBgUODHN59s2H7JmJbbQ6OyJ2I/dZ0+ezF3v/JCzF5SiEmy SWnDooTqLQWLENNjGOZz6IxyYn8hE/S9XIxD4mVqcaWzPEl7trsA4vTedoSdz4JpgUg+ a7jwzt0pt26Zxe+P1zwaZs1WyinvYWVVInWPkI7hTNy101zqls7BOuB6N0ejUHwTrBM4 UlhTvsJFUpDWIKQAV9TdPcbO7T2BOEKLH+STlNhFN3a8pr0WkWHDAGeCVfxXRlJB+7zM Go/g== 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=h2Vem31mI/E1rxmbZRCBYAPkrSR+YjFerajC0+h+2EI=; fh=GJ9nPAfdyg+RFw+tise/ZBKF2ZyRNR1hejCFIiBbhpA=; b=q8Zpv9l/N2bxDVi7JUSptDwHi5v0GVgBZWrxnL31Uz2IjUkTG9CkGSGdZbZUqrdw/L NA7uHH4XjzrK2jljGZsgWLhhVb6THN7cp7s/e1gEwSGpF0toIr6zi/gRdfde5bqp61/h U04vAHw3SEl8Mfm9CrzebN3YK56f0zx2klXVmBoDQVXCcbS61RkkKIiSqfu7lW2enQsY 4cMBUJNqC3MbLeHjMI+1khllLyXMOPpIHcpanAC+hifP47c68TM57zaOSP/XVOygxaEX gQo5OiTzOVw1C4tc0nHsbD+rpk1zSXPIWkqXUJ71XvblHmbVkU8SPBvaENJz1cVzp0fp IlHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dVat5q1A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id u5-20020a170902e5c500b001cc692bf120si895724plf.61.2023.12.05.14.16.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 14:16:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dVat5q1A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 359E6828081F; Tue, 5 Dec 2023 14:16:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346580AbjLEWQU (ORCPT + 99 others); Tue, 5 Dec 2023 17:16:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346478AbjLEWQT (ORCPT ); Tue, 5 Dec 2023 17:16:19 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12D65137 for ; Tue, 5 Dec 2023 14:16:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701814584; 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=h2Vem31mI/E1rxmbZRCBYAPkrSR+YjFerajC0+h+2EI=; b=dVat5q1A35wXT8Nf76O/hEt5AccD2IDRmLUFLYZ1qCJdVHhmdINS3DrF6alqiduTNoJCi1 AvV/iayvbS+ZVgHTDJlo9YDguBo/+15AXixy4M3mo+gDmODm9w/LC7HPjsRAyleTuglDnU 2oXkYH/hw1EULws8XcuNJ1U+ShZXaKU= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-433-3LYAxG9aN0qe_CfFGknouw-1; Tue, 05 Dec 2023 17:16:16 -0500 X-MC-Unique: 3LYAxG9aN0qe_CfFGknouw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id F03511C0BB41; Tue, 5 Dec 2023 22:16:15 +0000 (UTC) Received: from [10.22.8.88] (unknown [10.22.8.88]) by smtp.corp.redhat.com (Postfix) with ESMTP id DCC8C112131D; Tue, 5 Dec 2023 22:16:14 +0000 (UTC) Message-ID: <7284ef19-ba26-46cd-9630-cad18c2e3ce7@redhat.com> Date: Tue, 5 Dec 2023 17:16:14 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH-cgroup 2/2] cgroup/cpuset: Include isolated cpuset CPUs in cpu_is_isolated() check Content-Language: en-US To: Tejun Heo Cc: Zefan Li , Johannes Weiner , Andrew Morton , Michal Hocko , Frederic Weisbecker , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Mrunal Patel , Ryan Phillips , Brent Rowsell , Peter Hunt References: <20231127041956.266026-1-longman@redhat.com> <20231127041956.266026-3-longman@redhat.com> <8de482b5-1942-4312-8de4-6f54565ab517@redhat.com> 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.11.54.3 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 05 Dec 2023 14:16:43 -0800 (PST) On 12/1/23 12:06, Tejun Heo wrote: > Hello, > > On Wed, Nov 29, 2023 at 11:01:04AM -0500, Waiman Long wrote: > ... >>>> Depending on how the cpumask operators are implemented, we may not have a >>>> guarantee that testing CPU 2, for instance, will always return true. That is >>> Can you please elaborate this part a bit? I'm having a difficult time >>> imagining the sequence of operations where this would matter but that could >>> easily be me not being familiar with the details. >> I may be a bit paranoid about incorrect result due to racing as I had been >> burned before. Just testing a bit in the bitmask may probably be OK. I don't > Setting and clearing a bit is as atomic as it gets, right? Yes, I think so. > >> think it will be a problem for x86, but I am less certain about other more >> exotic architectures like arm64 or PPC which I am less familiar about. I add >> a seqcount for synchronization just for the peace of mind. I can take the >> seqcount out if you don't it is necessary. > I just can't think of a case where this would be broken. The data being read > and written is atomic. There's no way to break a bit operation into multiple > pieces. It is possible to write a really bone-headed bitmask operations > (like, if you shift the bits into place or sth) to make the bits go through > unintended changes but that'd just be a flat-out broken implementation. Even > for a bitmask where write accesses are synchronized through a spinlock, we > should still be able to use test_bit() without holding the lock. This seems > like a pretty basic assumption. > > Adding unnecessary synchronization confuses the readers. If we don't need > it, we shouldn't have it. OK, I will send a simplified v2 patch. Cheers, Longman