Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp996783rwb; Mon, 26 Sep 2022 08:22:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM52e8scXFh/tkcO2LA/VNdxIb+z+TccCbRHM/3fAZeUxl23uJo03NMlhTjdoIR8eT8U16bw X-Received: by 2002:aa7:cc13:0:b0:453:52dc:1bbf with SMTP id q19-20020aa7cc13000000b0045352dc1bbfmr23112393edt.30.1664205739514; Mon, 26 Sep 2022 08:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664205739; cv=none; d=google.com; s=arc-20160816; b=p0EMSjoJBZ8H5A94SC8ucN81OKnXR3SwicxjQQ/r4gLq1gWwvhJtgQ3TQ0rl++IgD2 uxIQ67MAcmkkRbIVBSCmDJTiiblSdknetfGySVhQQAWN0DOp+4wEB8bGy5xk8caQOqcG LBTWmm9QikLjTx+36ORd9fOfaHavji4872hho9vvNELnhsqw9ZKVtwIXIGpI9IYs+Ceo 6SyiS8CkuBylT9z2X2+4aYmz0w+q8rB6uUFoPyHZ3WGhKhbW3REvHMZYapoYS4L1CHrY IK2EfjP6aBMqpHE0TgsdPxJUF13tkBmNIhpUTKgvsuJNGvPoe+dYbxvcEodvp5slgIc7 CXRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=wuT0zYFTVb6wSKFv3e4a8+8ejDEu41HAn4lm9X+V3dY=; b=S7VQcX2J/KQgCrxqBu1IWRv9DTcav3xwyRimHWw/IvhQ+fiMvht2M/JWGIHnKBDXUa AuJshDYt6L69G1ZuTtdwuAwkg4rstSni2Z+VcPQqCsgdoruFzJAAry31gq7UX8J5ZeXM TEuKELWzV2hqyBJmpsXgetWc8DGf9R+kDxjxXFRDigKHnUjlo57OveI8ZAJFz3wNzEw/ 7EtZOPBzIMsiadjW0AU5dzzTDsGtVQfCFwHXhtXgLe+D5UM3rw+ye78RyAgzg0UA6wHm e4Ln6naNQs5sDyx3opVh1fhzaHUragK14Dm0XeFqSGiQeLKDylbuuZGKlHkWu5mCEt1C jfrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=pxXA+YWa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ez8-20020a056402450800b0045157918d66si6418806edb.355.2022.09.26.08.21.49; Mon, 26 Sep 2022 08:22:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=pxXA+YWa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236096AbiIZPTb (ORCPT + 99 others); Mon, 26 Sep 2022 11:19:31 -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> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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