Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp801939rwe; Thu, 1 Sep 2022 07:52:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR7SCrcFGk09kvZWYV1VdyMXVHSvodXYfwDZPKpmYsOtJr+0A3QRr9fsU41SkWzEC3qmAwaf X-Received: by 2002:a17:90a:b794:b0:1f4:feec:2910 with SMTP id m20-20020a17090ab79400b001f4feec2910mr8982105pjr.214.1662043924762; Thu, 01 Sep 2022 07:52:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662043924; cv=none; d=google.com; s=arc-20160816; b=LOrFcJdcBIMcMyZ1d/V470gEJF9EH0xRigCJbeg/Gq6oa6VCZ9gI65vDJpfapkKsgY Zi2gysBNK3KBj5vWiwKXhBhz7YoUZsd76wlQsUsvfSY2Od0mZss/p97tc7DzGt8mNquC Vj6qGYuFdEM1v+wrb5P9mdZGyLNZNtR9uWEff06vHxCORDZ09ReXWb6KUny+kOn3m7S8 9wdqHPPE84CKxSuvBuLdCzAzxbO+rLKuwnxN4RfJoUeKqP/Vep0nevCnroPYyW9jRsUz 7HFHnLvj4D8BSanKNn02TVLbMMgOGFKeoclpXWuk+lJwSppaTVY6T8VRBujisyswLE8F /J4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=Jf8cO2t6hUZhUrp3a7pSCi1cULdqUuGpU01vQQWB5m4=; b=yRPICfTAut02mYYlL6HLD6l2Oxug+8skdKQb7Orf//1GFTIG4X/lXXawQyKSIpEVKU 1pArzNthPerh5mgFt+10E1jXwh69OLgnSMNQfFqCzwjEpENp3ifHH68rK9/1SX8wjjex JQzEPUhCBKe524wiuvOhxpyCOl3gRoKXoAzQIycJoIiVMXdWMTscwG4QEcwAodFAV8Bg lEakznIHSb+pTnPLtAZe2ofLo32pTkygV495oBuFe+3yRF/qbTG3Xxy8vs7F00tXAREb 2SSQCK2NJ/iga88M7dtSiXqsKWQaFY+PLO2dnR6W67mRiujCLC+7FC5V5Yx+U2Y959/J BVHA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f1-20020a170902860100b0016eccdd02cdsi15407522plo.222.2022.09.01.07.51.53; Thu, 01 Sep 2022 07:52:04 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233397AbiIAOsT (ORCPT + 99 others); Thu, 1 Sep 2022 10:48:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231484AbiIAOsQ (ORCPT ); Thu, 1 Sep 2022 10:48:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEBB47B2B1; Thu, 1 Sep 2022 07:48:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AFD09B82799; Thu, 1 Sep 2022 14:48:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DDEAC433D6; Thu, 1 Sep 2022 14:48:08 +0000 (UTC) Date: Thu, 1 Sep 2022 10:48:39 -0400 From: Steven Rostedt To: Kent Overstreet Cc: Peter Zijlstra , Suren Baghdasaryan , akpm@linux-foundation.org, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, void@manifault.com, juri.lelli@redhat.com, ldufour@linux.ibm.com, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, changbin.du@intel.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, shakeelb@google.com, songmuchun@bytedance.com, arnd@arndb.de, jbaron@akamai.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, kernel-team@android.com, linux-mm@kvack.org, iommu@lists.linux.dev, kasan-dev@googlegroups.com, io-uring@vger.kernel.org, linux-arch@vger.kernel.org, xen-devel@lists.xenproject.org, linux-bcache@vger.kernel.org, linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 03/30] Lazy percpu counters Message-ID: <20220901104839.5691e1c9@gandalf.local.home> In-Reply-To: <20220901143219.n7jg7cbp47agqnwn@moria.home.lan> References: <20220830214919.53220-1-surenb@google.com> <20220830214919.53220-4-surenb@google.com> <20220901143219.n7jg7cbp47agqnwn@moria.home.lan> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, 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 Thu, 1 Sep 2022 10:32:19 -0400 Kent Overstreet wrote: > On Thu, Sep 01, 2022 at 08:51:31AM +0200, Peter Zijlstra wrote: > > On Tue, Aug 30, 2022 at 02:48:52PM -0700, Suren Baghdasaryan wrote: > > > +static void lazy_percpu_counter_switch_to_pcpu(struct raw_lazy_percpu_counter *c) > > > +{ > > > + u64 __percpu *pcpu_v = alloc_percpu_gfp(u64, GFP_ATOMIC|__GFP_NOWARN); > > > > Realize that this is incorrect when used under a raw_spinlock_t. > > Can you elaborate? All allocations (including GFP_ATOMIC) grab normal spin_locks. When PREEMPT_RT is configured, normal spin_locks turn into a mutex, where as raw_spinlock's do not. Thus, if this is done within a raw_spinlock with PREEMPT_RT configured, it can cause a schedule while holding a spinlock. -- Steve