Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4569367rwl; Mon, 10 Apr 2023 13:15:12 -0700 (PDT) X-Google-Smtp-Source: AKy350atwbyfUoOOP2mxlSu/SNzEsitX1hboRvXJt6lynKoPpi6H1zMsEsDgcwWT8fYnoU/dMbLN X-Received: by 2002:a17:90a:db87:b0:244:8a1c:8054 with SMTP id h7-20020a17090adb8700b002448a1c8054mr11611655pjv.10.1681157711634; Mon, 10 Apr 2023 13:15:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681157711; cv=none; d=google.com; s=arc-20160816; b=m9Y92Thsb8uR4xBFc6c7yp3QdRpvh5UfBe0tmgGjTSFM9hC8oIIjrLDh8KcRW7Swnp e9RWiZJ1MmxW8uNHj5QQC8dm/LmEjrbhce31y/GGsc0J0IE700vs6+UcaSrLez4EzvWd 6Of3+QuhIBiS2ExIJjsiHlXWrI7/Ba+hq4D3pi1qKKUcO0qK0Xt84bv/+JgCcgpI8CPO S3c5Em3G5YJkm28e+2OPtwxDQP6rmFk74pgndrSgHmGMcFMNjzMsyn3wAvFP4cIHvOCU +Xcrmy1iuOWfTEVDmy/wpYKv5oUQjbprsZpuC8I1O6dm6o4RyyAkaq5waG7BzqZxv5yA o6mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=vdW463lMrSIv6E0tgsiWW1gHVmKWpAD6pFZXhTowmDg=; b=SqzDAm3A7wAoZUOItJsZYqB1ILepNnFXo6wiBlmf1b2Dx/soBwkWVoppiWrPjcewVL BnPWMqhCXkAypyNJ8/V/3+HOtCLrP0ptJFVkyyw2PXc2IHfyCL6yFEj8ow3bH1dDHQv4 W0ccftAcOyaC7TksBy9sG/m7lD9BTvhvOO/StdVNybd57yCMJ9BvzRGAOqJv5POE+e8Y zaEqmkzvQjbV3wbgPepEPJqW2jG4GnA0Zsf6JW8BzcPz1ZAwmSbC/tB8U+EzJ0SH1v7r 10mOQ1TbK+1LZlx5udimcPq3EKX7gr+WMvImaRfm4pVWGa0mjwk4NobWYODFuZ8W6F2x Th1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Qx6ain5z; dkim=neutral (no key) header.i=@linutronix.de header.b=qCqxFj5j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v11-20020a17090ad58b00b0023033ddad2fsi13701944pju.73.2023.04.10.13.14.55; Mon, 10 Apr 2023 13:15:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Qx6ain5z; dkim=neutral (no key) header.i=@linutronix.de header.b=qCqxFj5j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229662AbjDJUMG (ORCPT + 99 others); Mon, 10 Apr 2023 16:12:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbjDJUMF (ORCPT ); Mon, 10 Apr 2023 16:12:05 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63F5610DD for ; Mon, 10 Apr 2023 13:12:04 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1681157522; 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: in-reply-to:in-reply-to:references:references; bh=vdW463lMrSIv6E0tgsiWW1gHVmKWpAD6pFZXhTowmDg=; b=Qx6ain5zpkrw9c0mIzTsdZJ2CziF6CqWWukuvArgsC4szGXpIxgHH/QINUH69+TsLjxssH ZtxAQFYwuObC448FwupWmc7cUrlmNSCsooOlcluSRtZZY6pYhdU1BzpiCRzn6PbD3KizpC 4L7T1dbr7DA9xUiX9gIYM06Sfvfta2AfHmq2q35mD6ZAtj2jcPQDNrmZzdvmzJ8GMApr5/ iGlCfU6kuA3lVF3/mkvgmYEof908j9ue1JEDCXtEoce6c8IjDMHZkEJXk6Xcu/CUbBu0+W UGBgV1oE9MTEaT3pNQ3m6Qwa6IBMyht89rhKb2igK55qXqX/QkuQS/OYHXhnqQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1681157522; 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: in-reply-to:in-reply-to:references:references; bh=vdW463lMrSIv6E0tgsiWW1gHVmKWpAD6pFZXhTowmDg=; b=qCqxFj5jAYh3BVZhm6uZMnl5peEQBRM5008KIMURBjiOGz05/O+U/0Y2t9lJJYalfATkJu tJYspYOL2pZ2mQAA== To: Ye Bin , dennis@kernel.org, tj@kernel.org, cl@linux.com, linux-mm@kvack.org, yury.norov@gmail.com, andriy.shevchenko@linux.intel.com, linux@rasmusvillemoes.dk Cc: linux-kernel@vger.kernel.org, dchinner@redhat.com, yebin10@huawei.com, yebin@huaweicloud.com Subject: Re: [PATCH v2 1/2] cpu/hotplug: introduce 'num_dying_cpus' to get dying CPUs count In-Reply-To: <20230406015629.1804722-2-yebin@huaweicloud.com> References: <20230406015629.1804722-1-yebin@huaweicloud.com> <20230406015629.1804722-2-yebin@huaweicloud.com> Date: Mon, 10 Apr 2023 22:12:02 +0200 Message-ID: <87bkjv1oq5.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 06 2023 at 09:56, Ye Bin wrote: > From: Ye Bin > > Introduce '__num_dying_cpus' variable to cache the number of dying CPUs > in the core and just return the cached variable. Why? That atomic counter is racy too if read and acted upon w/o having CPUs read locked. All it does is making the race window smaller vs. the cpumask_weight() based implementation. It's still racy and incorrect. So no, this is not going to happen. Thanks, tglx