Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1297428ybh; Thu, 16 Jul 2020 08:22:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySnrOG53aNCTRKv+KHip3dkYLK7H1F3eBdRPJUch6vqI4WoifKdG5zDklnGTKYOCA7BatR X-Received: by 2002:a17:906:488:: with SMTP id f8mr4107257eja.215.1594912937623; Thu, 16 Jul 2020 08:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594912937; cv=none; d=google.com; s=arc-20160816; b=vl7RiLn5vJP9GqvMUWn4kKE6DkCtH8BFEEOCYgpg6xsHOG6HzuhB9JYIBb2/dWGfif 3qz0o1zYFU+C5np0XI+n9O95X4B/RhanY+V31EDwd5IBc+syzJ84Aq9JTuNDhAn+LgNK GBY6Kvzq+6XDC3AZU0RJfvmAQYdxlcB1YePEeddsXVWsdhOuYUaCrSR/awpK4YsMjArW Txr6JxUMCo/Uz5xMRlGhf6DPx/XQmTZ0fGVsrHE7R1Lf5z4NgIz4YcbnPhu6DP8CxdZ6 yTETdMjMqPTnW/FLws11uoAgsKS+SN7LU3Ji/k9ta4f9DkZzUdEmNjVc933mbqrNZCiA P+2A== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=n7LVRuKMiXxZa4fSXWe0mtpMc8LjgG0Do7UaxpWVeZI=; b=CgW3NoLfrqaL8/BcgaA2aCV8Km/XGpNTkDafrJRVhmx1i1zNNywd/Q5SqVQCFYP0nZ mEPxdsBWEmsQgBziFFVUPV9wlzGIXJJzcbHcYCMplGZZJbbP8/fnMNTpAi24dnJW0VAt qbzjbXvSMU43wTzDLE5Hh9nvYj9uDWDKgNJ+b8wKqlhW7u827jG9hnxetxcZbpn09qn6 UJQt0Jnx6GC+iy9gnwJQzJzeV7TJrBW6Al9/cRAShL1QYlthzx7E09VB7COn3phqPnXE ETYyOPjL50BQ8oXtOLEY0wDTj3vdqjaS03kSWiAOeEPuoVeunah+86gzxvenx0EmqwoQ 1TRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IJkS2fSE; 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 u18si3462124ejz.388.2020.07.16.08.21.53; Thu, 16 Jul 2020 08:22:17 -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=IJkS2fSE; 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 S1729125AbgGPPUa (ORCPT + 99 others); Thu, 16 Jul 2020 11:20:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:42506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729123AbgGPPU1 (ORCPT ); Thu, 16 Jul 2020 11:20:27 -0400 Received: from paulmck-ThinkPad-P72.home (50-39-111-31.bvtn.or.frontiernet.net [50.39.111.31]) (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 2DC4520825; Thu, 16 Jul 2020 15:20:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594912827; bh=PPJ9m8c9qSJB+p9W3coV52UIGzOiNECbZW1ePPsr2qM=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=IJkS2fSEK6rAbF2nOQXWQ+mlBhg91YptiouLkxoGU2kMdnrFnJEtP6mwTKvWJ5p93 h2jTbQoHNU63OnRgqnNKBPGBmPTZiNB/6qYUEUGx3Eehf5hNky1gGDduO0hIB3gjWz ruJegvsRwZeroGPbM7kUVtYwOTYHlK13iETsA++A= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 0EA4A3522635; Thu, 16 Jul 2020 08:20:27 -0700 (PDT) Date: Thu, 16 Jul 2020 08:20:27 -0700 From: "Paul E. McKenney" To: Sebastian Andrzej Siewior 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: <20200716152027.GQ9247@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200716141421.fzwf4tedr6rixd6d@linutronix.de> User-Agent: Mutt/1.9.4 (2018-02-28) 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 04:14:21PM +0200, Sebastian Andrzej Siewior wrote: > On 2020-07-15 15:14:49 [-0700], Paul E. McKenney wrote: > > > > My concern is that some critical bug will show up at some point > > that requires double-argument kfree_rcu() be invoked while holding > > a raw spinlock. (Single-argument kfree_rcu() must sometimes invoke > > synchronize_rcu(), so it can never be invoked in any state forbidding > > invoking schedule().) > > So you are saying as of today we are good but in near future the > following > synchronize_rcu() -> kfree_rcu() > > may be needed? 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. > > 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? Thanx, Paul