Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1188152rdb; Fri, 1 Dec 2023 09:07:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEd35grJMYfPMPQlHNNMwCidG3hWyaFNvNb169PYaSWUibj36MpKjEeff1tmZYYlt2tIb8P X-Received: by 2002:a05:6a20:1483:b0:18b:cdc2:be57 with SMTP id o3-20020a056a20148300b0018bcdc2be57mr20174647pzi.27.1701450442238; Fri, 01 Dec 2023 09:07:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701450442; cv=none; d=google.com; s=arc-20160816; b=iqGE3CudJSXEudienG8nBQV5NtwpksSXk+qyLchV04yCyhqwSQaZ959vCJPefdNS8z TboAxqYskaiP2KGcLAoyTYDK8kaadBKAw7GA1xnaGOU+0CPI/KiFM+RdwhOGVAsEFzdO k1wicJNYbSkWdXiZPDKWzi5EejI6/Jps1UottIAIdA1lgfTMf+SQ4LAARp+x+HZQ0I55 bbJLeDP6VWB4GmiLrDb0W/RRAgwzqvi3mlPEyJTp9O1pqD2suigJrmqVM7IfLCOwAZae TqSC8BfaQm64bI8NrzHUf3UKQjhKr83TgnXzY2zmcWz7RWM98O7Dz7xtfGItZFyQvTJn XNMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=8ApfEIiuG4L/aqQ9kotcie87+m7wxOXlew1ELlzFCgs=; fh=t6LA6g1Dbz2iPqkrnPfOEJvH2njOyNPgun/j0JT8d9o=; b=jl4maZxhml9tU2V0oiMaxMNyCc1OW/oD4p6eVR1AIVv9YG1SLREJ6fniimidV1jqnE fekHke33Gr/a/c1mYUaqkrM2sFUR5RUAvWXqEH4PYjpXhYynjabko7e/zXE2wpUSSCdF Ye4wewDt2kanteArfYX+BjpGjm6NkB8F83Y3mU81RObyQPZKZDx8t1acrtNdLjpvQXoa WJ09stHAZ7uC4u/DiTdb9B/LDlKFdCe1n7dn9wOwGk5on++5+dlO+BbDOkf+mQozo5yq BZQXP/iCtuuVP56IXph8cAvLeF5Ddw2pJJ36iRU9X+74GB9kFaYFmss3F040JVqxVmjI xBHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BtW0mh6e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id u3-20020a63df03000000b005b90e67f438si3543305pgg.106.2023.12.01.09.07.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 09:07:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BtW0mh6e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id DBF4D81133AC; Fri, 1 Dec 2023 09:07:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229454AbjLARGu (ORCPT + 99 others); Fri, 1 Dec 2023 12:06:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbjLARGt (ORCPT ); Fri, 1 Dec 2023 12:06:49 -0500 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB469106; Fri, 1 Dec 2023 09:06:55 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-2864d8c8743so1472640a91.1; Fri, 01 Dec 2023 09:06:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701450415; x=1702055215; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=8ApfEIiuG4L/aqQ9kotcie87+m7wxOXlew1ELlzFCgs=; b=BtW0mh6eont2J+wDbOVoc0pUq1VMW1l4K1wVfYgUj3Mi/hD+oC8hsfYOwn7uHBWfof Ihz+JSdfIarGvE9wnuNMQ/GbZXL2dDOGqW9rRSAEv7kHb5a7ujgtjWv/KkEwHB6+SjUf Kw0WOtKpow6VeuMg0zkb3j2Xx16vqExXgRNLijiqx2wjXh5A8hK05pyDtYxoT1NoRqg+ NYbdpIkU1cjU5wM71HwDzl1Fu+isXxR/KRlCDbOiBzFnhNKbtOg9DuGel2bIovRNu2W7 tWJWRO4sRQXePBUNwzRpZ2tgJp0p4lj/BzikfmcqAs85y6rNKrektFPm4Q8t4tDkA5aM JREA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701450415; x=1702055215; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8ApfEIiuG4L/aqQ9kotcie87+m7wxOXlew1ELlzFCgs=; b=xEOsUb6orv5Wezkr+UfMirElSQ29Uv/49OyxCPsdk357tTqbo9LN+WIPqSPBRBH7cQ 01XjjrBzVRX3IfJWv3cqDWhL8bLKqWT6OU0M8gZYJI9eiamS+QPCCRHi6Ycpa0nFdSTf atFWxghxOv4ymsj506EzP5fWDJqKW0x17ugSxGYw/Zu1WLj0VSaJPW4fSw019uawU5jr BdfUknzw+KZGwBiJuraQzocgxLLpAcLi9JeZegdjXSF/1pEIOSDK6EjZlE95e/FV0tzJ zB7xwc+BxYaV7Yo15XkACR8oazKdzuk74CQsPM51ufYPJEUD1NmmoPtz4aHlPek5FzcQ Dzxg== X-Gm-Message-State: AOJu0YypKoDkpPFiPX9Vv+Zgh3Z3TOfQ5EzB3tleOx2qmpHblrGiYzJL FQCF9cSkvSIFzDoU6ONks/M= X-Received: by 2002:a17:90b:4f85:b0:286:295a:b33a with SMTP id qe5-20020a17090b4f8500b00286295ab33amr8393253pjb.8.1701450415016; Fri, 01 Dec 2023 09:06:55 -0800 (PST) Received: from localhost ([2620:10d:c090:400::4:27ef]) by smtp.gmail.com with ESMTPSA id a5-20020a170902ee8500b001cf594f71f3sm1892920pld.157.2023.12.01.09.06.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 09:06:54 -0800 (PST) Sender: Tejun Heo Date: Fri, 1 Dec 2023 07:06:53 -1000 From: Tejun Heo To: Waiman Long 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 Subject: Re: [PATCH-cgroup 2/2] cgroup/cpuset: Include isolated cpuset CPUs in cpu_is_isolated() check Message-ID: References: <20231127041956.266026-1-longman@redhat.com> <20231127041956.266026-3-longman@redhat.com> <8de482b5-1942-4312-8de4-6f54565ab517@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 01 Dec 2023 09:07:04 -0800 (PST) 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? > 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. Thanks. -- tejun