Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp698127rwr; Wed, 3 May 2023 05:06:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ48T0vUGxy6yAq2K6DV3Em3sXl8143kAzKWtJOFm4IUJMUXLSmUAaWPn8SC9T6UR410WE4X X-Received: by 2002:a05:6a20:d90e:b0:f0:6567:92ba with SMTP id jd14-20020a056a20d90e00b000f0656792bamr16399322pzb.58.1683115593337; Wed, 03 May 2023 05:06:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683115593; cv=none; d=google.com; s=arc-20160816; b=WTlUEGSaagRD2zha78J+K8+bLE0xRWX93QhZ7/2oReLkEInWkN1PbxcPcWZVAjm7si ZYLwwDxu9XoQDuxW6Kfmnr/kDLWKnYfJwRpDZnggRjUukryY3a8Q/a59PYC5z2hNFmae UVrXTEZEYEbZS+3fpOVPwsdfmsogE8jk/qNJ4xLduPA4edskwpMte5jsPKRQr9XXpzfA pZBxwdBoGMNkoGx97whLQSxG90X3oTIx3G9niEqqSflpe1QQRFjHrtYH3Re8uvGzC0en gXwx3PG0LyNgFsUuVj1d7Km6wuvztd+Z5Rr2EKMTgowe+40pEZvj0scJjn1xRqGSOvRC Cx/w== 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:from:dkim-signature; bh=s2SfNb61+SyI1tUDzUUmrbRRGEEy0YuAgISsySgbv14=; b=mnpUtUTMktV9s110OLKkywH+r9RUHV50RZTqavVTnU0bh08CD8gCGU71v6l5r1MYLP OaeLnGs6l3xMooZzSe5sDzE+PbchXZzNc2r52qarExOkjFto20a327yLXVzMJRWIeA8N LLzFdbHUUg0up4rydPtFTyXKRTXxQkpnfj4RgIPKQgfEPaATdiUlbxRJcqUkxVxzHGhi /RKepQkFq89gDsOj0N6H2irYiWt8dpTaNcv6w5VPxCSasaKkaAK18tXm4jl0OPXTqlms CzpGTsRhM8S1wQpTc+Eo0JlTtbGcUE2X0BsluOPeoow2WygFh4DiuFMO1kdZWgoHASu+ TedQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=C1MpfwUk; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x190-20020a6386c7000000b0051322a8d2aesi23407655pgd.110.2023.05.03.05.06.11; Wed, 03 May 2023 05:06:33 -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=@redhat.com header.s=mimecast20190719 header.b=C1MpfwUk; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229671AbjECLyr (ORCPT + 99 others); Wed, 3 May 2023 07:54:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229528AbjECLyp (ORCPT ); Wed, 3 May 2023 07:54:45 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A47AA1BFC for ; Wed, 3 May 2023 04:54:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683114840; 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=s2SfNb61+SyI1tUDzUUmrbRRGEEy0YuAgISsySgbv14=; b=C1MpfwUkRP8sAeWgyf7HTCDbb3xHmft7M8qMTmwfUQfRm3C4kMZtp9BMmhYHSkuvBwbNeu ndfOdaSywixVto2sYyd65bjCadLCKtA0QFBAuAmN5kfolnwg/2eFn8s9iyjUAmoOPd+3SH Tm+9rID0lElgG7HgXpUbTrwWRXncpJ8= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-189-AOk2fQoVP8eivzJUTGuhIg-1; Wed, 03 May 2023 07:50:11 -0400 X-MC-Unique: AOk2fQoVP8eivzJUTGuhIg-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-3f315735edeso13214775e9.1 for ; Wed, 03 May 2023 04:50:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683114611; x=1685706611; h=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=s2SfNb61+SyI1tUDzUUmrbRRGEEy0YuAgISsySgbv14=; b=aSDjfY/IDsc17+JrqLO6C5d5x3sd2vAHCjNyIDzD5pD44Vu4+Um6HlqgCzzZz2FfT6 TIQXx3r5ZnmfIa5KScmZFbooawQP5zwyZ6weF/zhs7mGK/cA5zZs9rS/tQDYDXgxVApg A7rK/aNWAzAKlufvnuq/IF02VkB/Xu1SVaH4tyqrxiN3AsSmTzuAS4Aw/0Za5lzh8qGF eLoIQ0ErAdzwzTJpmtSbjBjEDzMG8+K0HJ+Erm9uA12XWyvz5XEFoXpIjlvTAt4k0xn9 WH6dCJx0MFelcv31u1POqobK/NHp3a3sPxcEsIbOtVCYwjiLeFvkdqvyBmpzobhhLSCS MdKQ== X-Gm-Message-State: AC+VfDw+kjqoSZ6uo9L19g7RfqNQvcwY7IvMpuTVzKBmTPXO2S8u+FwH UAuoSdqnHhSQzUJB7J9BMAYpjONoYifSQ3YzOb/8078ymuCqTy0K6RxhrU7Mxs3oePV8u0uBYuj Y3eXsyDALmAhnsX6A5e3WxYpQ X-Received: by 2002:a5d:570d:0:b0:2f0:583:44be with SMTP id a13-20020a5d570d000000b002f0058344bemr1387970wrv.0.1683114610857; Wed, 03 May 2023 04:50:10 -0700 (PDT) X-Received: by 2002:a5d:570d:0:b0:2f0:583:44be with SMTP id a13-20020a5d570d000000b002f0058344bemr1387950wrv.0.1683114610545; Wed, 03 May 2023 04:50:10 -0700 (PDT) Received: from vschneid.remote.csb ([154.57.232.159]) by smtp.gmail.com with ESMTPSA id k5-20020adff5c5000000b002f103ca90cdsm33508156wrp.101.2023.05.03.04.50.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 04:50:09 -0700 (PDT) From: Valentin Schneider To: Thomas Gleixner , LKML Cc: Peter Zijlstra , Dennis Zhou , Tejun Heo , Christoph Lameter , Dave Chinner , Yury Norov , Andy Shevchenko , Rasmus Villemoes , Ye Bin , linux-mm@kvack.org Subject: Re: [patch 0/3] lib/percpu_counter, cpu/hotplug: Cure the cpu_dying_mask woes In-Reply-To: <20230414162755.281993820@linutronix.de> References: <20230414162755.281993820@linutronix.de> Date: Wed, 03 May 2023 12:50:07 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 14/04/23 18:30, Thomas Gleixner wrote: > Hi! > > The cpu_dying_mask is not only undocumented but also to some extent a > misnomer. It's purpose is to capture the last direction of a cpu_up() or > cpu_down() operation taking eventual rollback operations into account. > > cpu_dying mask is not really useful for general consumption. The > cpu_dying_mask bits are sticky even after cpu_up() or cpu_down() completes. > > A recent fix to plug a race in the per CPU counter code picked > cpu_dying_mask to cure it. Unfortunately this does not work as the author > probably expected and the behaviour of cpu_dying_mask is not easy to change > without breaking the only other and initial user, the scheduler. > > This series addresses this by: > > 1) Reworking the per CPU counter hotplug mechanism so the race is fully > plugged without using cpu_dying_mask > > 2) Replacing the cpu_dying_mask logic with hotplug core internal state > which is exposed to the scheduler with a properly documented > function. > For patches 2-3: Reviewed-by: Valentin Schneider