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 926C5C32771 for ; Mon, 26 Sep 2022 08:59:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234600AbiIZI7U (ORCPT ); Mon, 26 Sep 2022 04:59:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233554AbiIZI7P (ORCPT ); Mon, 26 Sep 2022 04:59:15 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD14F3DBC4; Mon, 26 Sep 2022 01:59:14 -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 82E8421D36; Mon, 26 Sep 2022 08:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1664182753; 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=3Lb/jC5elVDHJVD4iZP6e8+D+hP4jLe4mPHbNOrwg2Y=; b=JWX1NuBwi+fFMrBUtA0Zb00NPb6CAYHpzM7/2hIUs7ghzr2e04MTjoo/o5YivNBSfp3bBZ q/4mPhv/F1b3+VLD0Nkp0Pf5n0sCJPNs5UqkIs8bv2cwDP7ewF/2IeXJLn3EG8gZWcjR6Y 7NEqZSEI6NUVBN9wNUrFFKZyvWhFRLg= 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 620A913486; Mon, 26 Sep 2022 08:59:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id R7icFeFpMWNCZwAAMHmgww (envelope-from ); Mon, 26 Sep 2022 08:59:13 +0000 Date: Mon, 26 Sep 2022 10:59:12 +0200 From: Michal Hocko To: Florian Westphal Cc: netdev@vger.kernel.org, tgraf@suug.ch, urezki@gmail.com, Paolo Abeni , "David S. Miller" , Eric Dumazet , Jakub Kicinski , herbert@gondor.apana.org.au, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, Martin Zaharinov , Paolo Bonzini , kvm@vger.kernel.org Subject: Re: [PATCH net] rhashtable: fix crash due to mm api change Message-ID: References: <20220926083139.48069-1-fw@strlen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220926083139.48069-1-fw@strlen.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 26-09-22 10:31:39, Florian Westphal wrote: > Martin Zaharinov reports BUG() in mm land for 5.19.10 kernel: > kernel BUG at mm/vmalloc.c:2437! > invalid opcode: 0000 [#1] SMP > CPU: 28 PID: 0 Comm: swapper/28 Tainted: G W O 5.19.9 #1 > [..] > RIP: 0010:__get_vm_area_node+0x120/0x130 > __vmalloc_node_range+0x96/0x1e0 > kvmalloc_node+0x92/0xb0 > bucket_table_alloc.isra.0+0x47/0x140 > rhashtable_try_insert+0x3a4/0x440 > rhashtable_insert_slow+0x1b/0x30 > [..] > > bucket_table_alloc uses kvzalloc(GPF_ATOMIC). If kmalloc fails, this now > falls through to vmalloc and hits code paths that assume GFP_KERNEL. > > I sent a patch to restore GFP_ATOMIC support in kvmalloc but mm > maintainers rejected it. > > This patch is partial revert of > commit 93f976b5190d ("lib/rhashtable: simplify bucket_table_alloc()"), > to avoid kvmalloc for ATOMIC case. > > As kvmalloc doesn't warn when used with ATOMIC, kernel will only crash > once vmalloc fallback occurs, so we may see more crashes in other areas > in the future. > > Most other callers seem ok but kvm_mmu_topup_memory_cache looks like it > might be affected by the same breakage, so Cc kvm@. > > Reported-by: Martin Zaharinov > Fixes: a421ef303008 ("mm: allow !GFP_KERNEL allocations for kvmalloc") > Link: https://lore.kernel.org/linux-mm/Yy3MS2uhSgjF47dy@pc636/T/#t > Cc: Michal Hocko > Cc: Paolo Bonzini > Cc: kvm@vger.kernel.org > Signed-off-by: Florian Westphal Please continue in the original email thread until we sort out the most reasonable solution for this. -- Michal Hocko SUSE Labs