Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp750738pxx; Thu, 29 Oct 2020 13:35:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAImQ585mx0AnBqFZj21W7YGujTq3Nb6Eehg7IYlL6tlgfmVN3tOrHh7DdR51+JWGWW2vD X-Received: by 2002:a17:906:1f53:: with SMTP id d19mr5792976ejk.255.1604003749663; Thu, 29 Oct 2020 13:35:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604003749; cv=none; d=google.com; s=arc-20160816; b=Yt7dS0Dm++6+GOCphKliCNCSkzNJrhcICyMZt9SQidREDydSGMODh0Prs/UAJhPhde A231l3lbmDhtVZHxRwUaxNtk0b/0jeBmshfOygYnUNWIfpbuyRpVjd96icX65ByIK4k2 xIOj6OLTzyJv3nlmr6HXUNf0zdWARE0fyyaxMRpuaFaVdUk+htZmMsgCHApRqSfpXa0L HwB9yw5N9If6xfNDqua7ZGH+KGnRktVtFANRktNubHt47Z7nqxLnQJ4HBEBWseEEbhav D2Y3GVaBXmzkCkI1MkwgNntZrn1SSI3i1nRcBhNGs8JEeKYlB335bQmbwfJDzNST2Gvs u5nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=9c1xISK/3MHC97/QEYl2WZBlhbnqHmWbR8coU1C4g9M=; b=j5dJJkxTDgLqM4stPAeoQms9fS761Rr+loB+83QF1gCr8UVpyRaxPnNsR7HYStXqrk ijSu8N0lRD+gaHXtAXMNxIQgzoBENWWYHT2+G642xN1OM8A285lTh7MoWgLI8Qg3NXa2 6bQGw/EKq4g9dzsvv1iwbF9oHeDVlKOTUDMi9y3ChimNzen+k6m2Nsj7nZ6LJfZDIe9a lhflF4iDLCFe5BlQhziGg92n9eL4WgvAB8r/EYhRgIcQi86JiTOrAIbsNenaleqVZvv7 0ETtx24FictUUXGrftX9Yu1OnB6kgsPxts+J95naD82UY0Hru47bfJHmYj86t6e93pYR mZhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="qZz8/dRF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s2si2803439edy.490.2020.10.29.13.35.26; Thu, 29 Oct 2020 13:35:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="qZz8/dRF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726657AbgJ2Ud5 (ORCPT + 99 others); Thu, 29 Oct 2020 16:33:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:43624 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725764AbgJ2Ud5 (ORCPT ); Thu, 29 Oct 2020 16:33:57 -0400 Received: from paulmck-ThinkPad-P72.home (50-39-104-11.bvtn.or.frontiernet.net [50.39.104.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 487AA2072E; Thu, 29 Oct 2020 20:33:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604003636; bh=i5JSP3Ju+n/u07BQSPYOWy3h0OR7adt0iTAk9czs5W4=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=qZz8/dRFMW+toKDcbQCiKfJI020I1ImK3PGiwcZqSUpYw7P8M1qUPQ52IVHa2xfrc AJzhh8zvUDD5cQYlqF1XMemGG6sHg7iqfEFHH7LMWzQwzdYu4rjCp/ork/EHXRsG2J 2r3W2NQYQ4ASN8Xlxjb5SqM3cnDlfmevqpn2guUI= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id D9CE235225DF; Thu, 29 Oct 2020 13:33:55 -0700 (PDT) Date: Thu, 29 Oct 2020 13:33:55 -0700 From: "Paul E. McKenney" To: Uladzislau Rezki Cc: LKML , RCU , Andrew Morton , Peter Zijlstra , Michal Hocko , Thomas Gleixner , "Theodore Y . Ts'o" , Joel Fernandes , Sebastian Andrzej Siewior , Oleksiy Avramchenko Subject: Re: [PATCH 16/16] rcu/tree: Use delayed work instead of hrtimer to refill the cache Message-ID: <20201029203355.GO3249@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20201029165019.14218-1-urezki@gmail.com> <20201029165019.14218-16-urezki@gmail.com> <20201029194724.GN3249@paulmck-ThinkPad-P72> <20201029201342.GA24122@pc636> <20201029202241.GA24399@pc636> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201029202241.GA24399@pc636> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 29, 2020 at 09:22:41PM +0100, Uladzislau Rezki wrote: > On Thu, Oct 29, 2020 at 09:13:42PM +0100, Uladzislau Rezki wrote: > > On Thu, Oct 29, 2020 at 12:47:24PM -0700, Paul E. McKenney wrote: > > > On Thu, Oct 29, 2020 at 05:50:19PM +0100, Uladzislau Rezki (Sony) wrote: > > > > A CONFIG_PREEMPT_COUNT is unconditionally enabled, thus a page > > > > can be obtained directly from a kvfree_rcu() path. To distinguish > > > > that and take a decision the preemptable() macro is used when it > > > > is save to enter allocator. > > > > > > > > It means that refilling a cache is not important from timing point > > > > of view. Switch to a delayed work, so the actual work is queued from > > > > the timer interrupt with 1 jiffy delay. An immediate placing a task > > > > on a current CPU can lead to rq->lock double lock. That is why a > > > > delayed method is in place. > > > > > > > > Signed-off-by: Uladzislau Rezki (Sony) > > > > > > Thank you, Uladzislau! > > > > > > I applied this on top of v5.10-rc1 and got the following from the > > > single-CPU builds: > > > > > > SYNC include/config/auto.conf.cmd > > > DESCEND objtool > > > CC kernel/bounds.s > > > CALL scripts/atomic/check-atomics.sh > > > UPD include/generated/bounds.h > > > CC arch/x86/kernel/asm-offsets.s > > > In file included from ./include/asm-generic/atomic-instrumented.h:20:0, > > > from ./include/linux/atomic.h:82, > > > from ./include/linux/crypto.h:15, > > > from arch/x86/kernel/asm-offsets.c:9: > > > ./include/linux/pagemap.h: In function ‘__page_cache_add_speculative’: > > > ./include/linux/build_bug.h:30:34: error: called object is not a function or function pointer > > > #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e)))) > > > ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > ./include/linux/mmdebug.h:45:25: note: in expansion of macro ‘BUILD_BUG_ON_INVALID’ > > > #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond) > > > ^~~~~~~~~~~~~~~~~~~~ > > > ./include/linux/pagemap.h:207:2: note: in expansion of macro ‘VM_BUG_ON’ > > > VM_BUG_ON(preemptible()) > > > ^~~~~~~~~ > > > scripts/Makefile.build:117: recipe for target 'arch/x86/kernel/asm-offsets.s' failed > > > make[1]: *** [arch/x86/kernel/asm-offsets.s] Error 1 > > > Makefile:1199: recipe for target 'prepare0' failed > > > make: *** [prepare0] Error 2 > > > > > > I vaguely recall something like this showing up in the previous series > > > and that we did something or another to address it. Could you please > > > check against the old series at -rcu branch dev.2020.10.22a? (I verified > > > that the old series does run correctly in the single-CPU scenarios.) > > > > > I see the same build error. Will double check if we have similar in the > > previous series also. It looks like the error is caused by the Thomas series. > > > > Will check! > > > OK. Found it: > > urezki@pc638:~/data/coding/linux.git$ git diff > diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h > index cbfbe2bcca75..7dd3523093db 100644 > --- a/include/linux/pagemap.h > +++ b/include/linux/pagemap.h > @@ -204,7 +204,7 @@ void release_pages(struct page **pages, int nr); > static inline int __page_cache_add_speculative(struct page *page, int count) > { > #ifdef CONFIG_TINY_RCU > - VM_BUG_ON(preemptible()) > + VM_BUG_ON(preemptible()); > /* > * Preempt must be disabled here - we rely on rcu_read_lock doing > * this for us. > urezki@pc638:~/data/coding/linux.git$ > > I guess we had some extra patch that fixes a kernel compilation for !SMP > case. Will check dev.2020.10.22a. I guess I am blind today! And yes, that semicolon is in the corresponding commit in -tip. So, an important safety tip: When forward porting, start from the commits that have been tested rather than from the original series of patches. ;-) Thanx, Paul