Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp454302ybt; Mon, 6 Jul 2020 13:31:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwglDZQ6z/YNBhB3IT7yN5b4KyxYhbXfYTtzxL4YrgLGh1YaOR88cA9YU1WMIDGrCbpTz5R X-Received: by 2002:a17:906:c1d8:: with SMTP id bw24mr34872188ejb.91.1594067491610; Mon, 06 Jul 2020 13:31:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594067491; cv=none; d=google.com; s=arc-20160816; b=uPlcloqQ4Tg4nIDDw6S1n6IHe7DKlee9ogmK6Fp2Mc+zxik9Lh34QurxnjilnTplon bvDiYgBhQml2xF9rKsd5VkZTvnU8SnDfBFHFd0uxd0xg5ZlIqnP8kFKEQ7uxiWcHcppt YCsS7qW/ZVJ1CdkO9j4SfVVzXwRr60ilXvA2fWtiCTOiXXhjgrIRFLvU1zpHdVMRxBXw A0aESLLq3gBDl/yBZvhp6M5pDYCjJy1VP5zXgCZwK2HQ1IAlcaj7qlASCEunQ54n8oFQ 6oUnKFIUoSqfmNEaFPs7dz/wNtQRcqoA5QqylPj6XpLkayKL68ka0Ym7IGnEE+fpicSn gVHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=E1cpgB63aTx62rfdyAN52wQdXPNJ9PzG1Y0V51rY+uo=; b=UyryV0lwyV1EwAmiq3PxCrLGEGZILIqn08D+/zgrExPy4GwCxSADXIADQDkJn+wdq5 y1XfHrN7FQK610bUsfbZROp6NUqbUqyScBN7jmqyEO8BRyHcqFIUFkt3jE5X27Eo7COr m5XWc6hDbDevQnpb2BCwLV6kVR/OuHn54z3bseldTJvrYf2AMYH3HEVlhThr1KrbGjQG M1TdPbkdquPDy4Azv3Zjhqqd6fB+0LkC3zI7jI+WcOf4TYoNxJ9bf2TP3na21SafkgPz PtcmUf1Wa0mzksLHUFpMeR10GtP2af2BCL/rpl+B09NYYcHnQxqLKHHRxvSZalm713By VxFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=FP3kmo9X; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n7si13928754edv.74.2020.07.06.13.31.08; Mon, 06 Jul 2020 13:31:31 -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=@joelfernandes.org header.s=google header.b=FP3kmo9X; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727082AbgGFU3w (ORCPT + 99 others); Mon, 6 Jul 2020 16:29:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725941AbgGFU3v (ORCPT ); Mon, 6 Jul 2020 16:29:51 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57FE5C061755 for ; Mon, 6 Jul 2020 13:29:51 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id u12so30046720qth.12 for ; Mon, 06 Jul 2020 13:29:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=E1cpgB63aTx62rfdyAN52wQdXPNJ9PzG1Y0V51rY+uo=; b=FP3kmo9X+mlo/KJkw2tV5QI2wvKjZbW8ZSfMqXNwNwOdvPRyJzaU9A6nNCX2lU6zm5 0OhUwvf0u7qFd9lZ7jxzKK4kfGZ1EeMe9ZXz5vvi6tRMyjM1Twm91I0oP4QZWInpjnn6 3ypYHq1KcSe4K9wjSvDpaU9VboGZz0uU4cJgY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=E1cpgB63aTx62rfdyAN52wQdXPNJ9PzG1Y0V51rY+uo=; b=VSEkHdyOjnqsJrpMiNCBCqPh6oqo46DOrmGIjXcRMeENNIOp86zcH+jS92MtBiWULo mxybWxDjihC4yqTUDet+fKrd3WZh+UZq0HiOeSqbjyHXXgF9ieO6rvlcyRpwMGzGMGAX dZg8qaBHNOUxhogNoYhUhref4yyiXnnxZtPI7GJ7YGNSHu9xW4NPpeeUaXezG20qgh0T 2qpoGxcPV9sL5JqZ3A88ehToAcEQjAoEEt4xuSBjCZJ7OUusRvf1ABQrBtL7Q9fcSQla ZtVYZ52QaMnSqPkTzhDitV6Lxh/guvrcmxqYH1j+0AgxQlUe+tChGNPldPxO9+uMFOjA +n9A== X-Gm-Message-State: AOAM530y1gjp6CEXdS6sfyLf//RBnjjBsa4Fx/KEUbt3hQhLnoPfAxWE rvbcQBxywLm9/gXqZxn8PTsyBA== X-Received: by 2002:ac8:409d:: with SMTP id p29mr51480132qtl.369.1594067390519; Mon, 06 Jul 2020 13:29:50 -0700 (PDT) Received: from localhost ([2620:15c:6:12:cad3:ffff:feb3:bd59]) by smtp.gmail.com with ESMTPSA id q5sm21058291qkq.36.2020.07.06.13.29.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2020 13:29:50 -0700 (PDT) Date: Mon, 6 Jul 2020 16:29:49 -0400 From: Joel Fernandes To: Uladzislau Rezki Cc: "Paul E. McKenney" , Sebastian Andrzej Siewior , rcu@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com Subject: Re: [PATCH tip/core/rcu 03/17] rcu/tree: Skip entry into the page allocator for PREEMPT_RT Message-ID: <20200706202949.GB233429@google.com> References: <20200624201200.GA28901@paulmck-ThinkPad-P72> <20200624201226.21197-3-paulmck@kernel.org> <20200630164543.4mdcf6zb4zfclhln@linutronix.de> <20200630183534.GG9247@paulmck-ThinkPad-P72> <20200702141216.r4rbt5w3hjzafpgg@linutronix.de> <20200702194506.GA31478@pc636> <20200706194232.GA233429@google.com> <20200706195557.GA24082@pc636> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200706195557.GA24082@pc636> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 06, 2020 at 09:55:57PM +0200, Uladzislau Rezki wrote: [...] > > > Another way of fixing it is just dropping the lock letting the page > > > allocator to do an allocation without our "upper/local" lock. I did a > > > proposal like that once upon a time, so maybe it is a time to highlight > > > it again: > > > > > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > > > index 21c2fa5bd8c3..249f10a89bb9 100644 > > > --- a/kernel/rcu/tree.c > > > +++ b/kernel/rcu/tree.c > > > @@ -3278,9 +3278,11 @@ static void kfree_rcu_monitor(struct work_struct *work) > > > } > > > > > > static inline bool > > > -kvfree_call_rcu_add_ptr_to_bulk(struct kfree_rcu_cpu *krcp, void *ptr) > > > +kvfree_call_rcu_add_ptr_to_bulk(struct kfree_rcu_cpu *krcp, > > > + void *ptr, unsigned long *flags) > > > { > > > struct kvfree_rcu_bulk_data *bnode; > > > + struct kfree_rcu_cpu *tmp; > > > int idx; > > > > > > if (unlikely(!krcp->initialized)) > > > @@ -3306,6 +3308,9 @@ kvfree_call_rcu_add_ptr_to_bulk(struct kfree_rcu_cpu *krcp, void *ptr) > > > if (IS_ENABLED(CONFIG_PREEMPT_RT)) > > > return false; > > > > > > + migrate_disable(); > > > + krc_this_cpu_unlock(krcp, *flags); > > > > If I remember, the issue here is that migrate_disable is not implemented on a > > non-RT kernel due to issues with starvation. > > > It is implemented. Please have a look linux/preempt.h for regular kernel. Yeah sorry, I meant it is not implemented in the right way in the sense - it disables migration with the preempt-disable hammer. Anyway, I think as we discussed on IRC, your proposal will work for both kernels while allowing us to keep the internal lock as raw. thanks, - Joel