From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16D27C32771 for ; Mon, 26 Sep 2022 15:19:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236108AbiIZPTc (ORCPT ); Mon, 26 Sep 2022 11:19:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236202AbiIZPSp (ORCPT ); Mon, 26 Sep 2022 11:18:45 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EF6680490; Mon, 26 Sep 2022 07:05:47 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0441021EBD; Mon, 26 Sep 2022 14:05:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1664201146; h=from:from:reply-to: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=wuT0zYFTVb6wSKFv3e4a8+8ejDEu41HAn4lm9X+V3dY=; b=pxXA+YWa2Kcpb1MHyYsrT1t9v17FKJ/beYwwaHBKKXSbBL7RGdSwN8fCY7s0Q4B98macse j9lNMyAfkbbq2ULr08wt5rikiVeK8XZNVaZhRVvlUCW7DMXuxEIsd4TOkFaDUfLrK3HniN UZP6eozaJ4TUwnfIIy4wXyHlrT26xHA= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D94D0139BD; Mon, 26 Sep 2022 14:05:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id KLgrMrmxMWNSfwAAMHmgww (envelope-from ); Mon, 26 Sep 2022 14:05:45 +0000 Date: Mon, 26 Sep 2022 16:05:45 +0200 From: Michal Hocko To: Florian Westphal Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, vbabka@suse.cz, akpm@linux-foundation.org, urezki@gmail.com, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, Martin Zaharinov Subject: Re: [PATCH mm] mm: fix BUG with kvzalloc+GFP_ATOMIC Message-ID: References: <20220923103858.26729-1-fw@strlen.de> <20220923133512.GE22541@breakpoint.cc> <20220926075639.GA908@breakpoint.cc> <20220926100800.GB12777@breakpoint.cc> <20220926130808.GD12777@breakpoint.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220926130808.GD12777@breakpoint.cc> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 26-09-22 15:08:08, Florian Westphal wrote: [...] > To the best of my knowledge there are users of this interface that > invoke it with rcu read lock held, and since those always nest, the > rcu_read_unlock() won't move us to GFP_KERNEL territory. Fiar point. I can see a comment above rhashtable_insert_fast which is supposed to be used by drivers and explicitly documented to be compatible with an atomic context. So the above is clearly a no-go In that case I would propose to go with the patch going http://lkml.kernel.org/r/YzFplwSxwwsLpzzX@dhcp22.suse.cz direction. For that we could use an alternative implementation for the vmalloc fallback for non-sleeping request in the future. A single branch for an unlikely event is not nice but acceptable I would say. Especially if we want to go in line with Linus' original "prevent hack for gfp_mask in callers". -- Michal Hocko SUSE Labs