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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3425FC07E9D for ; Mon, 26 Sep 2022 14:05:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 946818E0056; Mon, 26 Sep 2022 10:05:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8F51F8E0047; Mon, 26 Sep 2022 10:05:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 795948E0056; Mon, 26 Sep 2022 10:05:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 69F098E0047 for ; Mon, 26 Sep 2022 10:05:48 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id F028F160BF9 for ; Mon, 26 Sep 2022 14:05:47 +0000 (UTC) X-FDA: 79954409934.17.10E9232 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf30.hostedemail.com (Postfix) with ESMTP id 9146B80017 for ; Mon, 26 Sep 2022 14:05:47 +0000 (UTC) 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> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664201147; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=wuT0zYFTVb6wSKFv3e4a8+8ejDEu41HAn4lm9X+V3dY=; b=v3VCOfCTKqxADgh0pj0ozT859bxQqV2Ouu4RYyGPcYdzT3LYrBiCxgVljw6fE5aFUEpwMK Hl2pcJrcFMSUp3YuDxk4YzH8GnBbRe77BnTaqcP9PMqHAkd3hqNiP+ym3k7FYQmUiX2Vt9 5L1e4iUclGXI51f0nUG0m8YSowuO/tA= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=pxXA+YWa; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf30.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664201147; a=rsa-sha256; cv=none; b=LrnaTVxYvYYesBKqjLiM32lhbVzu/WRTpBazb6XTIAKtNJvCcPdMV1c609/k8k9oAtMDaZ HUSNYAULe2hNA8BlYmPIpxhL7HLTVgKXaE6Ic7IzCdjFnjrkgZoLfWSYgmrzocgXILm4/V mkWAJqRMJE/BvDoT0vQQvx8LGxfoDfc= X-Rspam-User: Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=pxXA+YWa; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf30.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 9146B80017 X-Stat-Signature: 4qkmf4wmk4hruthe6mo8ex4x1aj7k97w X-HE-Tag: 1664201147-194325 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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