From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DC71C77B7F for ; Wed, 3 May 2023 11:50:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A43E56B0072; Wed, 3 May 2023 07:50:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9CDC56B0074; Wed, 3 May 2023 07:50:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 86E9A6B0078; Wed, 3 May 2023 07:50:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by kanga.kvack.org (Postfix) with ESMTP id 6B3956B0072 for ; Wed, 3 May 2023 07:50:13 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683114613; 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=bVNulVDfF1ghIktd2kOSLug9IF6oOQxiIuiuI2ZdDssYzicV77YZgri9gGzj+EymXZEMug obVpZTR+3AZS+PmQjQTjgw00OtsQqjP4zgnbIdRmlFV/Gy6oUTDesHlUMP5fdamZuKM+rt 2I9vjbRSlchKIVqfnKHyiYv0sDxqiI8= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-191-40k_Bk9TNHSFlU0HNqbLJA-1; Wed, 03 May 2023 07:50:12 -0400 X-MC-Unique: 40k_Bk9TNHSFlU0HNqbLJA-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3f3157128b4so13458495e9.0 for ; Wed, 03 May 2023 04:50:12 -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=N8atxFzeXB0mpRvTswTweoMYtsRf5y8aTMRqYHi9MIT/QjbqQ5i2EkIah47YtBia6f g3tEtvdG2cF7lPNKjQVM9F7lTpjSEuhjvaCmv0WM3oTBP4/0VOzKJjLHxjyrZeLmcJAG T+Opp4HorVo8jNyVPlL0ABKTcKC63HqnKJ53oqj5VVwyxCScD363wjZeNX35J1izT3lX af8aGwRQFxHzGl71vb9NTbkdPaEwQICDAb93whAOe81fhzLghUVFlPy6Ise3FV81WlJg ncB9qwOzoeqGmL0ZHlrUgjV8KJwhlz4zzMC+SL3xBHMo7RLK/FoEtYbXflnkgFgc39OZ UxNg== X-Gm-Message-State: AC+VfDxmSw3ZVFslxiLwiffPIuOEKjpbJpsv0WdN9JItXzpHxlLAdLvV z31PGkf/9JK3bNKEjcdzODDlJIQPpttrW7jDX/jaVYCyJHV8jia+zJzdCx+PSsctbDQQEp5MjnP 22rnVjOfrGiOVFzPQ7sxJoH6X7cfBi6DvnHD9br2B+78XFYFHHYj9TfHe/OP0zMmKsH6cPxE= X-Received: by 2002:a5d:570d:0:b0:2f0:583:44be with SMTP id a13-20020a5d570d000000b002f0058344bemr1387977wrv.0.1683114610950; Wed, 03 May 2023 04:50:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7FpQ2jFNfSfXjoMZJtfDYFhpINnGDd/wPmVGl/wJQGxJ4JUCPbQ/yMvNFbV179HybpsluqGA== 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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