From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796503833; b=b0NsvOse52LMgBF8IqUA13RX8r0BImS1QzpH/juEqRCnS9zFzaRkpo2oQJEs6//MMZPL QnJ0sA4BZ4Iip8R97Qj4tOxbtqB+aCigGJEVXxDcb8MzD6j4/ET/HYEe5Mr/YQceuNYav Ukv46zKbbeRm//69Ran/RPRvuaZCf2nIB/5ndyPxFdgmr2/UB1BXKyGIE57toVIcl3BoC dsjfEHLe8x/Afmqg5L/Ue9RUUaKHcsPQMGaR26nTGurnfCxHjolR4AB41cvmaqf/8rtan DQoF8L+qkX0lrKpEVztwn3cydlL1KKAyWVhBFysB0XKV1DDtIIf6AdNi5iud5kboJxg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796503833; h=Received:DKIM-Signature:Received:Date:From:To:Cc:Subject:Message-ID: Reply-To:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=B0+ytLyjB5CR/YAodnWO1BBTwJY2n0RCzymzsAqxfgw=; b=j50hj8RIf6k00YuegsulfRmsNIi3SLmHgheIsG/spf1PBSsxnCDjxgDO5S+NNLJafP4x F1RGhnel2Zn8AYgJG13g10d465jtIzaIhyhgvwfyWP8iHacWKLgvyGEYcgqC0krGUk9Xg XpyKCQYyDSUcMADmBIsLhFbayx4fsP1kyNih6LA4tlpXkTxQ57vysi5oYbVkshe2MZ/lf RayWaMPdUOLdv4IMJHB+D8PQu4cCcqeQtNg2CXNAVNQ0zj8dT3vwbVX5AIxwByfnln+N9 c1jM++NOfXNDk6uxYz+iqpi9p+J+pwHNqb8lnGEIOq2RR8T3J+7Q2/OEp/hpoWHAsnw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=P09KFJQc; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1303C606A31F for ; Sat, 5 Dec 2026 20:50:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=P09KFJQc Received: by smtp.kernel.org (Postfix) with ESMTPSA id D396A1F0092B; Sat, 5 Dec 2026 20:50:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796503832; bh=B0+ytLyjB5CR/YAodnWO1BBTwJY2n0RCzymzsAqxfgw=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To; b=P09KFJQcgC+vlyN9D3p60uicJm/DRbUAVnPl+Ag8GRWbHMtg9NNmrxayD1ynenyT2 XzEMmrxbFhWtCE+wy/QwP/3KGi9tS3Ao3da9Xm05mnQsXGj9FKm/lIJAFC6Jobfx+j EawBQHo8lousLCIuI+Qe7wBvHxCim2pDUXVGa6cUGhzMIl/nJwNgntLx3p+oFSE9/V Pbc1FvPpPxW89Bs9r0LrOsn7+J5ZWHvJwV2D/38em6w+tMOGn5IWMLpAhQcN0I6iCO LZcG5YC1u6kmmJB+9GN7pD/cHtkv/6KwnuXq637SRkmYMa2s3W8IdnteJ7hKBXooPY ctkPnTwx+Tvpg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 91D68CE0C57; Sat, 5 Dec 2026 12:50:32 -0800 (PST) Date: Sat, 5 Dec 2026 12:50:32 -0800 From: "Paul E. McKenney" To: Michal Hocko Cc: "Lorenzo Stoakes (ARM)" , David Hildenbrand , Andrew Morton , David Rientjes , Ben Gardon , Johannes Weiner , linux-mm@kvack.org, LKML , Chris Mason Subject: Re: [PATCH v2] mm, oom: add rcu_barrier before hiding victim from the oom killer Message-ID: Reply-To: paulmck@kernel.org References: <20261202095450.296675-10-mhocko@kernel.org> <20261202212147.379270-1-mhocko@kernel.org> <71c575f6-60e6-48cf-9673-2727458733f4@paulmck-laptop> <0f8b0f83-6b5e-443b-9246-75064f09adc9@paulmck-laptop> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0f8b0f83-6b5e-443b-9246-75064f09adc9@paulmck-laptop> On Fri, Dec 04, 2026 at 08:37:13AM -0800, Paul E. McKenney wrote: > On Fri, Dec 04, 2026 at 09:24:02AM +0100, Michal Hocko wrote: [ . . . ] > > Or pre-allocate so that it doesn't block from inside of the grace > > period. > > I used to do just that, until we encountered systems whose firmware > claimed many more CPUs than actually existed, which caused people to > complain about the resulting useless RCU kthreads. :-( > > As a result, now many allocations happen when given CPU first comes > online. > > > Anyway, thanks for the insight. I will drop the barrier from the > > oom_reaper and also the global memory reclaim > > https://lore.kernel.org/all/20261202095450.296675-9-mhocko@kernel.org/T/#u > > Would another approach be to prevent CPU hotplug during reclaim? > Or at least across the rcu_barrier() call? No, that just gets us more > opportunities for deadlock between reclaim and CPU hotplug. :-( One thing that can be done with RCU as it exists today is to invoke start_poll_synchronize_rcu_expedited(), which starts an expedited RCU grace period. Given Puranjay Mohan's recent contribution, this will make RCU callbacks ready to invoke, or at least those that have already been assigned a grace period. This function uses queue_work(), but on a WQ_MEM_RECLAIM workqueue. If this is useful, it would not be hard to create a function that assigned all currently queued RCU callbacks to a grace period, and then invoked start_poll_synchronize_rcu_expedited(). This would have the effect of an asynchronous counterpart to rcu_barrier(). Would that help? Thanx, Paul