Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1309157ybh; Thu, 16 Jul 2020 08:40:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwlFUs72dWKwVJ91xta2Go7o41ElDdf3cq03pQ6+bNlGpsw3elGYp9w8vFppqZHYjR7ZvZ X-Received: by 2002:a17:906:71c6:: with SMTP id i6mr4502395ejk.103.1594914022240; Thu, 16 Jul 2020 08:40:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594914022; cv=none; d=google.com; s=arc-20160816; b=WEgwJbB00h+SUVoUIh7kZj2aAozxgJarsPTYyd2xm1cuvJLNa49+kTpU0IMs3JQWID 454GAwis6EW1PmAgUYdhvB4Xeb8qkFiWGp4YcGXPaDta0yUlvndXmJzKkUKIKbH+lWi6 qO+oqyTeYbBcb5uoTsiA5XJcWtep8ai+MVqeZGuYZXwjQof0MoJHStyzE0yicuPOBMFe ysYzhohzpuXc+4rf5H/AJjfJLCufkA5AiwB4+ir5AWNp5iTaKNBv8Jn9jUFZWRvrQcEo mTPqKtTrrGDDj20oYvN/s3xO2m7q0uA48hXlBYk3UH1ykNUzb+rQTw3Pg0OvAoaktg6J QWBA== 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 :dkim-signature:dkim-signature:date; bh=7Znin1qZ+GVKKZWfo8pTR1eebjm4kkJGTUgY2Ff7zFs=; b=h5e9HsZz1zIXZoKSNEf48fBMqYHrV8uvEoQyYcNYwqKsc+clmA2eomsaAPbwJYENtl RJcZi6JARz2sHM5hyKpsv1qdpYN/L2InrbGSH9PDVcQ9HoWej9Fsjp1lI+Fg68MgCb9F 4rZGLkLMKEc86S5iHQX6KTUUhWv5k5FSj4+71xbWNHNiZ0gBGExFnKWCwtciEujFSWXd fmNP8633LY673jWj9xzUwUpcU+8YzqI/F1ldMnbaizYPbFMp4zSGdyMjggoxxNp1E+tE 17ETbFF0w6/q3PZzuP6HyKY8YvfPXedWFRSDDSAtd63Bc31BmhV8pqtj5QjDYjD6foL+ muXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=1hf64CMC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e6si3273570ejt.528.2020.07.16.08.39.59; Thu, 16 Jul 2020 08:40:22 -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=@linutronix.de header.s=2020 header.b=1hf64CMC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729093AbgGPPgm (ORCPT + 99 others); Thu, 16 Jul 2020 11:36:42 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:34056 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728774AbgGPPgl (ORCPT ); Thu, 16 Jul 2020 11:36:41 -0400 Date: Thu, 16 Jul 2020 17:36:38 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1594913800; 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=7Znin1qZ+GVKKZWfo8pTR1eebjm4kkJGTUgY2Ff7zFs=; b=1hf64CMCc0Fj0miZJXm5fWlr1x+X4rZ0/8IKFuL23AY19Kkitfbe5vN/cU0LDo5C+vAexw KyRrXl1xcF4oOre+ooBVnfK0hmqYVQJiDWQypcBauUFPgJe3+6xrQdd1l5h17ZF+AbdIeJ WfEw/YRuoQqwRne91sT6xtmjDuxrwkuIpTUGQP1n0i6quu9BmuM8eJy2JB5X4Ot0oCQZfJ ZzM/YkNZ2cOSq/gIjkcKtupxrDIueUCTVKq6pX9roQqm8ZzdEAbo1skjYotJMLzpSl69h/ GFN4xb1E7v+/nnbWXCQUAGlloxxRLsLrrKRAof/k//8bSnXcTWsw54kcRSLwHQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1594913800; 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=7Znin1qZ+GVKKZWfo8pTR1eebjm4kkJGTUgY2Ff7zFs=; b=mVln4EgByMSCBqxuFMb+Cgh62v5trn1mfRNiJ5PRxrPIdAwcYPe6VY8njXiz9FDZuvohUy PHqWcj7Y0XUj+7CQ== From: Sebastian Andrzej Siewior To: "Paul E. McKenney" Cc: Uladzislau Rezki , LKML , RCU , linux-mm@kvack.org, Andrew Morton , "Theodore Y . Ts'o" , Matthew Wilcox , Joel Fernandes , Oleksiy Avramchenko Subject: Re: [PATCH 1/1] rcu/tree: Drop the lock before entering to page allocator Message-ID: <20200716153638.gfh6dzp2h35ygfaa@linutronix.de> References: <20200715183537.4010-1-urezki@gmail.com> <20200715185628.7b4k3o5efp4gnbla@linutronix.de> <20200715190243.GA26735@pc636> <20200715193250.axntj7jdt6bw52dr@linutronix.de> <20200715221449.GJ9247@paulmck-ThinkPad-P72> <20200716141421.fzwf4tedr6rixd6d@linutronix.de> <20200716152027.GQ9247@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200716152027.GQ9247@paulmck-ThinkPad-P72> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-07-16 08:20:27 [-0700], Paul E. McKenney wrote: > You lost me on this one. I am instead concerned that something like this > might be needed on short notice: > > raw_spin_lock(&some_lock); > kfree_rcu(some_pointer, some_field_offset); > > In contrast, single-argument kfree_rcu() cannot be invoked from any > environment where synchronize_rcu() cannot be invoked. I see. We don't have any kfree() in that context as far as I remember. We had a few cases in "resize" where you allocate memory, copy content and free old memory while under the lock but they are gone. > > > Yes, dropping to a plain spinlock would be simple in the here and now, > > > but experience indicates that it is only a matter of time, and that when > > > that time comes it will come as an emergency. > > > > Hmmm. > > I point out the call_rcu() experience. > > > > One approach would be to replace the "IS_ENABLED(CONFIG_PREEMPT_RT)" > > > with some sort of check for being in a context where spinlock acquisition > > > is not legal. What could be done along those lines? > > > > I would rethink the whole concept how this is implemented now and give > > it another try. The code does not look pretty and is looking > > complicated. The RT covering of this part then just added a simple > > return because nothing else seemed to be possible. This patch here > > looks like another duct tape attempt to avoid a warning. > > In addition to the possibility of invocation from BH? Invocation from BH should be possible because network would probably be the first user. I don't remember anything wrong with BH if I remember correctly. > Thanx, Paul Sebastian