Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1268155ybh; Thu, 16 Jul 2020 07:39:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2HLV9ZV97wEaae6p0zAhncQ+QeuiOwlqhwjqNhubA2u03VHLMfrngDhgudBqHWYm2cwU7 X-Received: by 2002:a05:6402:b4b:: with SMTP id bx11mr4693340edb.286.1594910390188; Thu, 16 Jul 2020 07:39:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594910390; cv=none; d=google.com; s=arc-20160816; b=X2UFpbNhq6VlhErwCAiyltZ+A7GS1l5aB4IqtPUi+bxrZZjLg1XgEL1jcYe2M7f1tI QQGpEljuNSGNDZ3rIjDZ+WmehyNAkWJpBM7ILsnCYcAKdBCV7C0Kkntg8+VM1ETx1PKe l1E+hJ8lZWjMCV6Y3LLvMIfddq5Jiikeyl0yvxclTda0L6Km36Bvn9scMbgvov/WJHCl SwyJwojqLQeXQF76QHu1FgOVsMcM9uGGSJxhR/OM8pFW3xDmhghdz6lXzdI1rzUNZ01e HhB0NKu05VkEIhO807v2qEHPWYjfo7dYHILI7e7bwCAQB1l1I7S/n4HiOyGbV+Gs48eo /rvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=kcj5G59GOTPUhqEln7W+1LEARocoTm+rR4NtydTtguo=; b=DeEqyu+kzuK02XYLu6s+t6H70OR6CsANTH+Ha0Tor+ve/nMUUq2HnIUz+RzpMKIln/ 34FOiDg+wk8eFcEo5ukYD3KZwbNrJVDlpYS+PO4IWpUZcVCqThrqClv2gCHhGyDtTcF3 OXkmj1WaMnvazO6uhCZ6Q8XTu4Onwt6XoUokSmicnXfelc6jWNMAZaBTJ4txdTLzJvxZ DxiscDMXXUS/GNj8ugC6aIDTCUhED+QHnPsJH+jBfiTewqpWDxdeaEIXGy07C+42+z9R zIkHx9EWTTlO4gUo3io9LhI9mtw/NTtHi26OsSY6T0rMeWSqp6DDR3WK4PRyQtpH/jzG a17A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fsolWBi7; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j8si3373506edy.211.2020.07.16.07.39.26; Thu, 16 Jul 2020 07:39:50 -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=@gmail.com header.s=20161025 header.b=fsolWBi7; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728385AbgGPOhU (ORCPT + 99 others); Thu, 16 Jul 2020 10:37:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726963AbgGPOhT (ORCPT ); Thu, 16 Jul 2020 10:37:19 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AE30C061755; Thu, 16 Jul 2020 07:37:19 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id y13so3390238lfe.9; Thu, 16 Jul 2020 07:37:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=kcj5G59GOTPUhqEln7W+1LEARocoTm+rR4NtydTtguo=; b=fsolWBi7fEMSttVRztN88vZvdXxpApiO8nGZnGfXBYuEqQm02/VSbeTmuDVv7DvsAF zqUaYfoMi4yCccLUSyZU1zXDHArDXbTwrgozKCgZ2Do4Q4i8AKm6uIQhjIc6WNA4pgXE 4YAKBoHU+7Nq4gKyyIlwrhS64PiKsEmaVRAc6bfeFnRPVFKLH8blfsCtNFgf9mfi+Wf+ YpfzD33ZXXbBkM0bgmbTRmtnCTbsVViWzb17iKY92lDfvXqaZoi4/g8bh2K6wGsei3Fb tu1sexbPoEq/Z2ajTY8Q7OM3XZpYMl3L9y1zSlzKDmU1Ql481NARoEKwDqspLwAKIOVn iTwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=kcj5G59GOTPUhqEln7W+1LEARocoTm+rR4NtydTtguo=; b=oluKmLkXk+duqSPIJJ8++CZpoiA2RggMxDW57JCID+QVka+8kwCDJloFotaQUJV/1s XlC8FvtwKvhxw5MIu7S+j9eeC6qFZBELdreTTAf4mSVKAEviW+0tznJ0pHJbnlvOZoLw Vr6kOZltBfcuMW1zhbeuTFuS2k2dxJmK4r4HF1Hj3Dl4pRsQWw27I94i/cLg0C2kfX4S 5RH4xHiAi1vDAPMPwmkR/V7obbyqQtyIgcDfrPIGA7YJDq27U8T5uqHDYuUkb9vGtBnl K5rNU2OeT0OTCCFQHb0NSF8aJxrEj0AXXG8EST/jaHNHlkx9MeB7gxzvm8PBmgqsdx6C UPOA== X-Gm-Message-State: AOAM532tWtlzDJf/HYfpsKtaXI87Lm5rtSqrSyVrEa9iHMbN01DE1UMk 9NKqtZO+iDoXAVV59FpkbQQ= X-Received: by 2002:a19:43:: with SMTP id 64mr2244338lfa.72.1594910237254; Thu, 16 Jul 2020 07:37:17 -0700 (PDT) Received: from pc636 (h5ef52e31.seluork.dyn.perspektivbredband.net. [94.245.46.49]) by smtp.gmail.com with ESMTPSA id s62sm1078206lja.100.2020.07.16.07.37.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 07:37:16 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Thu, 16 Jul 2020 16:37:14 +0200 To: Joel Fernandes Cc: Uladzislau Rezki , Sebastian Andrzej Siewior , LKML , RCU , linux-mm , "Paul E . McKenney" , Andrew Morton , "Theodore Y . Ts'o" , Matthew Wilcox , Oleksiy Avramchenko Subject: Re: [PATCH 1/1] rcu/tree: Drop the lock before entering to page allocator Message-ID: <20200716143714.GA30965@pc636> References: <20200715183537.4010-1-urezki@gmail.com> <20200715185628.7b4k3o5efp4gnbla@linutronix.de> <20200716091913.GA28595@pc636> <20200716133647.GA242690@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200716133647.GA242690@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 16, 2020 at 09:36:47AM -0400, Joel Fernandes wrote: > On Thu, Jul 16, 2020 at 11:19:13AM +0200, Uladzislau Rezki wrote: > > On Wed, Jul 15, 2020 at 07:13:33PM -0400, Joel Fernandes wrote: > > > On Wed, Jul 15, 2020 at 2:56 PM Sebastian Andrzej Siewior > > > wrote: > > > > > > > > On 2020-07-15 20:35:37 [+0200], Uladzislau Rezki (Sony) wrote: > > > > > @@ -3306,6 +3307,9 @@ kvfree_call_rcu_add_ptr_to_bulk(struct kfree_rcu_cpu *krcp, void *ptr) > > > > > if (IS_ENABLED(CONFIG_PREEMPT_RT)) > > > > > return false; > > > > > > > > > > + preempt_disable(); > > > > > + krc_this_cpu_unlock(*krcp, *flags); > > > > > > > > Now you enter memory allocator with disabled preemption. This isn't any > > > > better but we don't have a warning for this yet. > > > > What happened to the part where I asked for a spinlock_t? > > > > > > Ulad, > > > Wouldn't the replacing of preempt_disable() with migrate_disable() > > > above resolve Sebastian's issue? > > > > > This for regular kernel only. That means that migrate_disable() is > > equal to preempt_disable(). So, no difference. > > But this will force preempt_disable() context into the low-level page > allocator on -RT kernels which I believe is not what Sebastian wants. The > whole reason why the spinlock vs raw-spinlock ordering matters is, because on > RT, the spinlock is sleeping. So if you have: > > raw_spin_lock(..); > spin_lock(..); <-- can sleep on RT, so Sleep while atomic (SWA) violation. > > That's the main reason you are dropping the lock before calling the > allocator. > No. Please read the commit message of this patch. This is for regular kernel. You did a patch: if (IS_ENABLED(CONFIG_PREEMPT_RT)) return false; -- Vlad Rezki