Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp963386rwe; Thu, 1 Sep 2022 10:10:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR5ViySLMhMCf9IbQ4+KkyURKzrMWCyKvAwREHaBb669XvmXiJZCXSFsbPix0xb9a4TDAYPm X-Received: by 2002:a17:906:d7a9:b0:731:2189:4f58 with SMTP id pk9-20020a170906d7a900b0073121894f58mr24732421ejb.471.1662052237631; Thu, 01 Sep 2022 10:10:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662052237; cv=none; d=google.com; s=arc-20160816; b=Y+Kiex/vtZ77v4/fXCPo8FXUKrVQ1RA1ilOmFCgATjz1JRmnsR58tlGYTz4HlIc+Tx zVCInV6uI9gW0EVBSwdTY1v9eafxMTyamtF2A8KiMPmLJTNx/P1ZcP9Vz3IJ7Lno4JEa 33vmhHYU6JmKepTO8cx5nFnHI/q7hSuPFuFKIVAEImodQRQJwh6/IEuzgl8mkf1uTZCq zghrViGmigxgfvCwVR1T0GkxNhbsyS5BajJdigY8WUrBWT09vTnykDzjtYNfsM9ABaBN h5bqeDpQEgVjo+BeGiWbanyN743UKeDdoTGDMbYqYN8hRIgzchiO/tH3EDoMBQWzAK07 bnCw== 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:dkim-signature:date; bh=OCuFL4N5GVZjONQAdChOE7OJr7ThTUJDCIIbzLkwFEk=; b=d2Ae4oRVV/CxzanKZnALBUco7M61wtm3OHliDozBe4hWsW291GATymiBoyjJ7W3K4y Q2QNc1X+fwCSvZZtJdEgtWQQZ+eSC14dMpkTdizRwBX0mk0yvDq3FdAv50kskztJq4iC lNX8z/FFYz9FCiPw0ZJusJMrfMyQiq0S0aIkoFKB3JVX0xHrwIDdGuFXxy/Cpo7ZT5PP PT2p1hZ9x6KSg0dZmQt2K0oEqeJGtEJumvjXFKuUrokqa2Q1UNsurKndp41nwv7sk2ln IhkcFxFhxp/V+c4BT4r5YzFtzwJVqnPxYxTAR3kt4hZLWt4ixTnwzYypEHpFsAXbxi4P 1jQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Zug2Ft4Q; 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=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xi8-20020a170906dac800b0072af6e1fff0si363382ejb.330.2022.09.01.10.10.11; Thu, 01 Sep 2022 10:10:37 -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=@linux.dev header.s=key1 header.b=Zug2Ft4Q; 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=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233249AbiIAPno (ORCPT + 99 others); Thu, 1 Sep 2022 11:43:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232994AbiIAPnf (ORCPT ); Thu, 1 Sep 2022 11:43:35 -0400 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E261719AC; Thu, 1 Sep 2022 08:43:31 -0700 (PDT) Date: Thu, 1 Sep 2022 11:43:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1662047009; 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=OCuFL4N5GVZjONQAdChOE7OJr7ThTUJDCIIbzLkwFEk=; b=Zug2Ft4Qd/net99BOTd8W8Yfuju//gSHL3gkzYXZLEVciKsEhf1UkIyXgrPgVXlVt/CoSK WIJngXjsqZ/WvBYvq+hwDukTtw4VIC1L39QDy0ARuz5vTfzc62/XGVpvD13hkozhflqLO3 W0o6TaATn9DtFDXStAFl/opHuur0FVU= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Steven Rostedt 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: <20220901154321.apyq7246srkjthfr@moria.home.lan> References: <20220830214919.53220-1-surenb@google.com> <20220830214919.53220-4-surenb@google.com> <20220901143219.n7jg7cbp47agqnwn@moria.home.lan> <20220901104839.5691e1c9@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220901104839.5691e1c9@gandalf.local.home> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, 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, Sep 01, 2022 at 10:48:39AM -0400, Steven Rostedt wrote: > 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. Thanks, I think we should be good here but I'll document it anyways.